compiled newlib, need to hook up the system calls
This commit is contained in:
@@ -1,12 +1,31 @@
|
||||
.code32
|
||||
.extern schedule_next_task
|
||||
|
||||
|
||||
.code32
|
||||
.global yield
|
||||
yield:
|
||||
cli
|
||||
pushal
|
||||
push %esp
|
||||
call schedule_next_task
|
||||
movl %eax, %esp
|
||||
popal
|
||||
sti
|
||||
ret
|
||||
.extern schedule_next_task
|
||||
yield: # void yield()
|
||||
cli
|
||||
|
||||
pushfl
|
||||
pushl %cs
|
||||
|
||||
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 up.
|
||||
|
||||
# the stack now looks like a hardware interrupt just happened, even though we never called one.
|
||||
|
||||
pushal
|
||||
|
||||
pushl %esp
|
||||
call switch_context
|
||||
movl %eax, %esp
|
||||
|
||||
popal
|
||||
sti
|
||||
iret
|
||||
Reference in New Issue
Block a user