summaryrefslogtreecommitdiff
path: root/doc/syscalls.txt
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 23:48:56 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 23:48:56 +0200
commit43d0bb8e3997022e5270f7f75f615a47819c929e (patch)
tree937992d286966edecf81b405e414230c85d19bad /doc/syscalls.txt
parente9683297bf480f9590b0e5796f4520fb430e2e03 (diff)
downloadTCE-43d0bb8e3997022e5270f7f75f615a47819c929e.tar.gz
TCE-43d0bb8e3997022e5270f7f75f615a47819c929e.zip
Basic object system - THIS IS STILL A LONG WAY TO GO!!
Diffstat (limited to 'doc/syscalls.txt')
-rw-r--r--doc/syscalls.txt64
1 files changed, 45 insertions, 19 deletions
diff --git a/doc/syscalls.txt b/doc/syscalls.txt
index c94db19..d37d822 100644
--- a/doc/syscalls.txt
+++ b/doc/syscalls.txt
@@ -1,25 +1,51 @@
-Syscalls pass by int64. The identifier of the called function is in eax, parameters
-are in ebx, ecx, edx, esi, edi.
+See objects.txt for info about the object model in the kernel.
+
+Syscalls are called with int64.
+
+== Calls to objects
+
+When eax != 0, the value of eax is the ID of an object in the process's handle list.
+In that case, ebx is the number of the method to be called,
+and ecx, edx, esi, edi are the parameters.
+
+
+== Calls to other stuff
+
+When int64 is called with eax = 0, it's identified as a normal syscall from the following list:
+
+The identifier of the called function is in ebx, parameters are in 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
- edx: stack 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 sbrk ebx: size Allocates some memory
- 9 brk ebx: new_end Allocates/frees some memory
-
- 10 mmap (see linux specs)
- 11 munmap (see linux specs)
+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
+
+ 13
+ ... UNUSED (yet)
+ 19
+
+ 20 open ecx: ptr to path str Looks for an object in the hierarchy, returns a handle
+ 21 open_relative ecx: ptr to path str Looks for an object using a given root object
+ edx: base object handle
+ 22 close ecx: object handle Close handle to an object
+ 23 get_methods ecx: ptr to iface name Gets the numbers of the methods in an interface
+ str
+ edx: ptr to where to store
If a processes wishes to exit with an error code, it HAS to use process_exit. thread_exit will do nothing.