From accc0312b38b99256652fda4a80b52416261531e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 8 Sep 2004 00:02:26 +0000 Subject: [PATCH] Some bochs/qemu tools. --- src/bochs/bochsrc.txt | 8 ++++++++ src/bochs/copy_in | 11 +++++++++++ src/bochs/run_qemu | 17 +++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/bochs/bochsrc.txt create mode 100755 src/bochs/copy_in create mode 100755 src/bochs/run_qemu diff --git a/src/bochs/bochsrc.txt b/src/bochs/bochsrc.txt new file mode 100644 index 0000000..9bb8338 --- /dev/null +++ b/src/bochs/bochsrc.txt @@ -0,0 +1,8 @@ +romimage: file=$HOME/cs140/bochs-2.1.1/bios/BIOS-bochs-latest, address=0xf0000 +vgaromimage: $HOME/cs140/bochs-2.1.1/bios/VGABIOS-lgpl-latest +ata0-master: type=disk, path=os.dsk, mode=flat, cylinders=306, heads=4, spt=17, translation=none +ata0-slave: type=disk, path=filesys.bin, mode=flat, cylinders=1, heads=16, spt=63, translation=none +boot: c +ips: 1000000 +megs: 32 +com1: dev=/dev/tty diff --git a/src/bochs/copy_in b/src/bochs/copy_in new file mode 100755 index 0000000..743ae51 --- /dev/null +++ b/src/bochs/copy_in @@ -0,0 +1,11 @@ +#! /usr/bin/perl + +if (@ARGV != 2) { + print "usage: copy_in src dst\n"; + exit 1; +} +($src, $dst) = @ARGV; +$size = -s $src; + +system "../pad 512 < $src > scratch.bin"; +exec "./run_qemu -cp $dst:$size"; diff --git a/src/bochs/run_qemu b/src/bochs/run_qemu new file mode 100755 index 0000000..6011e3e --- /dev/null +++ b/src/bochs/run_qemu @@ -0,0 +1,17 @@ +#! /usr/bin/perl + +die "command line includes empty string" if grep (/^$/, @ARGV); +$cmdline = join ("\0", @ARGV) . "\0\0"; +die "command line exceeds 128 bytes" if length ($cmdline) > 128; +$cmdline .= "\0" x (128 - length ($cmdline)); + +open (DISK, "+