|
|
1.1 root 1: Ethernet boot prom code.
2:
3: This is code that can be burned into an eprom and installed in an
4: ethernet card. It uses the extension facilities of the bios to to boot
5: a kernel via the network.
6:
7: Netboot uses bootp or rarp to determine its ip address and tftps a
8: designated kernel from a server. You should be running a daemon for
9: either bootp or rarp to service requests from this client. If you are
10: using bootp, the boot file name and the gateway (if necessary) will
11: also be transmitted to the client. If you use rarpd, the boot file
12: name is synthesized by this boot code from the eight hexadecimal
13: digits that comprise the IP address of the client and an extension of
14: "386bsd". If you use rarp, the rarp server must also be the tftp
15: server.
16:
17: If you have configured both bootp and rarpd into the boot prom, the
18: response from the first host to respond via either protocol will be
19: used.
20:
21: This code was developed using GNU as 2.1 and GNU cc version 2.3.3,
22: running under 386bsd. Pre 2.0 versions of GNU as might have trouble
23: with some syntax. Testing was done with a SMC Elite16 and 16k eproms.
24:
25:
26: Installation instructions:
27:
28: Check the configurable parameters in Makefile.
29:
30: Check the configurable parameters in the ethernet driver source for
31: the card you are using:
32: - in wd80x3.c: WD_BASEREG, WD_BASEMEM (irqs not used)
33:
34: Make.
35:
36: If you wish, you can test the binary (boot.bin) by copying it to a
37: floppy with the dosload.exe program and execute the boot code from the
38: floppy.
39:
40: Burn the resultant binary (boot.bin) into an eprom and install it in
41: the ethernet card.
42:
43: Decide which protocol (bootp or rarp) to use on a server; set up that
44: server.
45:
46: Setting up a bootp server entails creating a bootpd client
47: configuration file. The format is similar to that of printcap. An
48: entry looks something like:
49:
50: sams-1:\
51: :bf=diskless_kernel.386bsd:\
52: :gw=139.88.30.4:\
53: :ht=ethernet:\
54: :ha=0000c025e35b:\
55: :ip=139.88.30.39:\
56: :sm=255.255.255.0:\
57: :to=18000:
58:
59: Setting up a rarpd server entails creating an ethernet/ip address
60: resolution file '/etc/ethers' with a line for each netboot client in
61: the form:
62:
63: 00:00:c0:25:e3:5b sams-1.lerc.nasa.gov
64:
65: If you don't know the ethernet address, boot the client with the eprom
66: installed; the ethernet address of the card will be displayed.
67:
68: Set up tftpd on a server. Check '/etc/inetd.conf'; there should be a
69: line that starts something like:
70:
71: tftp dgram udp wait root ...
72:
73: perhaps commented out.
74:
75: Build a kernel that is capable of operating via NFS. Martin Renters
76: released some patches and a kernel configuration program that work
77: nicely (comp.os.386bsd.development around March 22, 1993); they should
78: be around somewhere. If you can't find them, I can email you a copy.
79:
80: Make the kernel available via tftp under one of the names which this
81: code will use to look for the kernel. If you are using bootp, you can
82: specify the name as a bootp client configuration parameter. If you
83: don't specify the name, or if you are using rarp the this code will
84: synthesize the name using its client's IP address. The hexadecimal
85: version of the client's IP address with the extension '.386bsd' is the
86: default choice.
87:
88: Create the exportable nfs mount points for which this kernel will use
89: and load them with necessary files (the base distribution, ...).
90: Export them so they can be mounted by this kernel when it boots from
91: the client IP address.
92:
93:
94: Usage instructions:
95:
96: At any time the escape key can be struck to gain entrance to the
97: interactive monitor. There is a menu of monitor commands that can be
98: invoked to customize a boot operation.
99:
100:
101: Notes:
102:
103: When Martin Renter's patches are applied to netbsd 0.8, there will be
104: one failure (pmap.c). Ignore it, the relevant code has already been
105: fixed.
106:
107: I had some small problems with getfh(2) as used in the nfs configuring
108: program - I suspect the problem is a bug in SunOS 4.1.1 - if you have
109: similar problems, I can email you my gross hack workaround.
110:
111: As noted by Mr. Renters, advisory flock()ing is not supported - this
112: breaks some programs. The first broken utility you will likely
113: encounter is vipw(1). The others: passwd, dump, ar, mail, tip, lpr,
114: sendmail.
115:
116: You should examine your rc script and make appropriate changes to the
117: boot up sequence.
118:
119: Here are the steps I took to bring netbsd 0.8 up for the client sams-1
120: using the host dinah in the domain lerc.nasa.gov.
121:
122: - Create the /dev/vga device.
123:
124: - Create some ptys.
125:
126: - Create /etc/fstab to contain:
127: dinah:/home/386bsd-root / nfs rw
128: dinah:/home/386bsd-swap none swap rw
129: in it for the root and swap.
130:
131: - Edit /etc/rc; the line 'mount -a -t nonfs' is changed to:
132: mount -a -t nonfs,swap
133:
134: - Edit /etc/myname to contain
135: sams-1
136:
137: - Edit /etc/hosts to contain:
138: 127.0.0.1 localhost loghost
139: 139.88.30.39 sams-1
140: and delete the other stuff in it.
141:
142: - Create /etc/resolv.conf to contain:
143: domain lerc.nasa.gov
144: nameserver 128.156.1.43
145: nameserver 139.88.76.3
146: where the two addresses are those of some name servers in my domain.
147: There are, of course, the two alternatives of using just the /etc/hosts
148: file, or using named.
149:
150: - Create /etc/mygate to contain:
151: 139.88.30.4
152: which is the IP address of my gateway.
153:
154: - Re-symlink /etc/localtime to the correct zone.
155:
156:
157: TBD:
158: -linux
159: -ne2100
160: -handle small memory configuration
161: -USE_BIOS version
162: -return to bios correctly
163: -remove old Phys... stuff; relics of real mode prom version
164: -accept bootd extension items & pass as args, modify kernel to
165: init nfs_diskless from args. Need:
166: myif [local] [bootp]
167: mygateway [bootp]
168: swap_args [local]
169: swap_fh [bootp]
170: swap_saddr [local] [bootp]
171: swap_hostname [bootp]
172: root_args [local]
173: root_fh [bootp]
174: root_saddr [local] [bootp]
175: root_hostnam [bootp]
176: A tight squeeze, passing all necessary info in one bootp packet.
177:
178: Please send me any improvements you make to this code. It will be
179: appreciated.
180:
181: Jim McKim ([email protected])
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.