Bootloader, booting from CD

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
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Bootloader, booting from CD

Post by m99 »

Welcome
I want to write bootloader. It will be on floppy. I want this bootloader to boot CD, that is actually inserted.
Now I have simple bootloader that prints text on the screen.
Can someone give me some ideas about how to boot CD?

Thanks in advance
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: Bootloader, booting from CD

Post by djmauretto »

Hello,
Easy way: Burn your floppy image with CD Burner software( in some cd burner software
there is a function to create cd boot)
Hard way(my favourite): Write your raw cd iso image and burn it to cd :-)
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Re: Bootloader, booting from CD

Post by m99 »

I mean something diffrent.
I HAVE TO write my own bootloader, that boots CD.
LoseThos
Member
Member
Posts: 112
Joined: Tue Oct 30, 2007 6:41 pm
Location: Las Vegas, NV USA
Contact:

Re: Bootloader, booting from CD

Post by LoseThos »

mrnoob
Member
Member
Posts: 26
Joined: Thu Sep 18, 2008 11:45 am

Re: Bootloader, booting from CD

Post by mrnoob »

Why not boot straight from the CD with El Torito?
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Re: Bootloader, booting from CD

Post by m99 »

mrnoob wrote:Why not boot straight from the CD with El Torito?
I don't know how to do it.
Can you tell me more about it?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Bootloader, booting from CD

Post by Combuster »

From our own wiki: Bootable CD. Please search in the future.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Re: Bootloader, booting from CD

Post by m99 »

But I don't want to create bootable CD. I want to make bootloader that will be reading from CD.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Bootloader, booting from CD

Post by 01000101 »

So, do you want a bootloader that gets loaded from the floppy but then can read from a CD? or do you want a bootloader on a CD which can read from the CD?

In either case, you've been provided with the information to accomplish either task.

Also, I'm sure there are various BIOS Interrupts that you can use to read sectors and such. Do some research.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Bootloader, booting from CD

Post by Troy Martin »

E: I don't think the BIOS ints would do too well with the 2352-byte sectors, so you'd probably be going for direct hardware access.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Bootloader, booting from CD

Post by Dex »

Other than use the above mefords, you will need to write a ATAPI driver, you will need the above pdf for programming info.
Also you can look at DexOS ATAPI driver, to code a driver you need to start at the basic's and add more funtions etc.

Here is a example of a basic ATAPI driver i coded, it demos setting up vesa, going to pmode, drawing a basic GUI and a simple CD player (ATAPI driver) all in less than 512bytes, has it boots and runs from the boot sector of a floppy.
Attachments
vesa.asm
(2.18 KiB) Downloaded 132 times
Ata_Atapi1.asm
(5.79 KiB) Downloaded 108 times
CdPod.asm
(7.16 KiB) Downloaded 82 times
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: Bootloader, booting from CD

Post by JohnnyTheDon »

Some BIOSes have EDD extensions. These extensions include ATAPI support. If your bootloader loads your kernel while in real mode, you can use a modified int 0x13 interface to load it.

Specifications:
http://www.phoenix.com/NR/rdonlyres/9BE ... sedd11.pdf
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Re: Bootloader, booting from CD

Post by m99 »

I read some information about Int 13 h extensions and about ElTorito Specifaction and I managed to write what I want.
It looks:
I put CD with my bootloader into CDROM, then I remove it then I insert some bootable CD for example livecd of UBuntu i press enter and livecd shout be booted.

I read about ElTorito and I know that BootRecordVolume is in 17 sector, I can find there pointer to Booting Catalog and in Booting Catalog I find pointer to bootable image of CD.
To use sectors I use function 42h of int 13h.
Program works good in Bochs, it boots windows, linux and other CDs, but when I tests program in real it can not read bootable image.
Does someone knows what has happened?
eddyb
Member
Member
Posts: 248
Joined: Fri Aug 01, 2008 7:52 am

Re: Bootloader, booting from CD

Post by eddyb »

i think it's because those extensions: Bochs BIOS have it, but your pc doesn't :(
m99
Posts: 13
Joined: Fri Dec 26, 2008 8:16 am

Re: Bootloader, booting from CD

Post by m99 »

But when I checked function 41h of int 13h it shows that I have support. It shows even when I boot my computer from CD.
Interesting think is that reading is bad it means I want to read 17 sector offset 47h on CD(8847h) but my program reads from addres F247h.
It happens with every CD I boot. Isn't int 13h extensions standard in these days?
Post Reply