2

So a couple days ago, I ventured into the uncharted territory of OS development. As a kind of a "Hello, World" program, I created this bootloader in assembly:

;*********************************************
;   Boot1.asm
;       - A Simple Bootloader
;
;   Operating Systems Development Tutorial
;*********************************************

org     0x7c00              ; We are loaded by BIOS at 0x7C00

bits    16                  ; We are still in 16 bit Real Mode

Start:

    cli                 ; Clear all Interrupts
    hlt                 ; halt the system

times 510 - ($-$$) db 0             

dw 0xAA55

Then, I used NASM to compile the assembly file into a .bin file. Next, I used PowerISO to convert this binary file into an ISO file. Finally, I attached the ISO file into Microsoft Virtual PC 2007. When it did not work initially, I checked the BIOS and made sure that CD/DVD was first on the boot priority list. When I tried lauching the system after that, it gave me the following error:

"reboot and select proper boot device "

After searching on the internet, I found that this means that the ISO is not bootable. When I researched more on how to fix this, I could not find much, other than that an ISO has to be configured properly in order to be bootable. How would I go about doing that, and if its not possible, what other alternatives do I have?

I am running a Windows 7 Home Premium Edition 64-bit.

pnuts
  • 58,317
  • 11
  • 87
  • 139
user1231745
  • 75
  • 11

2 Answers2

2

Your program represents a master boot record, not a bootable ISO image. It works fine when booted as a harddisk with for instance QEMU. Not all virtual machines will accept a harddisk image that small though. In that case you would first create a harddisk image, and then overwrite the first sector with your program.

Making a bootable ISO image is a bit more complex. Read this wiki for more information.

0

I know you're using Microsoft Virtual PC (which by the way, I think only boots windows), but I suggest using something else. Here are a few options (all free):

  • Virtualbox: This free virtualization software will probably let you boot your OS much more easily.
  • QEMU: A favorite of mine and of OS developers, it makes it really easy to debug and try custom OSes. On the other hand, I think it's only available on UNIX based systems, so be prepared to use a Linux Vm or a Mac, or to install Linux.
Linuxios
  • 34,849
  • 13
  • 91
  • 116
  • Thanks so much for the quick reply! I tried what you suggested, but when I used VirtualBox, it gave me the error: FATAL: Could not read from the boot medium. How should I make the .iso bootable? – user1231745 Nov 03 '12 at 02:18
  • @user1231745: Sure. If you found the answer helpful, make sure to accept it. – Linuxios Nov 03 '12 at 02:19