Thursday, April 26, 2007

evolving to OKL4

Well, I was out of town for almost one week, now that I'm back, I've been informed that OKL4 has been released at Open Kernel Labs, and now getting it up and running seems much more simplier, than old iguana-devel:

wget http://portal.ok-labs.com/_assets/downloads/okl4_release_1.4.1.1.tar.gz
tar xvfz
okl4_release_1.4.1.1.tar.gz
./tools/build.py machine=ia32_pc99 project=iguana wombat=True simulate

I've noted some changes:

there is no lua script and init for iguana, therefore, I have a few questions:

What is the l4 to wombat init sequence, and where can I customize it?

The other thing: I'm trying to understand the iguana/server/src/main.c

but I can't find the server_loop() function code.

Here is some output:
jetorres@dolce:~/cool/okl4_release_1.4.1.1/iguana$ grep -r server_loop * ../libs/*
naming/src/naming_server.c: server_loop();
serial/src/main.c: server_loop();
server/src/main.c:extern void server_loop(void);
server/src/main.c: server_loop();
timer/src/main.c: server_loop();

Wednesday, April 11, 2007

Genesis II

Various processes running in the same computer implies a risk of having one process corrupting some other process memory, because of that; memory protection concept evolved into the allocation of distinct pages of memory for each process into segments, its limitations are defined by two hardware registers, hence, if a process tries to access memory outside the defined segment a protection mechanism is used, such as Intel's general protection faults. Having that; the concept of memory management unit (MMU) appeared as the set of components responsible for handling memory access from the CPU.

Time-sharing has also had a very interesting evolution into what we know as multitasking, which defines scheduling policies that decide which task runs at any given time, and establishes a mechanism known as context switching that reassigns CPU from one process to another. Concept began at computing early days, where peripherals (devices hooked up to the CPU) became much more slower than processing units, so when a process needed access to a peripheral, the CPU had to stop executing instructions while such peripherals were busy. Thus, multiprogramming idea came to scene by context switching every time a process was waiting, but that gave no guarantee of process to be run at proper times, since one could run for very long periods of time without triggering a context switch. That was absolutely not suitable for interactive computing needs, therefore cooperative multitasking was designed; there, processes ceded time to each other in a voluntary manner, however multitasking dangerously relied on each process to efficiently give time to the others, consequently the preemptive multitasking idea was born about assigning operating time slices to each process. Only then; processes were cataloged into two different groups; CPU-bounded ones as those who were fully utilizing CPU, and I/O bound processes as those waiting for input or output from peripherals. A perfect Martini came out of blending preemptive multitasking with hardware interrupts, which would rather than inefficient I/O bound process to constantly check for resource availability. It gives a call to subroutines handling the interrupt event of resource availability, changing I/O bound processes state from on hold or blocked to unblocked as it may correspond, meaning that blocked processes would properly return to execution.

At that point processes were so handy, that programmers started use them by assigning different tasks to different processes, which then was generally understud as a set of cooperating processes that people started to reffer as applications, the main issue behind it, was finding appropriate ways to exchange information between application's processes. As a result of that search; Threads were proposed as cooperating lightweight processes coexisting in a shared memory space or context, thus, another advantage was found in their favor, and it was that memory context switching was not necessary when context switching between threads.