1. OSKit

The OSKit is a software development kit provided by the Flux research group at the CS department of Utah University. As a SDK, OSKit provides a basic framework and many higher-level component libraries to build or extend operating systems(1). A detailed manual can be found here. The latest version of OSKit can be obtained from ftp://flux.cs.utah.edu/flux/oskit/oskit-20020317.tar.gz.

2. How to compile OSKit

Download the OSKit archive to the clic host machine and place it in your VM directory (usually /vmware1 in the machine assigned to your group). extract it by

tar -vxzf oskit-20020317.tar.gz

We strongly recommend you to preserve a backup of the source code so that you can restore when messing up.

cd into the source directory (oskit-20020317), type

./configure --enable-modulefile=modules.x86.pc

The configure file is a shell script to probe system-dependent variables and generate Makefile for each of the directory in the source package. It may also create some .h files to contain some system-dependent definitions(1). After configure is executed, type

make

to build the object tree. It typically takes about 10-20 min depending on the current workload of the clic host machine. We recommend you to check whether some other cpu consuming processes (e.g. another VM) are running on the same machine (by command top) before compiling. To build or rebuild only one specific part of the OSKit, such as one of the libraries or one of the OS examples, you can simply go into the appropriate subdirectory of the object tree and run make from there. The top-level GNUMakefile essentially does nothing but runs make in each subdirectory, so it is always safe to run any OSKit Makefile manually. A few OSKit directories depend on others being built first--for example, the example kernels cannot be built until the OSKit libraries they use have been generated--but most of the OSKit libraries can be built completely independently of each other(1).

3. Get your VM started

To launch VM, cd into your VM directory (usually /vmware1 in the machine assigned to your group), type "vmware&" and open a new virtual machine by choosing linux.vmx. Start the virtual machine, choose "Red Hat Linux (2.4.20-8)" and login as "root" (the initial password is "w4118", you can change it later by passwd. Please remember to tell your group partners the new password). If you encounter any problem about VMWare license or read/write permission, execute

~w4118/setup_vm

to fix it. To download files from clic host machine, you may obtain its IP address by command arp. You may download file via:

scp: First, you need to delete the old ssh known host file by

rm /root/.ssh/known_hosts

Copy the archive file from remote:

scp [your cs account]@[IP addr of the clic host machine]:[path] [file name]

scp may prompt you to preserve the DSA key fingerprint, just type "yes". Then you need to input your password of your cs account.

ftp: Connect to ftp at clic host machine by

ftp [IP addr of the lcic host machine]

Input your cs account and password as prompted. cd into the directory that contains the OSKit archive

get [path]

4. Install and boot from example OS

After make is finished, you can find some compiled OS kernel image in [clic machine oskit directory]/examples/x86. SWITCH TO THE VIRTUAL MACHINE, download [clic machine oskit directory]/examples/x86/hello to [vm]/boot/. We will use GRUB to boot from kernel image. GRUB is a multi-boot loader that runs when a computer starts. It is responsible for locating and loading the OS kernel software which in turn initialize the rest of the OS(2).

Modified the configuration file of GRUB. Open /boot/grub/grub.conf, and add the following line at the end of the file:

title helloworld OS

kernel /hello

Reboot the VM and you will discover a new option in the grub boot menu called "helloworld OS". Switch to this option and press enter, GRUB will then boot from the hello image you complied just now. This is a toy OS which does nothing but displays a message and exits. If all goes on well, you would see the version information of OSKit followed by "Hello, World" on the screen.

Source

(1) http://www.cs.utah.edu/flux/oskit/

(2) http://www.gnu.org/software/grub/