2026-06-17 18:16:47 -05:00
|
|
|
.code32
|
|
|
|
|
.global syscall_handler
|
|
|
|
|
.extern syscall
|
|
|
|
|
syscall_handler:
|
|
|
|
|
cli
|
|
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
push $0
|
|
|
|
|
push $0x80
|
2026-06-17 18:16:47 -05:00
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
pusha
|
2026-06-17 18:16:47 -05:00
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
push %ds
|
|
|
|
|
push %es
|
|
|
|
|
push %fs
|
|
|
|
|
push %gs
|
2026-06-17 18:16:47 -05:00
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
mov $0x10, %ax
|
|
|
|
|
mov %ax, %ds
|
|
|
|
|
mov %ax, %es
|
|
|
|
|
mov %ax, %fs
|
|
|
|
|
mov %ax, %gs
|
2026-07-01 20:00:22 -05:00
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
push %esp
|
|
|
|
|
call syscall
|
|
|
|
|
add $4, %esp
|
|
|
|
|
|
|
|
|
|
mov 28(%esp), %eax
|
|
|
|
|
|
|
|
|
|
pop %gs
|
|
|
|
|
pop %fs
|
|
|
|
|
pop %es
|
|
|
|
|
pop %ds
|
2026-06-17 18:16:47 -05:00
|
|
|
|
2026-07-04 01:59:19 -05:00
|
|
|
popa
|
|
|
|
|
add $8, %esp
|
2026-06-17 18:16:47 -05:00
|
|
|
iret
|