[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bochs + Hurd/L4

From: Ludovic Courtès
Subject: Bochs + Hurd/L4
Date: Sun, 18 Jan 2004 23:39:01 +0100
User-agent: Mutt/1.3.28i


On Sat, Jan 17, 2004 at 01:44:45PM +0100, Niels Möller wrote:
> And one more thing: I've never used bochs, is there any simple
> introduction on booting l4 inside bochs?

We discussed this around November I think so the archive might contain
useful information to start with.

Basically, I managed to get Pistachio 0.[23] running using an October
2003 Bochs snapshot and building it with the following options:

  ./configure --enable-4meg-pages --enable-plugins --enable-cpu-level=6 
--enable-fast-function-calls --enable-global-pages --enable-readlinee 
--enable-all-optimizations --enable-vbe --enable-mmx --enable-3dnow 
--enable-sse=2 --enable-daz --enable-sep --enable-x86-debugger --enable-cdrom 
--enable-iodebug --with-x --with-x11 --with-gnu-ld 

Then you can use `bximage' to create a new disk image, make it available
as a loopback device using `losetup' (under Linux), then `fdisk' and
`mke2fs' to create and format a new ext2 partition, and `losetup' again
to create a loopback device for that that partition (here, you tipically
have to specify an offset of 32256 bytes -- using the `-o' option of
`losetup' -- if you used the default setting of `bximage' ; this is
because the partition starts on the 63rd sector of the disk image and
each sector is 512-byte long).  At that point you can copy the kernel,
loader and executables there and install GRUB there:

  (grub) device (hd0) /dev/loop0
  (grub) geometry (hd0) <cylinders> <heads> <sectorpertrack>
  (grub) root (hd0,0)
  (grub) setup --stage2=/usr/lib/grub/i386-pc/stage2 (hd0)

Note that by default, `bximage' seems to create disk images whose
geometry is 203 cyl./16 heads/63 sect.  Also, IIRC, disk images created
with `bximage' are not bootable by default, although this would be very
useful.  So I had to write the bootable "magic bytes" by hand (see
attached file).

Finally, running Bochs without any particular option should work.

I'm not sure I clearly answered the question since there is nothing
much related to Bochs here.  However, this recipe might be useful if
you want to run experimental software without having to reboot their
machine every time you add a `printf' line to the bleeding-edge OS you
are testing.  ;-)


Attachment: make-it-bootable.c
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]