You will need a BIOS supporting boot from network and a matching network card. This is becoming more popular in new PCs, especially ones with build in network adapters. Setup a server on the network (see diskless(8)) and modify your BIOS settings to try the network boot first.
If your BIOS does not support this, but you have a network card
supported by NetBSD's 'netboot' bootloader, you can boot to
DOS (see the discussion about dosboot.com below) and
use 'netboot.com' to load your kernel over the network.
To generate a suitable 'netboot.com' cd to
/usr/src/sys/arch/i386/stand/netboot, edit the
Makefile to define the options for your network adapter
and run "make netboot.com
".
If your hardware is capable of netbooting using PXE, it first tries to acquire an IP address using the Dynamic Host Configuration protocol (DHCP). The dhcpd server uses the ethernet address (MAC) of the client machine to determine its IP address and a bootloader filename. If this request is successful, PXE expects to be able to download a second-stage boot program via the Trivial File Transfer Protocol (TFTP). It will do this by setting up a TFTP connection to the server that answered the earlier DHCP request, and asking for the file name returned by the server. The second-stage boot program then loads the kernel using NFS from the server and path specified by the DHCP request.
There are two PXE bootloader files available in the /usr/mdec/ directory of base.tgz from the NetBSD distribution. pxeboot_ia32.bin should be used for most cases, since pxeboot_ia32_com0.bin will force the client to use its first serial port as the console. The serial console PXE file may be necessary for embedded systems (such as the Soekris line of hardware) which only have a serial console. Use 9600 8N1 settings.
Something like the following can be used in /etc/dhcpd.conf:
host pxehost { hardware ethernet 01:23:45:67:89:ab; # MAC address of PXE host fixed-address 192.168.17.42; # IP address of PXE host # stage 1: filename "pxeboot_ia32.bin"; # relative to /tftpboot # stage 2: next-server 192.168.42.1; # IP of NFS server option root-path "/usr/tmp/pxestuff/root"; # path on NFS server }
As a shortcut, if you have a lot of PXE systems, you can set up /etc/dhcpd.conf to group them all together:
class "pxe-clients-ia32" { match if substring (option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00000"; filename "pxeboot_ia32_com0.bin"; }
GRUB is a boot loader, that is capable of booting different OS types and some of them via network. GRUB itself is loaded from disk or network using a PXE or NBI (such as Etherboot) loader. Etherboot & GRUB supports many different NICs, more than the NetBSD's 'netboot' bootloader does. Note you'd need to use GRUB version 0.90 or later. GRUB and Etherboot require GCC and GNU Binutils 2.9.1 or later. They can be compiled on any system, they don't need to be compiled on NetBSD host.
You'd need to setup environment so that EtherBoot would load and execute appropriate GRUB image, and configure GRUB so that it would load NetBSD kernel. The necessary steps are outlined below.
option option-150 code 150 = text; group { subnet 192.168.0.0 netmask 255.255.255.0 { option log-servers 192.168.0.1; option domain-name-servers 192.168.0.1; # location of GRUB configuration file option option-150 "/tftpboot/grub.conf"; # NFS root path option root-path "/home/dolecek/netbsd-root"; # path of image EtherBoot should load and execute filename "/tftpboot/nbgrub"; } host foobar { fixed-address foobar; hardware ethernet 00:c0:6c:76:17:46; } }
# uncomment following two lines to use serial terminal # serial --unit=0 --speed=57600 # terminal --timeout=0 serial # Boot automatically after 5 secs. timeout 5 # By default, boot the first entry. default 0 # Fallback to the first entry. fallback 0 # For booting the NetBSD title NetBSD kernel --type=netbsd /tftpboot/netbsd
config netbsd root on ? type nfsThen, build the kernel and put it on TFTP server as configured in GRUB configuration file.
options "CONSDEVNAME=\"com\"",CONADDR=0x2f8,CONSPEED=57600to your kernel configuration.
The kernel on the floppy may be configured to mount the root filesystem over the network by using this in your kernel config file:
config netbsd root on ? type nfsIf you have not compiled a kernel before you should see the notes on how to build a kernel.
NetBSD compiles a special version of the bootloader into a small DOS program, called "dosboot.com". This is located in /usr/mdec on installed systems or in the base.tgz set. To use, copy both dosboot.com and your kernel onto a FAT (msdos) partition, and boot to DOS.
Press F8 while the string "Loading Windows XX" is displayed to enter the boot menu. The menu items displayed there will depend on your installation.
You may need to avoid loading the HIMEM.SYS driver and the EMM386.SYS driver. In this case choose "Step-by-step confirmation" and answer all questions with "n" or ESC.
If you don't mind HIMEM.SYS getting loaded, choose "Command prompt only".
Hold down the SHIFT key when the computer is booting to skip config.sys and autoexec.bat.
The dosboot utility is able to handle extended memory, as provided by the HIMEM.SYS driver. Unfortunately this gets into the way if NetBSD is going to make calls to the APM BIOS. There is no problem if you don't have an APM BIOS, or your NetBSD kernel does not use it (no "apm0 at mainbus0"). If you are going to use APM, don't load HIMEM.SYS when using dosboot.
If you wish to create a customised version of dosboot.com, cd to /usr/src/sys/arch/i386/stand/dosboot, edit the Makefile for special options (serial console, ...) and run "make".
NT's boot selector can be used to directly bootstrap NetBSD. For more details see the Adding NetBSD to the Windows NT boot menu section in the NetBSD/i386 FAQ.
|
|