more userspace stuff
This commit is contained in:
@@ -4,33 +4,33 @@
|
||||
syscall_handler:
|
||||
cli
|
||||
|
||||
push $0
|
||||
push $0x80
|
||||
pushfl
|
||||
pushl %cs
|
||||
|
||||
pusha
|
||||
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
|
||||
|
||||
push %ds
|
||||
push %es
|
||||
push %fs
|
||||
push %gs
|
||||
movw %ds, %ax
|
||||
pushl %eax
|
||||
|
||||
mov $0x10, %ax
|
||||
mov %ax, %ds
|
||||
mov %ax, %es
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
pushal
|
||||
|
||||
pushl %esp
|
||||
call switch_context
|
||||
movl %eax, %esp
|
||||
|
||||
popal
|
||||
|
||||
push %esp
|
||||
call syscall
|
||||
add $4, %esp
|
||||
|
||||
mov 28(%esp), %eax
|
||||
popl %eax
|
||||
movw %ax, %ds
|
||||
movw %ax, %es
|
||||
movw %ax, %fs
|
||||
movw %ax, %gs
|
||||
|
||||
pop %gs
|
||||
pop %fs
|
||||
pop %es
|
||||
pop %ds
|
||||
|
||||
popa
|
||||
add $8, %esp
|
||||
sti
|
||||
iret
|
||||
Reference in New Issue
Block a user