summaryrefslogtreecommitdiff
path: root/doc/syscalls.txt
blob: 2972b97bbf6b254b9f739647825a33e7fd50509a (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
26
27
28
29
30
31
32
33
34
35
Syscalls pass by int64. The identifier of the called function is in eax, parameters
are in ebx, ecx, edx, esi, edi.

Syscall list :

id=eax	Name			Parameters				Description
  0		thread_exit		none					Signal kernel that current thread has finished
  1		schedule		none					Switch to next thread (might be the current one)
  2		thread_sleep	ebx: time (int) msecs	Tell kernel to put current thread to sleep
  3		process_exit	ebx: return value (int)	Tell kernel to end current process, cleaning up everything
  4		printk			ebx: addr of a string	Print a message to screen
  5		thread_new		ebx: entry point		Creates a new thread
						ecx: data pointer
  6		irq_wait		ebx: irq number			Waits for an IRQ (requires privilege PL_DRIVER)
  7		proc_priv		none					Returns current process privilege level
  8		shm_create		ebx: offset				Create a shared memory segment at offset (ret = errcode)
						ecx: length
  9		shm_delete		ebx: offset				Delete a shared memory segment at offset (ret = errcode)
  10	object_create	none					Creates an object for current process (returns a descriptor to it)
  11	object_owned	ebx: object descriptor	True (1) if object with this descriptor is ours, false(0) elsewhere
  12	object_close	ebx: object descriptor	Closes descriptor to an object (deleting it if necessary)
  13	request_get		ebx: object descriptor	Gets a request pending on object (only if we own it)
						ecx: pointer to write request
						edx: wait for a request ?
  14	request_has		ebx: object descriptor	Is there a request waiting on this object ?
  15	request_answer	ebx: object descriptor
						ecx, edx: answer		Answer a request on object
  16	request_mapShm	ebx: object descriptor	Map shared memory sent with request to receiver's address space
						ecx: offset
						edx: parameter number (0, 1 or 2)
  17	request			ebx: object descriptor	Send a blocking request to object
						ecx: pointer to user_sendrequest struct with information
  18	send_msg		same as above			Send a nonblocking request to object, same as above

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