Hi,
In general there's 3 parts for PXE booting - the PXE and networking support code (in the network card's ROM, or loaded from disk if the network card doesn't support it), then there's the PXE boot loader, and then more files that the PXE boot loader loads.
sevobal wrote:I've build a kernel and I'm able to load the kernel from a floppy via GRUB. Now I want to boot the system over PXE (using tftpd32). So I made a *.img file from the floppy. As PXELoader I use syslinux.0 and my config file looks like the following:
I don't know much about GRUB, but isn't there an easier way?
Theoretically, you should be able to boot GRUB directly using PXE, and then tell GRUB to use the pre-exisiting PXE/network code to get the files directly from the TFTP server - all without using any floppy image at all.
For this to work you'd need a version of GRUB compiled for PXE boot (or "grub-pxe"). In your TFTP server's directory (in "/tftproot" on some systems) you'd need to put "grub-pxe", and "grub.lst", plus your own files.
The "grub.lst" might look something like this:
Code: Select all
default 0
timeout 30
title=Diskless
root (nd)
kernel /kernel.bin
In this case PXE boots a "grub-pxe", GRUB downloads "grub.lst", then GRUB downloads "kernel.bin" and boots it.
There's also a generic tool (memdisk) that hooks BIOS interrupts 0x13 and 0x15 and uses RAM to pretend a floppy disk is present. This is mostly a hack used for OSs like DOS - if the software you try to boot uses the hardware directly (instead of using the BIOS functions), or if the software trashes the memory used to store the disk image or memdisk's code, then it won't work.
In this case PXE boots a PXE boot loader (e.g. GRUB or PXELINUX), the PXE boot loader boots memdisk, memdisk boots another boot loader (e.g. GRUB) on the "floppy" , and the second boot loader boots your kernel from the pretend floppy.
On of the problems for this is that memdisk will try to protect the memory it's using by telling GRUB that less memory is present than there really is. This means on a computer with 8 MB of RAM (less around 384 KB that is under the ROMs, etc), GRUB will be told that there's only 6.5 MB of RAM, and GRUB will tell your OS that there's only 6.5 MB of RAM (less around 384 KB that is under the ROMs, etc). The other 1.5 MB that was used by memdisk during boot will never be used after the OS boots.
Lastly there's the "do it yourself" way, which involves writing your own PXE boot loader. This is what I did (which is why I don't know much about GRUB). In this case PXE boots your PXE boot loader, and your PXE boot can load anything you like from the TFTP server, then free the memory used by PXE's networking stack.
For me, I try download a boot image with the same name as the network card's MAC address (e.g. "123456789ABC.img" if the network card's MAC address is "12.34.56.78.9A.BC"), and if this file doesn't exist it tries to download "install.img". The idea here is that you can configure the DHCP server so that the same PXE bootloader is used for all clients. If the OS hasn't been installed on the client it downloads the installation boot image, and while the OS is being installed it uploads a new boot image into the TFTP server's directory ready for later boots. The basic idea here is fully automated OS installation with very simple setup instructions (no need to manually mess with the DHCP server or TFTP server after they are initially setup, regardless of how many clients you install the OS on).
Cheers,
Brendan