diff options
author | dzwdz | 2022-07-16 19:35:05 +0200 |
---|---|---|
committer | dzwdz | 2022-07-16 19:35:05 +0200 |
commit | b26098268eb443f1ed3dc50d902b2beee40c8342 (patch) | |
tree | 1b7bf720cde8e68fe1f446a414f38f4f63175227 /src/kernel/proc.c | |
parent | ce80ee8d40b0a2b48bfbbceac9a0baee189c5e1b (diff) |
amd64: seemingly working syscalls (SYSCALL/SYSRET)
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r-- | src/kernel/proc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 1cb6eb0..a202549 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -23,8 +23,10 @@ struct process *process_seed(struct kmain_info *info) { process_first->id = next_pid++; // map the stack to the last page in memory - pagedir_map(process_first->pages, (userptr_t)~PAGE_MASK, page_alloc(1), true, true); - process_first->regs.esp = (userptr_t) ~0xF; + kprintf("0x%x\n", (userptr_t)~PAGE_MASK); + pagedir_map(process_first->pages, (userptr_t)~PAGE_MASK, page_zalloc(1), true, true); + process_first->regs.rsp = (userptr_t) ~0xF; + kprintf("post stack\n"); // map .shared extern char _shared_len; @@ -36,7 +38,7 @@ struct process *process_seed(struct kmain_info *info) { for (uintptr_t off = 0; off < info->init.size; off += PAGE_SIZE) pagedir_map(process_first->pages, init_base + off, info->init.at + off, true, true); - process_first->regs.eip = init_base; + process_first->regs.rcx = init_base; // SYSRET jumps to %rcx return process_first; } |