.extern _syscall .section .bss, "aw", @nobits .align 16 syscall_stack_bottom: .skip (1 << 16) # 16 KiB syscall_stack_top: .section .text .global syscall syscall: mov $0x10, %edx mov %ax, %ds mov %ax, %es mov %ax, %fs mov %ax, %gs mov %esp, %edx mov $syscall_stack_top, %esp push 0x10(%edx) push 0x0C(%edx) push 0x08(%edx) push 0x04(%edx) push 0x00(%edx) push %ecx push %ebx push %eax call _syscall pop %eax pop %ebx pop %ecx iret