boot loader on cd rom

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
T3rabyt3
Posts: 3
Joined: Sun Aug 16, 2009 8:55 am

boot loader on cd rom

Post by T3rabyt3 »

I have been learning how to create boot loaders from various tutorials on the internet. What I need is for it to simply load the kernel that I create. The problem is that every tutorial I find only explains how to do this on a floppy disk. I don't own a single floppy disk, or even a computer with a floppy drive. Stores also appear not even to stock these anymore. No one I know has a floppy drive either. My question is, how would one, using x86 ASM, load another file to run, when the boot loader and all of the necessary files are located on a cd rom.
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: boot loader on cd rom

Post by i586coder »

Hi,

the easiest way is using mkisofs and make floppy disk emulation

look at osdev wiki
http://wiki.osdev.org/Mkisofs


CheerS :mrgreen: ,
a.T.d
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
T3rabyt3
Posts: 3
Joined: Sun Aug 16, 2009 8:55 am

Re: boot loader on cd rom

Post by T3rabyt3 »

Thank you very much, this looks like it will work for what I want to do. One last question, when using this method, do I still refer to the drive the same way in my ASM code, as I would if it were a real floppy disk?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: boot loader on cd rom

Post by Dex »

The simplest way is to write a floppy bootloader, use int 13h, then you need a floppy image, there are lots of program that will make one with out a floppy.
Add your loader and file to the image, now that you have a bootable floppy image you need to open up your cd burn software and click on the make cd bootable (most have this, if not get a free burn software off the net). it will ask for a driver or image point it to your floppy image, it will add two bin files to the cd, that it you can store anything on the cd (eg: backup you files).
Now when you boot with this cd it will boot and load the OS from the cd.
One thing to NOTE: is it only works in realmode so you need to load all you file in realmode or you can go back and forth to load (pmode to realmode) to load files higher that 1MB.

NOTE: The above is using floppy emulation, you can do the same with a harddrive image for harddrive emulation, but it must be smaller than the CD.
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: boot loader on cd rom

Post by quok »

T3rabyt3 wrote:One last question, when using this method, do I still refer to the drive the same way in my ASM code, as I would if it were a real floppy disk?
If you had read the El Torito specification then you'd know the answer to this. Yes, you refer to the emulated floppy disk the same as if it was a real disk. It will be disk number 00. Any real floppy that may be available would be bumped from 00 to 01 when booting from a floppy-emulated El Torito cdrom. The same applies if you use hard disk emulation as well.
T3rabyt3
Posts: 3
Joined: Sun Aug 16, 2009 8:55 am

Re: boot loader on cd rom

Post by T3rabyt3 »

Thank you so much for your help. I managed to get what you described working perfectly. Also, I'm sorry I didn't come across the information you provided about "El Torito," but I shall now read it, now that you have provided the information.
Post Reply