Monday, July 13, 2009

On Architecture: RtLib

RtLib is the main runtime library that all apps will dynamically link against. While it is technically possible to write a DGOS app that does not use RtLib, it's needlessly complicated and pointless(One would have to do manual heap management, manually initialize all libraries, manually get and parse app params, manually make systemcalls, and not use any delay-loaded dynamic libraries). It provides useful things like
  • Runtime functions needed for support of float and double types (no need for each app to have a local copy and waste memory on it)
  • Systemcall wrappers (like VfsFileOpen or GetCurTid)
  • Memory management (like malloc, free, and realloc)
  • Other commonly useful things (like CreateThread or CreateProcess)
  • Manual library management(RtLibLibLoad, RtLibLibUnload, RtLibLibFindSym)
  • Syncronization primitives (like mutexes, semaphores, mailboxes, events, and request queues)
  • Startup code (init libraries, init heap, allow libraries to self-initialize, get app command and parameter block from the kernel, find main(), call main() )


It is currently my intention to make RtLib open source, just like all other non-kernel pieces of the OS.
Just like all non-kernel components of the OS, RtLib is compiled using the arm-elf-gcc toolchain (I use version 4.2.3). As a sidenote, the kernel is compiled using CodeWarrior, but all loadable kernel modules will be written using GCC as well.

1 comment:

Coffee-Turtle said...

I really enjoy reading all the tech background that goes into DGOS! All the stable foundation pieces seem to be coming along smoothly! Thank you for the updates.