1

I was interested in learning how to create an operating system from scratch, and I found this guide: http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf.

At page 4 it is explained how to create a simple boot sector, and on page 6 how to emulate a CPU booting from it, using Bochs. I've tried this, and all worked fine.

Now I want to try the same on a real PC or on virtual machine software, such as VirtualBox. I thought I could create a bootable CD with my boot sector on it, but until now I couldn't succeed. I tried creating an ISO image of a CD containing my boot sector but, as expected, I receive an error when doing this (VirtualBox shows the "FATAL: No bootable medium found! System halted." error).

What should I do to correctly create a bootable CD with my boot sector on it? Thank you in advance.

1 Answer 1

0

Take a look: http://wiki.osdev.org/El-Torito

Writing an El-Torito Boot Sector
At the start of your El-Torito boot sector, you simply need to set segment registers to known values (as usual) and use the BIOS to load files from the CD as per ISO 9660. As with a normal floppy or hard disk, DL contains the BIOS drive number.
Using Mkisofs, you can write your boot sector to a CD image (.iso) as follows:

mkisofs -R -b path/to/loader.sys -no-emul-boot -boot-load-size 4 -o [IsoFile.iso] [IsoDirectory]

Simple use your own-written Loader.sys and Mkisofs (http://wiki.osdev.org/Mkisofs).

2
  • Ok, thank you. This is exactly what I was searching for. Also the website you linked to is very useful.
    – brouwer89
    Aug 21, 2013 at 21:18
  • You are welcome, I was very glad to help :) Aug 22, 2013 at 4:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .