ELF kernel booting

Last updated: Oct 9, 1998.

Once you have built and ELF kernel and install it, you will discover that some things don't quite work like they used to. Here's how to fix that.

  1. Getting insmod to work again: you might not have a recent insmod, so during booting, loading of modules will fail for all the new ELF modules. To remedy this, get ftp://ftp.netwinder.org/pub/ccc/kernel/insmod.elf and install it as /sbin/insmod.

    Note that the old a.out insmod is still needed for loading a.out modules, such as the FP emulator. In /lib/modules/misc/ you will find a copy of the old insmod for this purpose. Ensure that at the top of your /etc/inittab file (on older disk images, you should instead check the /etc/rc.d/rc.sysinit file), the call to load the FP emulator specifically uses the old a.out version of insmod:

    	/lib/modules/misc/insmod -f /lib/modules/misc/fpem.o license=0
    	# rather than
    	insmod -f fpem.o
    since the latter will just use the wrong version of insmod.

    Also note that the ELF version of insmod in ccc/kernel cannot handle modules that were compiled with the PIC option to gcc. IF you need that support, get Pat Beirne's insmod from ftp://ftp.netwinder.org/users/p/patb/modutils-2.1.107.tar.gz.

  2. Errors about /dev/therm are caused by the fact that the new kernel's therm driver now uses the standard /dev/temperature with marjor=10, minor=131 instead of the previous home-made values. Unfortunately the set_therm utilities still make reference to /dev/therm, so the short term solution is to make the new device node, then make a sylink from the old name to the new one:

    	cd /dev
    	mknod -m 666 temperature c 10 131
    	rm therm
    	ln -s temperature therm
    After this, there should not be further complaints about /dev/therm. Note that the proc entry is still called /proc/therm, because it returns more information than would normally appear when reading from /proc/temperature.

  3. Errors about missing clock can be fixed by moving the program to the proper directory. It should be in /sbin:

    	mv /usr/bin/clock /sbin/clock

  4. Another source of confusion is the settings to be used in the firmware. Traditionally, the NetWinder had /dev/hda1 reserved for the kernel, then the root filesystem was on /dev/hda2, swap is on /dev/hda3 and (if your disk is >810 MB) then the rest would be /dev/hda4.

    The 2.0 firmware defaults are different from the above. Since the kernel can now be loaded from a filesystem, there is no need for a separate kernel partition. So the kernel partition is gone and the other three slide down a spot: root is now /dev/hda1, swap is on /dev/hda2, and any extra disk space is in /dev/hda3.

    If you have an old machine and are upgrading it to new firmware, then you need to change the kerndev and rootdev fields to point at the proper place where your kernel and root file system are, generally this would be /dev/hda2 for older machines since they had a separate partition for holding the kernel on /dev/hda1.

  5. If you use X window system, or SVGAlib, then you'll quickly notice that when you quit (or try to switch back to a console), the screen stays in graphics mode. This is because the mode-switching code in the ELF kernel has been removed. It is expected for the app (X or SVGAlib) to do this. This is how things are on x86 platforms, so we're following suit. (Also there was some font related problem that required making the change).

    Pat has a new, accelerated X server that properly restores the modes (it also does a lot of other things...). The old X server (framebuffer) and the current SVGAlib do not restore the mode, so after exiting (or if you crash), you will be typing blindly. It was claimed that typing textmode would restore the display, but that hasn't worked for me. My solution has been not to use X, and when I forget, just press CTRL-ALT-DEL to reboot. You won't see the normal messages as you shut down, but it will work as normal.

  6. By default, sound support is not compiled in due to an annoyance with the config files. If you need sound support, either get an older sound.o module, or rebuild your own kernel. In menuconfig, enable sound and enable WaveArtist support for VNC. The default values for DMA, base address and such are correct, no need to change them.

Hardware bugs