[solved] bochs + GRUB2

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
RaffoPazzo
Posts: 23
Joined: Tue Apr 05, 2011 11:34 am

[solved] bochs + GRUB2

Post by RaffoPazzo »

Hi. Just arrived :D

As everybody here (or at least most of them) i'm writing my own OS and i decided to use GRUB2 to boot it, instead of maintain my own bootloader, quite smart, i think, also for the future: to provide new versions over the network so to speed-up the edit-compile-test process.

I'm using Bochs to emulate and these are the steps i've done to build the HDD image, hope to don't forget nothig :)

1. Build a 16MB (255 heads, 63 spt, 2 cylinders @ 512 byte/sector) raw file (using dd) and let a loop device (/dev/loop0) pointing to it
2. Create two ext2 (id 0x83) partitions of 8MB each (actually 1 cylinder each) and mark the first as bootable.
3. Let the /dev/loop1 loop device point to the first partition (by using -o and --sizelimit to skip the first 63 "hidden" sectors)
4. Formatted /dev/loop1 with mke2fs
5- Mounting /dev/loop1 to /mnt/virtual
5. "grub-install --root-directory=/mnt/virtual/ /dev/loop0" (using an ad-hoc compiled grub2 tarball)

The final effect in bochs is the grub rescue shell and when invoking "ls" to list the HDDs, no one has been found.

Using, instead, the system's (ubuntu 10+) grub-install, "ls" show me (hd0) but no partition.

Morever, both of the image (with ad-hoc compiled grub-install and the system one) was trying to search for a certain UUID with no success.


Is anybody using GRUB2 with bochs in its virtual HDD ?

Thanks, in advance.
Last edited by RaffoPazzo on Thu Apr 07, 2011 6:46 am, edited 1 time in total.
RaffoPazzo
Posts: 23
Joined: Tue Apr 05, 2011 11:34 am

Re: bochs + GRUB2

Post by RaffoPazzo »

It was actually a problem in the bochs' shipped BIOS. Qemu works fine with the same image.

PS: How do i change the subject [SOLVED] <..> ?
shikhin
Member
Member
Posts: 274
Joined: Sat Oct 09, 2010 3:35 am
Libera.chat IRC: shikhin
Contact:

Re: bochs + GRUB2

Post by shikhin »

Hi,
RaffoPazzo wrote:PS: How do i change the subject [SOLVED] <..> ?
On the lower right corner of your first post, you'll see an edit button. Click on it, and on the top of the edit window, you'd see something as 'Subject: bochs + GRUB2'. Change this to include [SOLVED] in it.

Regards,
Shikhin
http://shikhin.in/

Current status: Gandr.
Post Reply