summaryrefslogtreecommitdiff
path: root/qemu-support
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-13 19:43:29 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-05-13 19:43:29 +0000
commitd5b1ef65e98a5cbc39b0e182c429f01100fb23e2 (patch)
tree17b3cf7282b96d85ade6e3566f69a70b5a103b72 /qemu-support
parent1778298781d5c2df0bb81ee07226f51166d23c9d (diff)
2009-05-13 Joel Sherrill <joel.sherrill@oarcorp.com>
* README: Add first cut at NIC instructions. * qemu-ifdown, qemu-ifup, qemu-nic: New files.
Diffstat (limited to 'qemu-support')
-rw-r--r--qemu-support/ChangeLog5
-rw-r--r--qemu-support/README37
-rwxr-xr-xqemu-support/qemu-ifdown3
-rwxr-xr-xqemu-support/qemu-ifup5
-rwxr-xr-xqemu-support/qemu-nic41
5 files changed, 90 insertions, 1 deletions
diff --git a/qemu-support/ChangeLog b/qemu-support/ChangeLog
index 8d81430..d745499 100644
--- a/qemu-support/ChangeLog
+++ b/qemu-support/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-13 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * README: Add first cut at NIC instructions.
+ * qemu-ifdown, qemu-ifup, qemu-nic: New files.
+
2009-05-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* ChangeLog, README: New files.
diff --git a/qemu-support/README b/qemu-support/README
index 3dbbc64..96c4e21 100644
--- a/qemu-support/README
+++ b/qemu-support/README
@@ -11,4 +11,39 @@ NOTE: Joel has two other things to add from other machines.
pc386_fda_slow - pauses before booting test.exe so you can attach gdb.
-qemu-nic - run with network support configured
+qemu-nic - run with network support configured. EDIT THIS AS NEEDED
+
+qemu-ifup - Needs to be in /etc
+
+qemu-ifdown - Needs to be in /etc
+
+Networking Instructions
+=======================
+
+To run networking programs on qemu, you have to do some system setup.
+
+cp qemu-ifup qemu-ifdown /etc
+
+After each reboot, you will need to load the tap/tunneling interface.
+
+/sbin/modprobe tun
+
+You have to run the network programs as root (yes it sucks). The script
+qemu-nic can do this. Edit it as needed. If you use COM1 as console,
+the script may need editing for that.
+
+As you:
+ cd network-demos
+ cp networkconfig-qemu.h networkconfig.h
+ RTEMS_MAKEFILE_PATH=${INSTALLPATH}/i386-rtems4.10/pc386 make clean all
+ cp TESTNAME/o-optimize/*.exe ~/qemu/hd/test.exe
+
+This should compile the network demos to use qemu with the Intel
+EtherExpress Pro NIC driver in the RTEMS tree. And it copies one
+of them into the directory we autoboot test.exe from.
+
+As root:
+ qemu-nic
+
+This should bring up qemu and put the NIC interface on 10.0.2.5.
+
diff --git a/qemu-support/qemu-ifdown b/qemu-support/qemu-ifdown
new file mode 100755
index 0000000..809da30
--- /dev/null
+++ b/qemu-support/qemu-ifdown
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+exit 0
diff --git a/qemu-support/qemu-ifup b/qemu-support/qemu-ifup
new file mode 100755
index 0000000..185d01e
--- /dev/null
+++ b/qemu-support/qemu-ifup
@@ -0,0 +1,5 @@
+#!/bin/sh
+ TUN_DEV=$1
+ TUN_HOST=10.0.2.2
+ /sbin/ifconfig $TUN_DEV $TUN_HOST
+ exit 0
diff --git a/qemu-support/qemu-nic b/qemu-support/qemu-nic
new file mode 100755
index 0000000..6c38112
--- /dev/null
+++ b/qemu-support/qemu-nic
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Run qemu with network interface if root.
+#
+#
+# $Id$
+#
+# TODO:
+# -s for gdb from command line
+
+QEMUDIR=/home/joel
+
+# Model - isapc for ISA PC or pc for PCI
+
+# PCI NIC model options that work with RTEMS:
+# i82558er, i82551, i82557b, rtl8139
+# ISA NIC model: ne2k_isa
+
+MODEL="-M pc"
+#MODEL="-M isapc"
+NIC=i82557b
+
+GRAPHICS="-serial stdio"
+#GRAPHICS="${GRAPHICS} --nographic --monitor null"
+ARGS="${MODEL} -m 8 \
+ -boot a -fda ${QEMUDIR}/qemu/pc386_fda \
+ -hda fat:${QEMUDIR}/qemu/hd --no-reboot"
+if [ $EUID -eq 0 ] ; then
+
+ if [ ! -r /etc/qemu-ifup ] ; then
+ echo /etc/qemu-ifup not found
+ exit 1
+ fi
+
+ /usr/local/bin/qemu ${ARGS} ${GRAPHICS} \
+ -net nic,model=${NIC} \
+ -net nic,macaddr=00:80:7F:22:61:77 \
+ -net tap,script=/etc/qemu-ifup
+else
+ qemu ${ARGS} ${GRAPHICS}
+fi