972
edits
[unchecked revision] | [unchecked revision] |
m (Diskless booting moved to Diskless Booting) |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 3:
In order to boot up your kernel by network, you need a DHCP server, a TFTP server, and a program acting as client on the other computer.
== The GRUB Legacy Way ==
First, you have to create a floppy with [[GRUB Legacy]] configured for net support. You can
Although this is the simplest way, GRUB Legacy doesn't seem to support all network cards.
== The PXELINUX Way ==
Compile syslinux; a <tt>pxelinux.0</tt> file will be created. It is a PXE binary of a simple bootloader-over-tftp, which can be booted by the client computer (not the one with the TFTP server). After setting up DHCP and TFTP accordingly so the file boots, you can use pxelinux to load "memdisk", which comes with syslinux as well.
This file is loaded with a <tt>memdisk initrd=grub.ima</tt> syntax, which will cause pxelinux to load memdisk and grub.ima through TFTP. Memdisk will hook interrupt 0x13, and boot the disk image that way. (However, not all [[GRUB Legacy]] disk images seem to access floppies through bios. If you've got such an image you're stuck.)
You should get a <tt>pxelinux.0</tt> file, which can be loaded by, for example, etherboot. Many modern computers allow booting from NICs so you only need the TFTP and DHCP server up.
At this point, you can make changes to the grub.ima disk image, and put a [[GRUB Legacy]] config file and your kernel's binaries there.
Try <tt>mount /tftpboot/grub.ima /mnt/fpy -o loop</tt> under linux, for example.
== The gPXE +
[[GRUB
gPXE supports multiboot, but if it detects a multiboot image then it will not provide PXE services. Unfortunately, it detects your generated
To create a
<
./grub-mkimage -d . --format=i386-pc --output=core.img --prefix="(pxe)/boot/grub" pxe pxecmd
cat pxeboot.img core.img > grub2pxe
</syntaxhighlight>
The final thing you need to do is setup a DHCP/BOOTP/TFTP server. I used <tt>dnsmasq</tt> which came preinstalled on my workstations, and seems to be widely available in distributions. It can easily be configured on the command line or in <tt>/etc/dnsmasq.conf</tt> which uses the same syntax as the long-form command-line options but without the leading dashes. You will need the following options:
<
interface=... # be careful what interface the dhcp server runs on!
bind-interfaces # *really* only bind that interface
Line 44:
enable-tftp
tftp-root=/tftp # or wherever
</syntaxhighlight>
and there are other options to explore as well. Now make sure that you take <tt>grub2pxe,*.lst,*.mod</tt> from the
<
set timeout=0
set default=0
Line 57:
module /test
}
</syntaxhighlight>
Make sure your kernel and modules appear in the tftp root, and you should be set to boot using your gPXE media, over a private network connection hooked up between workstations.
Line 63:
==The Direct Way==
Both of the options above involve using someone else's code to do the dirty work, which may be undesirable in some situations - licensing conflicts, technical problems (e.g. for "memdisk" the interrupt 0x13 hook won't work in protected mode) and possibly personal pride. Fortunately, writing your own PXE boot code isn't as difficult as it sounds.
Line 71:
The PXE API is capable of doing raw UDP connections among several other things, however, for a start, you might just want to read files using TFTP.
==
===External Links===
*[http://osdev.berlios.de/netboot.html Tutorial on network booting]
*[http://home.dei.polimi.it/fornacia/progetto_minazzi/index.html#HOW%20TO%20INSTALL%20A%20TFTP%20SERVER Setting up a TFTP server]
*[http://tftpd32.jounin.net/ TFTP32 server]
*[http://download.intel.com/design/archives/wfm/downloads/pxespec.pdf PXE Specification]
[[Category:Booting]]
[[Category:Bootloaders]]
|