Page 1 of 1

CD-ROM Drive

Posted: Tue Jul 08, 2008 12:50 pm
by royalbru
Hello,

I would know how make a cd-rom driver to create a LiveCD. I heard something about SCSI, ATAPI. What protocol is the most used actually to communicate with the CD drive ?

I thank you in avance.

Re: CD-ROM Drive

Posted: Tue Jul 08, 2008 1:58 pm
by bewing
Almost all CD drives use the ATAPI protocol. From the flavor of your question, I assume that what you really want to do is create a CD-Burning application inside some OS that you are currently using. This is an extremely difficult challenge, and is mostly beyond the scope of what anyone here can help you with.

Re: CD-ROM Drive

Posted: Tue Jul 08, 2008 8:00 pm
by Dex
Yes ATAPI is what you need, i took your post to mean a bootable CD like linux-live.
In which case you can do it without a ATAPI driver, by using emulation eg: floppy or hdd emulation.
To do this you need a normal bootable floppy image of your OS, you than use your burn software to make the CD bootable, eg: in my burn software i go into new projects and click on make bootable, it than ask for a floppy image i point it to the floppy image it add two bin files to the cd, that it, if you burn it to disk its bootable.
NOTE: Emulation only work in real mode, so unless you load all the file off the CD in real mode, your stuck.
But the good news is if you go back to realmode, emultion starts again, so if you code a function to go to and from realmode for int 13h you can load from image on the CD at will.

Then theres the coding a ATAPI driver, this is not that hard and your best start with coding a cd player and use commands like opening and closing cd draw etc, then move on to read cd as the function used are basically the same code.

To help you here is a old bootable cdplayer i coded http://www.dex4u.com/demos/CdPlayer.zip
Also there a full ATAPI driver in DexOS.

PS: As a side note once you have code a ATAPI driver, adding a cd burner to your OS is not that hard, it just differant commands, i would say a weeks work to add a basic one, working two hours a day.

Re: CD-ROM Drive

Posted: Wed Jul 09, 2008 5:01 am
by royalbru
Thanks for your useful answers.

Dex> I will read your driver.

Where can I find some specifications. Something more educational than the official doc (http://www.t10.org/t13/project/d1410r3a-ATA-ATAPI-6.pdf) ?