[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Creating a floppy image for bochs
From: |
Niels Möller |
Subject: |
Creating a floppy image for bochs |
Date: |
18 Jan 2004 16:11:02 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
I've installed bochs now. Since I didn't find any quick start
instructions, I'll describe how I attempt to boot hurd-l4 on it.
First, I installed bochs, grub (it need not be installed on any real
bootsector, I just need the grub shell and the stage1 and stage2
files), and pistachio-0.3.
I checked out the hurd-l4 with something like lsh -G -B -z
address@hidden, export CVS_RSH=lshg, cvs -d
address@hidden:/cvsroot/hurd co hurd-l4. Building went
smoothly. To make automake 1.8 happier, some quotes should be added to
acinclude.m4,
-AC_DEFUN(HURD_LOAD_ADDRESS,
+AC_DEFUN([HURD_LOAD_ADDRESS],
Next, I created a subdirectoty "hurd-l4/boot", and copied ia32-kernel
and sigma0 into it (from the pistachio build tree). I also wrote a
boot/menu.lst,
title Hurd-L4
root (fd0)
kernel /boot/laden
module /boot/ia32-kernel
module /boot/sigma0
module /boot/wortel
# Dummy module line
module /boot/wortel
Next I had to figure out how to make a boot floppy image. With
inspiration from
http://mail.gnu.org/archive/html/bug-grub/2003-10/msg00045.html, I
wrote the following mkbootfloppy shell script, which I ran in the
hurd-l4 directory:
#! /bin/sh
# Copies files from the build tree and from boot into a floppy image.
# boot is expected to contain the l4 kernel, as well as servers like
# sigma0 that comes from the pistachio dist.
set -e
GRUBDIR=/usr/lib/grub/i386-pc
GRUB=/sbin/grub
ROOT=tmp-root
die () {
echo "$@"
exit 1
}
mkdir -p "$ROOT"
cp -r boot "$ROOT"
cp "$GRUBDIR/stage1" "$ROOT/boot"
cp "$GRUBDIR/stage2" "$ROOT/boot"
cp boot/menu.lst "$ROOT/boot"
cp laden/laden wortel/wortel "$ROOT/boot"
genext2fs -r 0 -d "$ROOT" -b 1440 boot.img
"$GRUB" --device-map=/dev/null << EOF
device (fd0) boot.img
root (fd0)
setup --prefix=/boot (fd0)
EOF
Then I point "floppya" in the .bochsrc file to this image, and run
"bochs boot:a". GRUB is able to load the modules, but then the virtual
machine crashes, I guess next thing to do is to read up on the patches
that were needed for pistatchio-0.3.
Some questions: I turned on the obvious debug flags when building the
kernel (CONFIG_DEBUG, CONFIG_KDB_CONS_KBD, CONFIG_VERBOSE_INIT). What
else need I do to get more verbose output during the startup? Would it
be better to use serial output, and somehow let bochs redirect the
serial output to somewhere I can read it?
Regards,
/Niels