interrupt-test.s 396 B

1234567891011121314151617181920212223242526272829
  1. .code32
  2. .text
  3. .globl main
  4. main:
  5. # fork 1 -> 2
  6. xorl %eax, %eax
  7. int $0x80
  8. movl %eax, %esi
  9. # fork 2 -> 4
  10. xorl %eax, %eax
  11. int $0x80
  12. movl %eax, %ecx
  13. # write
  14. movl $1, %eax
  15. movl $__user_interrupt_test_string, %edi
  16. int $0x80
  17. # sleep
  18. movl $2, %eax
  19. movl $0xffffffff, %edi
  20. int $0x80
  21. # noreturn
  22. jmp .
  23. .data
  24. __user_interrupt_test_string:
  25. .asciz "syscall 0x01 write: hello from user space\n"