36 lines
435 B
ArmAsm
36 lines
435 B
ArmAsm
|
|
.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
|