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 \
30 --enable-disasm --enable-show-ips --enable-ne2000
36 5. As root, set up a TAP virtual network device:
38 chmod o+rw /dev/net/tun
39 ./tunctl -u <username> -t tap0
40 /sbin/ifconfig tap0 up 10.254.254.2 netmask 255.255.255.0
42 6. As root, add the following fragment to /etc/dhcpd.conf:
43 subnet 10.254.254.0 netmask 255.255.255.252 {
44 range dynamic-bootp 10.254.254.1 10.254.254.1;
46 You will also need to add in any of your usual declarations for
47 Etherboot, e.g. 'filename "vmlinuz.ltsp";'. Note that this setup
48 assumes that your DHCP server, TFTP server etc. all live on the
49 machine you are using for running Bochs. If not, then you're on
52 7. As root, restart dhcpd
53 /etc/init.d/dhcpd restart
55 8. Build Etherboot images
62 You should get to the debugger prompt "<bochs:1>". Type "c" to
65 You should see Bochs start up, load up Etherboot and attempt to boot
73 You can use the program "serial-console" to obtain a virtual serial
74 console for Etherboot running within Bochs. Simply run
75 "./serial-console" on a spare tty (e.g. a separate xterm window)
76 before starting Bochs, and ensure that you have enabled CONSOLE_SERIAL
79 There is a manual page for "serial-console"; use
80 "man ./serial-console.1" to view it.
87 Packet forwarding/masquerading - document what must be set up.
89 Mention possibility of using RFB as the display device - in
90 conjunction with the serial console, gives you a test facility that
91 can be accessed remotely.
93 Mention use of BOCHSBP instruction (xchgw %bx,%bx) to avoid need to
94 calculate breakpoints.