[solved] bochs + GRUB2
Posted: Tue Apr 05, 2011 12:10 pm
Hi. Just arrived
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.
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.