ata cdrom i/o

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
virusx

ata cdrom i/o

Post by virusx »

hi,
i want to access cdrom from my os. how to do that.
Particularly,
How to detect cdrom?
how to read sectors of cdrom?

thanks.
Cemre

Re:ata cdrom i/o

Post by Cemre »

cdrom's are so called "packet interface" devices. you can find information about ata6 packet interface on this pdf file...

www.ug.bcc.bilkent.edu.tr/~engino/ata6.pdf

have fun...
virusx

Re:ata cdrom i/o

Post by virusx »

thanks cemre,
It seems that the links contain everything i want.

thanks

Does anybody know how to detect usb drive(flash disk) and read the sectors.

Thanks.
ASHLEY4

Re:ata cdrom i/o

Post by ASHLEY4 »

I have just finished my atapi driver, And like Cemre said you use a 12byte packet's for differant commands.it is not easy to explain as you have to set things up in the right order.

But if you just want to run your OS from a cd instead of a floppy,You can easily do this by making a image of your OS's floppy,and burning this on a cd as a bootable cd.
This makes the bios think its booting a floppy,it moves your real floppy from say A: to B:,You can also do this with a HD image.

PS: If you needed some code to auto detect your HD/CD to get you started let me know (it will be in asm), and i will give you a example.

ASHLEY4.
virusx

Re:ata cdrom i/o

Post by virusx »

Thanks ASHLEY4,
ASHLEY4 wrote:
PS: If you needed some code to auto detect your HD/CD to get you started let me know (it will be in asm), and i will give you a example.

ASHLEY4.
please.....

thanks
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ata cdrom i/o

Post by Pype.Clicker »

virusx wrote: Does anybody know how to detect usb drive(flash disk) and read the sectors.
implement the pci detection, locate *HCI driver as PCI device, run USB enumeration, check for device class=usb-storage, then communicate with the USB device accordingly to the SCSI protocol...

(afaik. i may have missed steps :p)
ASHLEY4

Re:ata cdrom i/o

Post by ASHLEY4 »

This code (To detect cdrom) is made to run in real mode before you enter pmode, so you can get the first hard/cd drive's Drive/Port, It can be made to get all HD/CD drive's Drives/Port if you want.

ASHLEY4.
virusx

Re:ata cdrom i/o

Post by virusx »

no problem in detecting usb in pci.
Pype.Clicker wrote: then communicate with the USB device accordingly to the SCSI protocol...
what after that???????????????
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ata cdrom i/o

Post by Pype.Clicker »

well, the SCSI protocol should offer you commands to read/write sectors afaik :)

http://www.tldp.org/HOWTO/SCSI-Programming-HOWTO.html
http://www.hochfeiler.it/alvise/scsi.htm
Obtaining the specifications

Electronic copies of the latest drafts are available via anonymous ftp from:

* ftp.cs.tulane.edu:pub/scsi
* ftp.symbios.com:/pub/standards
* ftp.cs.uni-sb.de:/pub/misc/doc/scsi

I got my SCSI specification from the Yggdrasil Linux CD-ROM in the directory /usr/doc/scsi-2 and /usr/doc/scsi-1
googling for 'SCSI programming standard' could be helpful too,
Post Reply