mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
user thread/process and elf loader stub
This commit is contained in:
@@ -11,3 +11,16 @@ void arch_regs_setupkernel(arch_regs* regs, void* ip, void* stack, bool interrup
|
||||
regs->ss = 0x30;
|
||||
regs->rflags = interrupts ? 0x200 : 0;
|
||||
}
|
||||
|
||||
void arch_regs_setupuser(arch_regs* regs, void* ip, void* stack, bool interrupts){
|
||||
regs->rip = ip;
|
||||
regs->rsp = stack;
|
||||
regs->cs = 0x38 | 3;
|
||||
regs->ds = 0x40 | 3;
|
||||
regs->es = 0x40 | 3;
|
||||
regs->fs = 0x40 | 3;
|
||||
regs->gs = 0x40 | 3;
|
||||
regs->ss = 0x40 | 3;
|
||||
regs->rflags = interrupts ? 0x200 : 0;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user