The Munix Operating System

This is the placeholder website for the Munix OS. Come back in a while when we're done with it to see the website.
For developers:
We use the sourceforge CVS system to keep control of our code.

Configuring CVS on your system:


If you're on a Fedora Core system, then you will most likely already have cvs installed.
All the instructions below assume you're on breezy. If you're not, thats okay too. Your distribution will behave very similar.
If you're on breezy or hoary Ubuntu, do this as root:
	#apt-get install cvs
This will install the cvs client on your system.

You will also need ssh to login, so make sure you've installed that too (should be installed already):
	#apt-get install ssh

Now, if your GCC version is 4.0 or above, you're in trouble.
GCC 4.0 won't compile too many things.

do

#apt-get remove gcc-4.0
#apt-get install gcc-3.4

There, fixed now...


First we need to setup some environment variables:

export CVS_RSH=ssh
export CVSROOT=@cvs.sourceforge.net:/cvsroot/munix

That done, we'll get the actual code.
Prepare a directory on your local system which you will be developing from. Then CD to it.

Eg:

$mkdir munix-builds
$cd munix-builds

Then, to get the code, do this:

$cvs -z3 co munix

If successful, you'll be asked for your sourceforge password.
Then, you should see something like

cvs checkout: Updating munix
cvs checkout: Updating munix/gcc

Building a cross compiler

First step to OS construction, is to build ourselves a cross compiler.

We should now have binutils and gcc in our directories.
So go ahead and unpack them.

$tar -jxvf binutils-2.10.1.tar.bz2
$tar -jxvf gcc-3.4.0.tar.bz2

Now create two directories called "build-gcc" and "build-binutils" in the same directory where these unpacked things lie.
We don't want these cross compiled executables to interfere with the actual things, so create a directory, say "builds" in
your home directory. Now binutils and gcc will be compiled and installed into this directory.

Now do

$export TARGET=i386-elf
$export PREFIX=/home/`whoami`/builds


First, we compile the binutils.

$cd build-binutils
$../binutils-2.10.1/configure --target=$TARGET --prefix=$PREFIX --disable-nls
$make all install

The above steps should take about 10-11 minutes to finish.
This will compile and install cross binutils into your builds directory.

Next, we add the builds directory to our path.

export PATH=$PATH:$PREFIX/bin


Now, we have to create our cross compiler.
Since we don't have any C library headers to work with yet, we'll have to tell it not to use the headers.

Again starting from the directory where you unpacked the tarballs.

$cd build-gcc
$../gcc-3.4.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c --without-headers
$make all-gcc install-gcc


And thats it! Our cross compiler is ready in the ~/builds directory!


To use the compiler, add the line to your bashrc file (/etc/bashrc)

export PATH=$PATH:/home//builds/bin

The compiler itself will be  i386-elf-gcc.

So to compile a C file, we'll have

$i386-elf-gcc 

If you don't want to use such a big name, you could also do

$gcc -V 3.4 -b i386-elf 

Not that this is shorter... :P