From 32d12d09cab7f2cea0c1965931b37aaaad751c8e Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 27 Jun 2024 13:05:16 -0400 Subject: [PATCH] load: replace raw descriptor numbers with macros --- sched/load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sched/load.c b/sched/load.c index f7fa9f8..feafc17 100644 --- a/sched/load.c +++ b/sched/load.c @@ -100,9 +100,9 @@ pid_t elf_load_proc(char *fname) proc->regs.rflags = 0x242; /* descriptor #7 is the user code segment */ - proc->regs.cs = 0x38 | 3; - proc->regs.ss = 0x40 | 3; - ds_write(0x40 | 3); + proc->regs.cs = GDT_SEGMENT_CODE_RING3 | 3; + proc->regs.ss = GDT_SEGMENT_DATA_RING3 | 3; + ds_write(GDT_SEGMENT_DATA_RING3 | 3); /* allocate user stack */ uintptr_t stack_buf = (uintptr_t)buddy_alloc(0x1000);