Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make an bootable iso(not cd or flash drive) for testing your own boot loader?

i am trying to write a boot loader(hello world sort). i am using Bochs for simulation (platform Linux-Ubuntu). But i am unable to make an bootable iso for my binary file. Though in tutorial VFD(virtual floppy disk) is used but it is for windows platform. Here is my code for bootloader ( just for testing)

;*********************************************
;    Boot1.asm
;        - A Simple Bootloader for testing if cd is booting or not
;
;    Operating Systems Development Tutorial
;*********************************************

[BITS 16]    ;tell the assembler that its a 16 bit code
[ORG 0x7C00]    ;Origin, tell the assembler that where the code will

Start:

    cli                    ; Clear all Interrupts
    hlt                    ; halt the system

times 510 - ($-$$) db 0                ; We have to be 512 bytes. Clear the rest of the bytes with 0

dw 0xAA55                    ; Boot Signature

i tried master ISO on Ubuntu. It is converting the binary file to ISO but not to bootable ISO. Bochs is showing error "cd is not eltorito" which i googled and found to be standard for bootable ISO.What additional things i have to add to it to make it bootable. i have already added boot signature in the end. Can anyone suggest a reliable application to make a bootable ISO on Ubuntu? My work is stuck due to this.... OR i am pretty sure a lot of people must be involved in OS development on Linux platform. How do you people test?

I have made a bootable flash-drive with Unetbootin with the iso of my bootloader program. switched to Virtual-box and twisted a bit to boot from pendrive, but still its showing it to be non-bootable. I think someone said it correctly that u need a lot of patience in OS development.


:phew finally my bootloader program ran...
I used virtual floppy image to boot my program on Virtual box. Here are the steps in case somebody is struggling with it.
1.Create boot.asm which have your bootloader program.
2.Compile with nasm. nasm -f bin boot.asm -o boot.bin.
3.sudo mkfs.msdos -C /home/username/floppy.img 1440
4.sudo chown username ./floppy.img. link text
5.Copy with dd. dd if=./boot.bin of=./floppy.img.
6.Run VirtualBox and select floppy.img as booting device in your new virtual machine.
PS: you can also attach floppy.img to device "loop" and mount it just as a real floppy disk.

like image 232
Terminal Avatar asked Jan 14 '11 10:01

Terminal


People also ask

Can you boot with just an ISO file?

Steps to boot ISO using CD/DVD drive,Add the ISO image file into the tool. Insert the CD/DVD drive to burn the ISO file. Right click on the iso file and click Mount to CD/DVD option. Once the ISO boot files are copied to the CD/DVD drive, you can insert them into the target computers for booting from ISO media.

Can I boot from USB with an ISO file?

An ISO file combines all the Windows installation files into a single uncompressed file. If you choose to download an ISO file so you can create a bootable file from a DVD or USB drive, copy the Windows ISO file onto your drive and then run the Windows USB/DVD Download Tool.


1 Answers

Amongst all the storage locations/methods of retrieval, CD-ROM/El-Torito is the oddball (and don't get me started on Mac CDROM filesystem hybrids)

With Floppy, Harddisk/USB or PXE-TFTP, it suffices to write the object code to the first sector, or in case of tftp, just download-and-execute. It can't get any easier with these.

like image 161
user562374 Avatar answered Sep 27 '22 23:09

user562374