Thursday, June 25, 2009

Wednesday, June 24, 2009

Module Loader.2

Just did some testing and bug fixing. Module loader works as expected. Here's some technical info.

Each process has a list of loaded modules in it, including a reference count. When module A depends on module B, and A is loaded B is loaded automatically. If it was already a loaded (perhaps an already-loaded module C depended on it), its reference count gets incremented. This all assures that when all modules depending on a certain module are unloaded, it can as well be unloaded, so as to free up the address space it takes up. The per-process module list is just a linked list, containing base address, module name (not path), and a pointer to the system-global list.

The system-global module list is what enables memory sharing of code and read-only data between processes loading the same module. It is a hashtable, indexed by a hash of the PATH of the module. This means that process A can load library A version X from path Y ad process B can load library A version Z from path T and they will not collide. The global table entries also have reference count, but this is per-process. This means that if 2 processes load module A, it's ref count in global table will be 2. If one process loads the module 5 times, the global reference count will still be 1. In any case the point is that when no more processes have a module loaded, we can evict it from memory, and free it up.

Tuesday, June 23, 2009

Module Loader

Module loader appears to be complete. It now shared code and rodata pages between processes, and r/w data is shared using COW pages. This significantly reduces use of physical memory and is thus good. Now work moves on to testing this, and then to pagefile code.

Monday, June 22, 2009

COW & memory sharing

COW(copy on write) memory has been implemented, and I am 90% of the way there to implement code & data sharing between processes that load the same modules (thus saving valuable physical memory)

Saturday, June 20, 2009

Sector Cache

A simple sector cache has been added for block devices, causing a great increase in I/O throughput. :)

Wednesday, June 17, 2009

Debugging & USB

To help me debug userspace apps, the kernel has a builtin GDB stub, that allows debugging of any app on the device using the serial port. Unfortunately my PC has no serial port and I have no USBtoSerial adapters, so I am now writing the USB driver code, so that I can debug using USB.

This should be a useful tool for all other developers too, of course.

Friday, June 12, 2009


The kernel can now load libraries and executables, which can link dynamically to each other.

This works as expected! This is a huge step, and now work on RtLib resumes

Thursday, June 11, 2009

ElfLoader works!

May the man who created the Arm version of the Elf standard burn in hell! But despite his best efforts at creating the most convoluted and impossible to load binary format in the world I have written a loader for it. So far the loader can load and relocate an executable and any shared libraries it needs, including function calls between them!

Monday, June 8, 2009


The elf loader is well on track, and the continuing work on it has helped uncover some bugs in the VAD code (which upon closer inspection were bugs in the AVL tree code that is the storage for the VAD tree)

Friday, June 5, 2009


After spending more than 20 hours trying to do a build of gcc crosscompiler. Nothing worked. After a LOT of work, i managed to build gcc/gdb for target arm-elf, host linux-i686.

Now continuing work on the DGOS elf loader...


I implementing an ELF loader for the kernel. This will allow usage of unmodified arm-elf-gcc to make DGOS apps, libraries, and kernel modules.

Thursday, June 4, 2009


RtLib got a lot of work done on it, it now loads to the init process, as expected, and heap management as well as thread management work well.

Tuesday, June 2, 2009

Block Devices, PartitionManager, Loadable FSs/BlockDeviceDrivers

Block device manager got a few fixes and improvements, including ability to notify many clients about addition/removal of devices.

Parititon manager was separated out from VFS code and is now a separate component. This makes it easier to use.

Block device drivers and filesystems can now be implemented as loadable kernel modules, which can make future support of other FSs and devices easier.