2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-26 03:09:12 +00:00
xNBA/contrib/bochs/README.qemu

80 lines
2.4 KiB
Plaintext
Raw Normal View History

2009-02-01 17:35:53 +00:00
Running gPXE within qemu
========================
2006-08-24 13:55:43 +00:00
Michael Brown <mbrown@fensystems.co.uk>
To get qemu running is fairly simple:
1. Build the utilities in this directory:
make
2. Get the qemu source code:
2009-02-01 17:35:53 +00:00
svn co svn://svn.savannah.nongnu.org/qemu/trunk qemu
2006-08-24 13:55:43 +00:00
2006-08-28 01:58:52 +00:00
2a. Patch the qemu code. There is currently a bug that causes qemu to
2009-02-01 17:35:53 +00:00
execute gPXE incredibly slowly. The bug seems to be related
2006-08-28 01:58:52 +00:00
to the relative prioritisation of CPU and I/O operations within
qemu. This patch (which I found via Google) isn't a proper fix,
but it does work around the problem:
patch -p0 < qemu-patch
2006-08-24 13:55:43 +00:00
3. Configure qemu with
pushd qemu
2009-02-01 17:35:53 +00:00
./configure --target-list=i386-softmmu,x86_64-softmmu
2006-08-24 13:55:43 +00:00
popd
4. Build qemu:
make -C qemu
5. As root, set up a TAP virtual network device:
/sbin/modprobe tun
chmod o+rw /dev/net/tun
./tunctl -u <username> -t tap0
/sbin/ifconfig tap0 up 10.254.254.2 netmask 255.255.255.0
6. As root, add the following fragment to /etc/dhcpd.conf:
subnet 10.254.254.0 netmask 255.255.255.252 {
range dynamic-bootp 10.254.254.1 10.254.254.1;
}
You will also need to add in any of your usual declarations for
2009-02-01 17:35:53 +00:00
gPXE, e.g. 'filename "vmlinuz.ltsp";'. Note that this setup
2006-08-24 13:55:43 +00:00
assumes that your DHCP server, TFTP server etc. all live on the
machine you are using for running qemu. If not, then you're on
your own.
7. As root, restart dhcpd
/etc/init.d/dhcpd restart
2009-02-01 17:35:53 +00:00
8. Build gPXE floppy disk images and pad to 1.44MB
2006-08-24 13:55:43 +00:00
pushd ../../src
make bin/rtl8139.dsk
2006-08-24 13:55:43 +00:00
popd
9. Start qemu
./qemu/i386-softmmu/qemu -L qemu/pc-bios \
-net nic,model=rtl8139 -net tap,ifname=tap0 \
-boot a -fda ../../src/bin/rtl8139.dsk
2006-08-24 13:55:43 +00:00
2009-02-01 17:35:53 +00:00
You should see qemu start up, load up gPXE and attempt to boot from
the network.
2006-08-24 13:55:43 +00:00
Serial console
==============
You can use the program "serial-console" to obtain a virtual serial
2009-02-01 17:35:53 +00:00
console for gPXE running within qemu. Run "./serial-console" on a
spare tty (e.g. a separate xterm window) before starting qemu, and
2006-08-24 13:55:43 +00:00
ensure that you have enabled CONSOLE_SERIAL in config.h.
When serial-console starts, it will print out the message "Slave pty
is /dev/pts/XX", where XX is a number. You need to append the option
-serial /dev/pts/XX
to the qemu command line.
There is a manual page for "serial-console"; use "man
./serial-console.1" to view it.