CD-ROM Drive

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
royalbru
Posts: 10
Joined: Tue Jul 08, 2008 12:44 pm

CD-ROM Drive

Post 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.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: CD-ROM Drive

Post 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.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: CD-ROM Drive

Post 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.
royalbru
Posts: 10
Joined: Tue Jul 08, 2008 12:44 pm

Re: CD-ROM Drive

Post 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) ?
Post Reply