Getting started


Technical notes

The kernel (master branch) is tested with the following configuration:

  • host OS: Linux 3.1.9-1.4-desktop x86_64
  • host compiler: gcc 4.6.2
  • target compiler: i686-pc-nucleos-newlib-gcc (GCC) 4.4.6 20110121 (prerelease)
  • test environment: qemu 0.15.1

BIG FAT NOTE: This software has never been tested on a real hardware but only with qemu.

To build the kernel and user-space apps

  • Move to source tree and configure the kernel:
    make ARCH=x86 CROSS_COMPILE=/path/to/crosstool/bin/i686-pc-nucleos-newlib- defconfigYou can run other configuration commands like make menuconfig or make xconfig but for now use default configuration.
  • Run the build (silent):
    make ARCH=x86 CROSS_COMPILE=/path/to/crosstool/bin/i686-pc-nucleos-newlib- imageIf you what to know what commands, flags etc. are used during a build then type the command with aV defined on the command line:
    make V=1 ARCH=x86 CROSS_COMPILE=/path/to/crosstool/bin/i686-pc-nucleos-newlib- imageIf you made some changes in sources then just type one of the mentioned commands and build system should rebuild/create all neccessary modules, apps and other binaries.
  • If everything went well you should have a kernel image file (e.g. kimage) in arch/x86/boot directory. Regarding the image check the Makefile in arch/x86/boot directory which binaries it involves.
  • To clean-up the source tree (delete object and dependency files but no applications):
    make ARCH=x86 cleanFor a complete clean run:
    make ARCH=x86 mrproper

Using with QEMU

To install the kernel you will need mount the disk image and copy the kernel binary into boot directory.
If you use the disk image from the site then following commands can be used:Mount the disk image:
sudo /sbin/mount -o loop,offset=1048576 ext2-1.1.0-alpha9.img directory/where/to/mountCopy the kernel image into boot directory on image:
sudo cp arch/x86/boot/kimage mounted/image/directory/bootUnmount the image:
sudo /sbin/unmount directory/where/is/mountedRun the qemu:
qemu -m 256 -boot c -vga std -hda ext2-1.1.0-alpha9.img

Using with VirtualBox

Convert the binary image to VDI format. Use the following command:
VBoxManage convertfromraw -format VDI qemudisk.img qemudisk.vdiThen in virtualbox you can try:“name”=”nucleos”
“Operating system”=”Others”
“Base memory size”=”128MB”

Using with VMplayer

1. Convert binary (e.g. hdd-1.1.0-alpha2-git758d239.img) to vmdk format by command:
qemu-img convert -f raw hdd-1.1.0-alpha2-git758d239.img -O vmdk hdd-1.1.0-alpha2-git758d239.vmdk2. Create a vmx config file. Take a look here for a how-to about how to create your own or you can use the one below

.encoding = “UTF-8”
config.version = “8”
virtualHW.version = “3”
ide0:0.present = “TRUE”
ide0:0.filename = “hdd-1.1.0-alpha2-git758d239.vmdk”
memsize = “128”
MemAllowAutoScaleDown = “FALSE”
ide1:0.present = “TRUE”
ide1:0.fileName = “auto detect”
ide1:0.deviceType = “cdrom-raw”
ide1:0.autodetect = “TRUE”
floppy0.present = “TRUE”
ethernet0.present = “TRUE”
usb.present = “FALSE”
sound.present = “FALSE”
displayName = “Nucleos”
guestOS = “other”
nvram = “hdd-1.1.0-alpha2-git758d239.nvram”
MemTrimRate = “-1”
ide0:0.redo = “”
ethernet0.addressType = “generated”
ethernet0.connectionType = “nat”
uuid.location = “56 4d f0 0a 60 52 37 b6-92 42 81 f1 f9 40 ed cc”
uuid.bios = “56 4d f0 0a 60 52 37 b6-92 42 81 f1 f9 40 ed cc”
ethernet0.generatedAddress = “00:0c:29:5d:bf:33”
ethernet0.generatedAddressOffset = “0”
tools.syncTime = “TRUE”
ide1:0.startConnected = “TRUE”
uuid.action = “create”
checkpoint.vmState = “”
tools.remindInstall = “FALSE”

Building GNU cross toolchain (on linux-like OS)

To build the cross-toolchain from sources:

  • Create building directory called e.g. buildcross
  • Download the script available here and copy it into the directory created in step 1.
  • Download the newlib sources available in repository
  • Dowload nucleos kernel sources from here
  • Download gcc-4.4.x, binutils-2.20.x sources from nucleos repository.
  • Move into building directory created in step 1 and type:
    WARNING: Do not run this script with root privileges!KERNELDIR=/path/to/nucleos/kernel/sources ./ -b /path/binutils/sources -c /path/gcc/sources -n /path/newlib/sources -g /path/gcc/sources
  • The final toolchain will be install into crosstool directory under directory created in step 1.

Compiling busybox

To build the busybox:

  • Download or build the cross-toolchain. You can download it from here.
  • Download modified busybox sources from my github repository.
  • Use one of the default configuration found in config directory:
    cp config/your-choose_defconfig .config
  • Build the sources:
    make KERN_NUCLEOS=1 CROSS_COMPILE=/path/to/crosstoo/bin/i686-pc-nucleos-newlib- all install
  • Install busybox by copying it on mounted filesystem.

Compiling testsuite

To build the testsuite:

  • Download testsuite sources from repository.
  • Download or build the cross-toolchain. You can download it from here.
  • On command line type:
    KERNELDIR=/path/to/nucleos/kernel/sources make CROSS_COMPILE=/path/to/crosstoo/bin/i686-pc-nucleos-newlib- all install
  • Install binaries (located in _install directory) on mounted filesystem.