interrupt-test.s 476 B

1234567891011121314151617181920212223242526272829
  1. .code32
  2. .text
  3. .globl main
  4. main:
  5. # fork 1 -> 2
  6. movl $0x02, %eax
  7. int $0x80
  8. movl %eax, %esi
  9. # fork 2 -> 4
  10. movl $0x02, %eax
  11. int $0x80
  12. movl %eax, %ecx
  13. # write
  14. movl $0x04, %eax
  15. movl $1, %ebx
  16. movl $__user_interrupt_test_string, %ecx
  17. movl $(__user_interrupt_test_string_end - __user_interrupt_test_string), %edx
  18. int $0x80
  19. xorl %eax, %eax
  20. ret
  21. .data
  22. __user_interrupt_test_string:
  23. .ascii "syscall 0x01 write: hello from user space\n"
  24. __user_interrupt_test_string_end: