KERNEL 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. KERNEL SYSTEM CALL INTERFACE:
  2. The kernel system calls are all done through interrupt 0x80
  3. All parameters are passed in the 'AX,BX,CX,DX,DI,SI' registers.
  4. The AX register contains the system call number.
  5. The BX,CX,DX,DI,SI registers contain the first 5 arguments from the stack.
  6. (NB If the syscall is know to have less than 5 args the rest are not loaded)
  7. On return from the syscall AX has the return value.
  8. If AX is -ve then errno= -AX and return val = -1;
  9. The system calls are named in syscall/syscall.dat.
  10. There is a script syscall/mksyscall which generates the assembler for the
  11. system calls, near the top there is a line:
  12. COMPACT=1
  13. If this is changed to
  14. COMPACT=0
  15. the code generated will be slightly faster and larger.
  16. -RDB
  17. KERNEL SIGNAL INTERFACE:
  18. It is assumed the kernel will never pass a signal to the userspace
  19. routine unless it's _explicitly_ asked for!
  20. The Kernel need only save space for _one_ function pointer
  21. (to system_signal) and must deal with SIG_DFL and SIG_IGN
  22. in kernel space.
  23. When a signal is required the kernel must set all the registers as if
  24. returning from a interrupt normally then push the number of the signal
  25. to be generated, push the current pc value, then set the pc to the
  26. address of the 'system_signal' function.
  27. This is in syscall/signal.c
  28. -RDB