Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 3c20350

Browse files
authored
fix
1 parent 175e09b commit 3c20350

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/core/process.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ Process* process_create(char* name, int ppid, Domain domain, u32 entry, u32 stac
7979
}
8080

8181

82+
int load_program(Process* proc, void* code, size_t size) {
83+
if (!proc || !code || size == 0) {
84+
return -1;
85+
}
86+
87+
memcpy((void*)proc->entry, code, size);
88+
return 0;
89+
}
90+
91+
8292
void cswitch(cpu_state_t* new_state) {
8393
asm (
8494
"movl %0, %%esp \n"

0 commit comments

Comments
 (0)