How to compile and install LittleOS

Warning: It is assumed you have some knowledge of Linux and Grub. Use at your own risks. I'm not responsible for your mistakes.

What you need ?
   To compile LittleOS, you need Nasm and GCC (with binutils and make) and Linux. You can download Nasm from LittleOS's site or from the official site of Nasm. GCC should be installed in Linux.
   To boot LittleOS, you will also need Grub, it can be downloaded from LittleOS's site or from the official site of Grub.

How to compile ?
   Now, you have littleos-x.y.z-YYYY-MM-DD.tar.gz, extract it in /usr/src with the following command:
tar xfvz littleos-x.y.z-YYYY-MM-DD.tar.gz -C /usr/src

The sources will be in /usr/src/littleos-x.y.z. Go to this directory and edit config.mak if you want to change the compiler flags.
Now you can type 'make'. After some seconds the system is compiled.

How to install ?
   If GRUB is already installed on your PC, you can jump to section 2.

1. Create a floppy:
   You have to extract and compile Grub (read the documentation of Grub). Now you will need a blank floppy (already formated). Insert the disk and create the filesystem with the command:
mkfs.msdos /dev/fd0

Create the minimal directory structure:
mount /dev/fd0 /mnt/floppy
cd /mnt/floppy
mkdir boot
cd boot
mkdir grub

Now go to Grub's directory. Copy stage1/stage1 and stage2/stage2 to the floppy:
cd /usr/src/grub-x.y.z
cp stage1/stage1 stage2/stage2 /mnt/floppy/boot/grub/

Create menu.lst with your favorite text editor, for example:
cat /mnt/floppy/boot/grub/menu.lst << EOF
timeout=5
title=LittleOS
root=(fd0)
kernel=/kernel
EOF

You can unmount the floppy:
umount /mnt/floppy

Install grub on the floppy (boot sector):
   
  • go to Grub's directory
  • execute grub/grub (the commandline version of Grub).
  • in grub, type:
    install= (fd0)/boot/grub/stage1 (fd0) (fd0)/boot/grub/stage2 0x8000 p
  • now, exit grub (type "quit").

  • 2. Install the system:
       Mount the floppy and copy the kernel file to the root directory of the floppy:
    cp /usr/src/littleos-x.y.z/kernel/kernel /mnt/floppy

    If Grub is installed on your harddrive, edit your configuration file (menu.lst) and add:
    title= LittleOS
    root= (fd0)
    kernel=/kernel

    Now unmount the floppy (umount /mnt/floppy) and reboot. The system should boot on the floppy.

    If you have problems, questions or remarks please mail me:
    Pascal Lacroix (placr@hotmail.com).