summaryrefslogtreecommitdiff
path: root/doc/syscalls.txt
blob: bb53a458d8c68f3dc65fa6a5e879a9eda0918307 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Syscalls pass by int64. The identifier of the called function is in ebx, with
eax = 0, parameters are in ecx, edx, esi, edi.

Syscall list :

id=ebx	Name			Parameters				Description
  1		thread_exit		none					Signal kernel that current thread has finished
  2		schedule		none					Switch to next thread (might be the current one)
  3		thread_sleep	ecx: time (int) msecs	Tell kernel to put current thread to sleep
  4		process_exit	ecx: return value (int)	Tell kernel to end current process, cleaning up everything
  5		printk			ecx: addr of a string	Print a message to screen
  6		thread_new		ecx: entry point		Creates a new thread
						edx: data pointer
						esi: stack pointer
  7		irq_wait		ecx: irq number			Waits for an IRQ (requires privilege PL_DRIVER)
  8		proc_priv		none					Returns current process privilege level

  9		sbrk			ecx: size				Allocates some memory
  10	brk				ecx: new_end			Allocates/frees some memory

  11	mmap			(see linux specs)		not implemented
  12	munmap			(see linux specs)		not implemented

If a processes wishes to exit with an error code, it HAS to use process_exit. thread_exit will do nothing.