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


Processes... (30.05.2012)


The simple scheduling of several processes works. Each of them uses their own memory (address spaces), and a simple round robin scheduler cycles between them. For some reason they cannot access the keyboard input buffer yet. Next: Fix this input problem; understand why fork only works when manually moving the child's stack pointer 8 bytes up; create a user mode library so that processes can be compiled C programs (instead of inline assembler). Here's the first running process:

    call dofork;
    call dofork;
    mov ebx, esp;      // print ESP
    mov eax, 0x1003;
    int 0x80;
    mov eax, 20;       // call getpid()
    int 0x80;
    mov eax, 0x1000;   // store PID in 0x1000
    mov [eax], ebx;
loop:
    call doshowpid;
    jmp loop;

dofork:
    mov eax,2;         // syscall 2: fork
    int 0x80;
    ret;

doshowpid:
    mov eax,0x1000;
    mov ebx,[eax];
    add ebx,'a'-1;
    mov eax,0x1001;    // syscall 0x1001: putchar
    int 0x80;
    ret;
It forks twice, so there are 4 processes running. The screenshot shows the beautiful output of process 4 (printing "d"s).

[ 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.