f'd myself over of course, scheduler can now run user programs....

This commit is contained in:
2026-07-04 01:59:19 -05:00
parent 0b98ac0273
commit 17ccde3556
11 changed files with 109 additions and 60 deletions

View File

@@ -4,33 +4,33 @@
syscall_handler:
cli
pushfl
pushl %cs
push $0
push $0x80
movl 8(%esp), %eax
pushl %eax
movl 4(%esp), %ebx # Get CS
movl %ebx, 8(%esp) # Move CS over Old EIP
movl 0(%esp), %ebx # Get Return EIP
movl %ebx, 4(%esp) # Move Return EIP over CS
addl $4, %esp # Adjust stack pointer
pusha
movw %ds, %ax
pushl %eax
push %ds
push %es
push %fs
push %gs
pushal
pushl %esp
call switch_context
movl %eax, %esp
popal
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
popl %eax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
push %esp
call syscall
add $4, %esp
mov 28(%esp), %eax
sti
pop %gs
pop %fs
pop %es
pop %ds
popa
add $8, %esp
iret