xref: /netbsd-src/usr.sbin/ndbootd/README (revision fd8d9e615bf2e4fcf0ada5741d5623d17e01b66e)
1*fd8d9e61Sfredette#	$NetBSD: README,v 1.3 2001/06/13 21:38:30 fredette Exp $
2ab467667Sfredette
3*fd8d9e61SfredetteREADME for ndbootd-0.5
42d0f1618Sfredette
52d0f1618SfredetteCopyright (c) 2001 Matthew Fredette.  All rights reserved.
62d0f1618Sfredette
72d0f1618SfredetteSee the file COPYING for no-warranty and distribution terms.
82d0f1618Sfredette
92d0f1618Sfredettendbootd is a daemon that serves Sun's old Network Disk (ND) protocol.
102d0f1618SfredetteThis protocol was designed by Sun before they designed NFS.  ND simply
112d0f1618Sfredettemakes the raw blocks of a disk available to network clients.  Contrast
122d0f1618Sfredettethis with the true namespace and file abstractions that NFS provides.
132d0f1618Sfredette
142d0f1618SfredetteThe only reason you're likely to encounter ND nowadays is if you have
152d0f1618Sfredettean old Sun-2 machine, like the 2/120 or 2/50.  The Sun-2 PROMs can
162d0f1618Sfredetteonly use ND to boot over the network.  (Later, the Sun-3 PROMs would
172d0f1618Sfredetteuse RARP and TFTP to boot over the network.)
182d0f1618Sfredette
192d0f1618Sfredettendbootd is a very simple ND server that only supports client reads.
202d0f1618Sfredette
212d0f1618Sfredetteusage: ndbootd [OPTIONS] BOOT1-BIN
222d0f1618Sfredettewhere OPTIONS are:
232d0f1618Sfredette  -s, --boot2 { BOOT2-BIN | DIR }
242d0f1618Sfredette                          find a second-stage boot program in the file
252d0f1618Sfredette                          BOOT2-BIN or in the directory DIR
262d0f1618Sfredette  -i, --interface NAME    use interface NAME
272d0f1618Sfredette  -w, --window-size COUNT
282d0f1618Sfredette                          send at most COUNT unacknowledged packets [default=6]
292d0f1618Sfredette  -d, --debug             set debug mode
302d0f1618Sfredette
312d0f1618Sfredettendbootd exports a disk that the clients consider to be /dev/ndp0 (ND
322d0f1618Sfredettepublic unit zero).  The disk is available to any client listed in
332d0f1618Sfredette/etc/ethers (Sun-2 PROMs don't do RARP, but they do learn their IP
342d0f1618Sfredetteaddress from the first ND response they receive from the server.)
352d0f1618Sfredette
362d0f1618SfredetteBOOT1-BIN is a file containing the mandatory first-stage network boot
372d0f1618Sfredetteprogram.  The layout of the exported disk is:
382d0f1618Sfredette
392d0f1618Sfredetteblock 0: normally a Sun disklabel (but ignored by the PROM)
402d0f1618Sfredetteblocks 1-15: the first-stage network boot program
412d0f1618Sfredette
422d0f1618SfredetteWith the --boot2 option, ndbootd will also make a second-stage network
432d0f1618Sfredetteboot program available to clients.  When --boot2 is used with a
442d0f1618Sfredettefilename BOOT2-BIN, that file is the second-stage network boot program
452d0f1618Sfredetteto be served to all clients.
462d0f1618Sfredette
472d0f1618SfredetteWhen --boot2 is used with a directory name DIR, ndbootd finds a
482d0f1618Sfredetteclient's second-stage network boot program by turning its IP address
492d0f1618Sfredetteinto a filename in that directory, in the same manner later Sun-3
502d0f1618SfredettePROMs do when TFTPing (i.e., if a client has IP address 192.168.1.10,
512d0f1618Sfredettendbootd expects to find DIR/C0A8010A.SUN2).  The expected use of
522d0f1618Sfredette--boot2 is with the /tftpboot directory, making ndbootd a functional
532d0f1618Sfredettereplacement for tftp when used with an ND-aware first-stage boot
542d0f1618Sfredetteprogram.
552d0f1618Sfredette
562d0f1618SfredetteAny second-stage network boot program always begins at block 16 of the
572d0f1618Sfredetteexported disk, regardless of the length of the first-stage network
582d0f1618Sfredetteboot program.
592d0f1618Sfredette
602d0f1618SfredetteWhether or not there is a second-stage network boot program, the
612d0f1618Sfredetteexported disk appears to have infinite length.  The content of all
622d0f1618Sfredetteblocks not used by the first- or second-stage network boot programs is
632d0f1618Sfredetteundefined.
642d0f1618Sfredette
652d0f1618SfredetteAll first- and second-stage network boot programs must have had their
662d0f1618Sfredetteexec headers stripped off.
672d0f1618Sfredette
682d0f1618SfredetteNormally, ndbootd listens on the first up and running IP interface it
692d0f1618Sfredettefinds.  Use the --interface option to give a specific interface.
702d0f1618Sfredette
712d0f1618SfredetteOne parameter of the ND protocol is a sort of window size.  This is
722d0f1618Sfredettethe number of 1-kilobyte packets that can be transmitted before
732d0f1618Sfredettewaiting for an acknowledgement.  To change this from the default 6,
742d0f1618Sfredetteuse the --window-size option.
752d0f1618Sfredette
762d0f1618SfredetteWhen debug support is compiled in (it is by default), the --debug
772d0f1618Sfredetteoption turns on debugging.
782d0f1618Sfredette
792d0f1618Sfredettendbootd has only been compiled and tested under NetBSD with BPF
802d0f1618Sfredettesupport, although there is a fair autoconf framework, and the raw
812d0f1618Sfredetteinterface support is broken out, which should allow for reasonable
822d0f1618Sfredetteporting.
832d0f1618Sfredette
842d0f1618SfredetteNote that ndbootd was developed specifically to help me to boot my
852d0f1618Sfredetteexperimental NetBSD port on my Sun-2/120.  In this scenario, the
862d0f1618Sfredettefirst-stage network boot (bootyy) continues to use ND to load in the
872d0f1618Sfredettesecond-stage boot program (netboot), which can do a full
882d0f1618SfredetteRARP/bootparams/NFS boot.  (If the program netboot ever fit in 16
892d0f1618Sfredetteblocks, we could eliminate bootyy, but this is unlikely.)
902d0f1618Sfredette
912d0f1618Sfredette(Aside: it is unusual for a network boot to have two stages of boot
922d0f1618Sfredetteprograms before the kernel; this is normally only done on real disks.
932d0f1618SfredetteBut to the Sun-2 PROMs, /dev/ndp0 is just like a real disk in that it
942d0f1618Sfredetteprovides no EOF condition (like a tape boot gets, or like the Sun-3
952d0f1618SfredetteTFTP method gets), so it only loads a fixed number of blocks.)
962d0f1618Sfredette
972d0f1618SfredetteWhether ndbootd can be used to netboot SunOS on a Sun-2 is unknown, but
982d0f1618Sfredettethe hope is that you can use the SunOS-provided sun2.bb file as the
992d0f1618Sfredettefirst-stage boot program, not use any --boot2 option, and ndbootd will
1002d0f1618Sfredetteperform as the SunOS ndbootd did.
1012d0f1618Sfredette
1022d0f1618SfredetteTo configure ndbootd for compiling, run the 'configure' script,
1032d0f1618Sfredettefollowed by make.  To report bugs in compiling or using ndbootd, email
1042d0f1618Sfredettefredette@alum.mit.edu, and please include as much information as you
1052d0f1618Sfredettecan about what you're trying to do and what goes wrong.  I don't have
1062d0f1618Sfredettemuch time to do support, but I'll try.
107