summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 12:20:45 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 12:20:45 +0200
commit5cac9acd3aedc8043d4272d93c56805c46ff6214 (patch)
treeba9eb5ef86f7cf7afd4f7ab02de1d6bb86715632 /doc
parent66b32658d2e5aa99493dcb3abcb73cdb2cc6f0b5 (diff)
downloadTCE-5cac9acd3aedc8043d4272d93c56805c46ff6214.tar.gz
TCE-5cac9acd3aedc8043d4272d93c56805c46ff6214.zip
Some cleanup ; relocated the kernel at 0xC0000000
Diffstat (limited to 'doc')
-rw-r--r--doc/directories.txt19
-rw-r--r--doc/memlayout.txt18
-rw-r--r--doc/messaging.txt48
-rw-r--r--doc/roadmap.txt22
-rw-r--r--doc/syscalls.txt32
5 files changed, 33 insertions, 106 deletions
diff --git a/doc/directories.txt b/doc/directories.txt
index b0adf7b..c5d3208 100644
--- a/doc/directories.txt
+++ b/doc/directories.txt
@@ -1,11 +1,12 @@
This file explains all the directories of the source tree :
-doc documentation about the system
-mnt temporary folder for mounting disk images
-src source code
-src/include all includable headers to be used in userland
-src/include/gc Grapes Core (communication with the kernel) headers
-src/include/gm Grapes Modules headers
-src/kernel kernel source
-src/library source and linkable objects to be used by userland applications
-src/modules userland applications
+doc documentation about the system
+mnt temporary folder for mounting disk images
+src source code
+src/kernel source code for everything running in kernel-land
+src/common source code for stuff (libraries) that can run in kernel or user land
+src/common/inc user&kernel-shared headers
+src/user source code for stuff that can run only in user land
+src/user/lib userland libraries
+src/user/lib/inc header files for these libraries
+src/user/app userland apps
diff --git a/doc/memlayout.txt b/doc/memlayout.txt
index 6720d00..af760ca 100644
--- a/doc/memlayout.txt
+++ b/doc/memlayout.txt
@@ -1,8 +1,14 @@
-This is the memory layout of a standard service :
+This is the memory layout of a standard process :
+This can be changed by the app :
- 0x00100000 to 0x20000000 Application's code and static data
-- 0x20000000 to 0x6F000000 Application's heap
-- 0x70000000 to 0x80000000 Free space, can be used for mapping device memory
-- 0x80000000 to 0xD0000000 Space for mapping shared memory segments
-- 0xD0000000 to 0xDF000000 Stacks (automatically allocated by kernel, size 0x8000 each)
-- 0xE0000000 to 0xFFFFFFFF Kernel code and heap
+- 0x20000000 to 0xB0000000 Application's heap
+- 0xB0000000 to 0xBF000000 Stacks (automatically allocated by kernel, size 0x8000=32k each)
+This is necessary :
+- 0xC0000000 to 0xFFFFFFFF Kernel code and heap
+
+The beginning of the kernel code at 0xC0000000 corresponds to the linker-defined
+symbol k_highhalf_addr, that is used at as many places as possible.
+If this address was to be changed, it would have to be changed in two places :
+- link.ld, change address of k_highhalf_addr;
+- loader_.asm, update the temporary GDT structure data.
diff --git a/doc/messaging.txt b/doc/messaging.txt
deleted file mode 100644
index 804bb5d..0000000
--- a/doc/messaging.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-Message passing is the technique used by processes for communicating with each other.
-It is based on a few basic functions :
-
-= msg_register =
-Registers the current process as the owner of a system channel.
-System channels are aliases for PIDs (negative PIDs resolve to corresponding real PID).
-They range from -1 to -255. They are allocated as follows :
- from -1 to -19 : drivers
- -1 = keyboard
- -2 = mouse
- from -20 to -29 : network services
- -20 = networking subsystem (may be in several parts)
- from -30 to -39 : system services
- -30 = virtual file system
- -31 = logger
- -32 = user server
- from -40 to -49 : UI services
- -40 = graphic server (includes VESA driver for now)
- -41 = sound server
-Modules for HDD drivers, network cards, sound cards, ... do not register as devices but instead
-notify of their presence to the corresponding service.
-
-= msg_send =
-Sends a message to a process. Arguments:
-- Receiver PID or system channel id
-- Message data (up to 64k bytes, minimum 4 bytes)
-The first 4 bytes of the message data always designate the message code (function).
-The kernel may intercept some special messages (as "kill process" or stuff like that).
-
-= msg_info =
-Gets first message in the queue for current process.
-Function can block waiting for a message if asked by caller and if no other function already does it.
-When it is there, return the following:
-- If a message has come
-- The sender PID
-- The message code (first 4 bytes of data)
-- The length of the data
-
-= msg_get =
-Reads the data of the first message in the queue for current process.
-Is passed a pointer where the data will be written. It is supposed that enougth memory is already allocated.
-
-From a kernel point of view, message passing is asynchronious,
-but there also are userland functions for making them look synchronious by waiting for an answer.
-Usually, message codes | 0x80000000 are answers to a message.
-
-Most processes, most of the time, will be in a loop waiting for messages to come.
-The drivers are the principal exception to that, they instead wait for an interrupt or another hardware signal.
diff --git a/doc/roadmap.txt b/doc/roadmap.txt
index cf14395..dabae61 100644
--- a/doc/roadmap.txt
+++ b/doc/roadmap.txt
@@ -1,11 +1,11 @@
-** 0.0.4 'Cat in my heart' **
-- [OK] Userland heap (meaning kernel can give memory to processes)
-- [OK] Userland helper functions for objects (server and client, shared memory segment manager)
-- [OK] Basic object method for knowing if object handles another method (list methods in src/include/gm)
-- [OK] A manager module that manages all other running modules (the privilege of manager is given by the kernel to the first module loaded)
-
-** 0.0.5 'Truth is better cold' **
-- Review privilege system
-- Driver processes can ask to map physical memory in their address space
-- Redo all messaging stuff, simpler.
-- Keyboard driver, veryveryvery simple shell module using kbd driver and printk
+T/CE is a new project with a lot of ideas and not a lot of organization.
+
+Stuff to do :
+
+- remove useless code from grapes
+- clean up existing code
+- reorganize directories
+
+- document the new syscall (Interface/Class/Object) system
+- basic implementation
+
diff --git a/doc/syscalls.txt b/doc/syscalls.txt
index 28eb636..89a1003 100644
--- a/doc/syscalls.txt
+++ b/doc/syscalls.txt
@@ -15,38 +15,6 @@ id=eax Name Parameters Description
6 irq_wait ebx: irq number Waits for an IRQ (requires privilege PL_DRIVER)
7 proc_priv none Returns current process privilege level
8 proc_setheap
- 9 shm_create ebx: offset Create a shared memory segment at offset (ret = errcode)
- ecx: length
- 10 shm_delete ebx: offset Delete a shared memory segment at offset (ret = errcode)
- 11 msg_register ebx: service id Registers current process as owner of a system channel (ret = errcode)
- 12 msg_send ebx: receiver pid Sends a message to pid or owner of system channel
- ecx: message data ptr
- edx: message length
- 13 msg_info ebx: answer struct ptr Get info on the first message of the queue for this process
- ecx: wait?
- 14 msg_get ebx: pointer to data Gets the data for first message on the queue; deletes message from queue
-
If a processes wishes to exit with an error code, it HAS to use process_exit. thread_exit will do nothing.
-====== SYSCALL DESCRIPTION ======
-
-= msg_register (10)
-Parameters: requested system channel id (int)
-Returns: errorcode or 0 on success
-Registers current process as owner of given system channel.
-
-= msg_send (11)
-Parameters: receiver pid (signed! int), data ptr (void*), data len (unsigned)
-Returns: errorcode or 0 on success
-Sends a message to given PID or owner of given system channel.
-
-= msg_info (12)
-Parameters: pointer to answer struct (msg_info_answer*), wait for request? (bool)
-Returns: nothing (all is in answer struct)
-Gets info on waiting messages for current process.
-
-= msg_get (13)
-Parameters: pointer to data struct (void*)
-Returns: errorcode or 0 on failure
-Gets the data for a message that is in the queue.