开发者

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 patie开发者_开发知识库nce 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.


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.


a very simple script will do this in linux as below :-

rm -f disk_images/myos.iso
mkisofs -quiet -V 'MYOS' -input-charset iso8859-1 -o disk_images/myos.iso -b myos.flp disk_images/ || exit

The floppy drive is made as below :-

nasm -f bin -o boot.bin boot.asm
dd if=boot.bin of=floppy.img count=1 bs=512 //for the bootloader

and

dd if=boot.bin of=floppy.img skip seek=1 count=1339 //assuming a 1.44Mb floppy

and then you have the file system

mkdosfs (or whatever system you want ) -C floppy.img 1440

If you ned help for windows , let me know :)


Try WinISO, it works perfect for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜