1 Running Etherboot within Bochs
2 ==============================
4 Michael Brown <mbrown@fensystems.co.uk>
5 Based on an idea suggested by H. Peter Anvin <hpa@zytor.com>.
9 Bochs is a program that simulates a complete Intel x86 computer,
10 including hardware. It can be used to test Etherboot. There is a
11 special pseudo NIC ("pnic") implemented in Bochs, with a corresponding
12 driver in Etherboot. (There is also an NE2000 ISA driver in Bochs,
13 but it doesn't seem to quite work.)
15 To get bochs running is fairly simple:
17 1. Build the utilities in this directory:
20 2. Get the bochs source code:
21 cvs -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs \
23 cvs -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs \
26 3. Configure bochs with
28 ./configure --enable-all-optimisations --enable-pci --enable-pnic \
29 --enable-debugger --enable-magic-breakpoints --enable-disasm
35 5. As root, set up a TAP virtual network device:
37 chmod o+rw /dev/net/tun
38 ./tunctl -u <username> -t tap0
39 /sbin/ifconfig tap0 up 10.254.254.2 netmask 255.255.255.0
41 6. As root, add the following fragment to /etc/dhcpd.conf:
42 subnet 10.254.254.0 netmask 255.255.255.252 {
43 range dynamic-bootp 10.254.254.1 10.254.254.1;
45 You will also need to add in any of your usual declarations for
46 Etherboot, e.g. 'filename "vmlinuz.ltsp";'. Note that this setup
47 assumes that your DHCP server, TFTP server etc. all live on the
48 machine you are using for running Bochs. If not, then you're on
51 7. As root, restart dhcpd
52 /etc/init.d/dhcpd restart
54 8. Build Etherboot images
61 You should get to the debugger prompt "<bochs:1>". Type "c" to
64 You should see Bochs start up, load up Etherboot and attempt to boot
72 You can use the program "serial-console" to obtain a virtual serial
73 console for Etherboot running within Bochs. Simply run
74 "./serial-console" on a spare tty (e.g. a separate xterm window)
75 before starting Bochs, and ensure that you have enabled CONSOLE_SERIAL
78 There is a manual page for "serial-console"; use
79 "man ./serial-console.1" to view it.
86 Packet forwarding/masquerading - document what must be set up.
88 Mention possibility of using RFB as the display device - in
89 conjunction with the serial console, gives you a test facility that
90 can be accessed remotely.
92 Mention use of BOCHSBP instruction (xchgw %bx,%bx) to avoid need to
93 calculate breakpoints.