Page 1 of 1
ata cdrom i/o
Posted: Wed Apr 21, 2004 11:43 pm
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.
Re:ata cdrom i/o
Posted: Wed Apr 21, 2004 11:54 pm
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...
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 12:05 am
by Cemre
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 12:29 am
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.
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 12:39 am
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.
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 1:22 am
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
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 4:31 am
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)
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 11:40 am
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.
Re:ata cdrom i/o
Posted: Thu Apr 22, 2004 9:23 pm
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???????????????
Re:ata cdrom i/o
Posted: Fri Apr 23, 2004 2:33 am
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,