more userlaand stuff
This commit is contained in:
36
kernel/syscall_stubs.S
Normal file
36
kernel/syscall_stubs.S
Normal file
@@ -0,0 +1,36 @@
|
||||
.code32
|
||||
.global syscall_handler
|
||||
.extern syscall
|
||||
syscall_handler:
|
||||
cli
|
||||
|
||||
push $0
|
||||
push $0x80
|
||||
|
||||
pusha
|
||||
|
||||
push %ds
|
||||
push %es
|
||||
push %fs
|
||||
push %gs
|
||||
|
||||
mov $0x10, %ax
|
||||
mov %ax, %ds
|
||||
mov %ax, %es
|
||||
mov %ax, %fs
|
||||
mov %ax, %gs
|
||||
|
||||
push %esp
|
||||
call syscall
|
||||
add $4, %esp
|
||||
|
||||
mov 28(%esp), %eax
|
||||
|
||||
pop %gs
|
||||
pop %fs
|
||||
pop %es
|
||||
pop %ds
|
||||
|
||||
popa
|
||||
add $8, %esp
|
||||
iret
|
||||
Reference in New Issue
Block a user