This FAQ is maintained by Brian Candler; please send all updates to B.Candler@pobox.com. The latest version of this document is available at http://pobox.com/~b.candler/elks/elks-faq.html. Note that ELKS is in the very early stages of development and this information is likely to become out of date rapidly.
Additional information can be found at the Linux-8086 home page at http://www.uk.linux.org/Linux8086.html.
There is a mailing list. To subscribe, send a message to majordomo@vger.rutgers.edu containing the words subscribe linux-8086 in the body.
More information on the background, goals and current status of the project can be found at the ELKS home page.
tar -xvzf Dev86-0.0.6.tar.gz -C /usr/src
tar -xvzf elks-0.0.43snap.tar.gz -C /usr/src
The development environment will be created in /usr/src/linux-86, and
the kernel source in /usr/src/linuxmt. Next you have to build the
development tools, which include the bcc compiler:
cd /usr/src/linux-86
make install
Next, if you have any patches, apply them to your source directory
(there is currently a patch to 0.0.43 on
Brian Candler's ELKS page),
then compile the kernel.
cd /usr/src/linuxmt
patch -p1 <patchfile # -p1 strips off initial 'linuxmt/' from names
make dep
make
(If you're used to building normal kernels with gcc, you'll be amazed at
how quick this is! :-) The result is a floppy disk image called "Image",
which you can copy to a formatted floppy and boot from.
dd if=Image of=/dev/fd0
You should now be able to boot with this disk, but you won't get much
further without a root floppy disk for it to mount. You'll need to use
bcc to compile an 'init' program and make a root minix filesystem.
This is explained further down.
Compile your program like this:
bcc -0 -O -ansi -s init.c -o init
-0 selects 8086 code generation,
-O enables optimisation,
-ansi enables ansi-style function prototypes (only), and
-s strips symbols out of the
binary.
A real version of 'init' is being prepared for inclusion in the tiny-utils package, also on linux.mit.edu.
mkdir /usr/src/root86
cd /usr/src/root86
mkdir dev
cd dev
mknod tty c 4 0
cd ..
mkdir sbin
cd sbin
cp init
cd ..
fdformat /dev/fd0H1440 # if floppy not yet formatted
mkfs -t minix /dev/fd0 1440
mount -t minix /dev/fd0 /a # need a mount point "/a"
cp -pR /usr/src/root86/* /a
umount /a
Alternatively, if you have a 2.0.x kernel and mount-2.5k, you can use the
loopback filesystem to create a disk image on your hard disk, and then
dump it to floppy
dd if=/dev/null of=root.image bs=18k count=80
losetup /dev/loop0 root.image
mkfs -t minix /dev/loop0 1440
mount -t minix /dev/loop0 /a
...
umount /a
dd if=root.image of=/dev/fd0
cd /usr/src/linux-86/elksemu
make module
insmod binfmt_elks.o
Note that you will need to rerun the 'insmod' each time you reboot. There
are some sample bcc programs you can try in /usr/src/linux-86/tests
(such as a version of 'wc')
floppy { device /dev/fd0 threeinch }