grub2_netboot

grub2 netboot : Merging etherboot 5.3.14 with grub2

 

download

Code is no longer available for donwload as this project is discontinued.

Testing it



grub2_netboot 23 june 2005

It looks like, this time, the free magic problem has been found. It is documented here

grub2_netboot_5

It is now possible to seek in file, for instance, the following works (although it downloads the same file multiple times):
	grub> ifconfig
[...]
grub> loopback lo (nd)tfile
[...]
grub> ls (lo)/
[...]
grub> cat (lo)/file.txt
[...]
I have tested three different card: Tulip, e1000, nforce2 as well as three compilers: gcc-2.95, gcc-3.0, gcc-3.3 However, the memory problem is still there, and I have no idea where it comes from. It varies depending on the compiler, the optimization flag, and some very small changes in the code. But it is always possible to find one combination of these for which the problem appears after loading a linux kernel or after the command boot or after a cat of a text file in the loopback device.

grub2_netboot_4

The memory problem is gone. Driver for Tulip cards has been ported and tested on a DS21140 chip.
Compilation has been tested on ubuntu 5.04 with gcc 3.3.5 (Debian 1:3.3.5-8ubuntu2) and debian woody with gcc version 2.95.4 . Compilation on ubuntu required the installation of the following packages : libncurses5-dev (not detected by configure) and liblzo-dev.


grub2_netboot_3

the memory problem is still there but with the addition of a grub_printf() instruction before freeing the memory, the error message disappears

grub2_netboot_2

It is now possible to use commands like:
	cat (nd0,tftp)test
configfile (nd0,tftp)menu.lst
linux (nd0)/linux_24
but it is still broken: It is not yet possible to seek in the file and there is some memory corruption (grub_free: free magic is broken)

grub2_netboot_1

	./configure
make
./grub-mkimage -v -d . -o core.img _chain _linux boot cat chain cmp configfile default ext2 fat font fshelp grub_pci halt hello help linux loopback ls multiboot normal pc reboot terminal timeout drv_e1000 drv_forcedeth pcimodprobe
dd if=boot.img of=grub_disk bs=512 count=1
dd if=core.img of=grub_disk bs=512 seek=1

dd if=grub_disk of=/dev/fd0
At the grub prompt, type ifconfig, the e1000 card is sucessfully detected. It should be very easy to add more drivers from etherboot. The following message should be printed (if there is a dhcp server reachable)
	grub> ifconfig
Probing pci nic...
[e1000-82540em]Ethernet addr: 0:c0:9f:17:f7:4d
driver name: E1000 (device: e1000-82540em) probe=0
CPU 1873 Mhz
Searching for server (DHCP)
Configuration successfull
Me: 192.168.0.13, Server: 192.168.0.150, Gateway: 192.168.0.1
Unable to load file
sleep
grub>
The remote files should then be accessible with the following syntax : (nd0,tftp)filename. For instance:
	grub> linux (nd0,tftp)/linux_2.4.24
This part has to be done, the functions to be implemented are in fs/netfs.c. The tftp functions are already there in netboot/*, the netfs functions should just call these functions and return the suitable structures.