Jump to content

How to make a bootable disk image w. Darwin loader to run under Q?


Nuifrkns
 Share

3 posts in this topic

Recommended Posts

Hi,

 

I compiled a xnu kernel and want to run it under Qemu or Bochs for educational purposes. I tried the following for making a bootable disk image:

 

-got the boot0, boot1h and boot from /usr/standalone/i386 on an install DVD

 

-got the startupfiletool util

 

- made an mbr disk image via Diskutility (40mb)

 

did:

 

:sudo startupfiletool /dev/diskXsY boot (got confirmation, seems to run o.k.)

:sudo dd if=boot1h of=/dev/rdiskXsY bs=512 count=1 (512 bytes written)

:sudo dd if=boot0 of=/dev/diskX bs=400 count=1 (400 bytes written)

 

-I confirmed that the img file started with the bootstrap I inserted via the last step

-I can also see (via HexEdit) that the 'boot' file was insterted in the img

-I also see the boot1h file inserted in the img

 

However, using the img under Q(emu) (ported Qemu emulator for Mac, a.k.a. Q(kju)) it gives me the error 'b0 er', which is an error string present in the bootstrap (boot0).

 

Instead of running under Q(emu), I partitioned a 128mb USB stick as above, and when booting from it, I got a slightly different message (4 or 5 bytes of garble...).

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

  • 1 month later...
Hi,

 

I compiled a xnu kernel and want to run it under Qemu or Bochs for educational purposes. I tried the following for making a bootable disk image:

 

-got the boot0, boot1h and boot from /usr/standalone/i386 on an install DVD

 

-got the startupfiletool util

 

- made an mbr disk image via Diskutility (40mb)

 

did:

 

:sudo startupfiletool /dev/diskXsY boot (got confirmation, seems to run o.k.)

:sudo dd if=boot1h of=/dev/rdiskXsY bs=512 count=1 (512 bytes written)

:sudo dd if=boot0 of=/dev/diskX bs=400 count=1 (400 bytes written)

 

-I confirmed that the img file started with the bootstrap I inserted via the last step

-I can also see (via HexEdit) that the 'boot' file was insterted in the img

-I also see the boot1h file inserted in the img

 

However, using the img under Q(emu) (ported Qemu emulator for Mac, a.k.a. Q(kju)) it gives me the error 'b0 er', which is an error string present in the bootstrap (boot0).

 

Instead of running under Q(emu), I partitioned a 128mb USB stick as above, and when booting from it, I got a slightly different message (4 or 5 bytes of garble...).

 

Any ideas?

 

Thanks

 

Have you marked the partition active. There should be a star in front of the partition if it's active. Run these commands when disk unmounted.

# fdisk -e /dev/rdiskX

# p

# f Y

# w

# q

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...