hgesser.com/ulix/

The Implementation of the ULIX Literate Operating System

header

Navigation

Privates

Publikationen

Studium

Software

Sonstiges

Blaue Links: intern
Rote Links: extern

Suche Linux-Bücher bei
Amazon.de


Subscribe ULIX: Literate Unix

A diary documenting the implementation of ULIX-i386

Welcome to the ULIX blog.

Ulix (Literate Unix) is a Unix-like operating system developed at University of Erlangen-Nürnberg. I use D. E. Knuth's concept of Literate Programming for the implementation and documentation. The goal was a fully working system which can be used in operating system courses to show students how OS concepts (such as paging and scheduling) can be implemented. Literate programs are very accessible because they can be read like a book; the order of presentation is not enforced by program logic or compiler restrictions, but instead is guided by the implementer's creative process.

Ulix is written in C and assembler for the Intel architecture. The literate programming part is handled by noweb.

On this page I document my progress with the implementation.


Navigation: 2015 | 2014 | 2013 | 2012 | 2011


Debugging the Kernel with Bochs (14.08.2011)


Debugging the Ulix kernel requires use of some tools: I use Bochs (a fresh compile with the configure options --enable-debugger and --enable-disasm). Compared to a standard configuration of Bochs, I do a few things differently via the config file (bochsrc.txt):

  • port_e9_hack: enabled=1 lets me use a special outb() command to write to the terminal from which Bochs was started -- helpful when video is not yet setup
  • magic_break: enabled=1 allows me to insert the useless assembler statement xchg bx,bx anywhere in the code and have execution stop at that point (without having to set the breakpoint manually inside Bochs)
  • debug_symbols: file=ulix.sym makes Bochs read a symbol table at startup so it can output addresses relative to the start of some function. However no tool immediately produces the symbol table in a format that Bochs can read. I use the following command to create a fitting table:
    objdump -D ulix.bin | grep -e '^[^ ]* <' | sed -e 's/<//' -e 's/>://' > ulix.sym
    
    (This works only for ELF binaries.)
All of that together makes debugging the kernel a bit easier: Bochs can show information about registers, the GDT, TSS and many more interesting things.

Resources used:
Bochs, http://bochs.sourceforge.net/

[ Path: | persistent link ]

Copyright © 2011-2015 Hans-Georg Eßer; Server: Debian Linux, Apache Web Server, blog page powered by blosxom :: the zen of blogging, Theme: Hazard Area 1.6 (modified), created by Bryan Bell, Copyright © 2000-2006 Weblogger.com.