Page 1 of 1

[Resolved]Read sectors from CD-ROM

Posted: Sun Nov 04, 2012 11:49 pm
by leyley
I've found this: http://wiki.osdev.org/ATAPI from wiki, but I have no idea which ports I operated when I'm loading data form a CD-ROM, can somebody give me some explanations about ATAPI(or some example cods which are used for reading sectors from CD-ROM)?
Thanks!
Thanks for your replies, I can read data from CD-ROM now.

Re: Read sectors from CD-ROM

Posted: Mon Nov 05, 2012 2:21 pm
by ateno3
You should read the IDE Wiki Page because there a lot of codes about how you can do it. Moreover, codes for ATA driver

Re: Read sectors from CD-ROM

Posted: Mon Nov 05, 2012 3:53 pm
by Griwes
Pedantic note: "code" is always singular, never plural.

Re: Read sectors from CD-ROM

Posted: Tue Nov 06, 2012 1:15 pm
by ateno3
Griwes wrote:Pedantic note: "code" is always singular, never plural.
I am sorry, English is not my native language.

Re: Read sectors from CD-ROM

Posted: Wed Nov 28, 2012 9:02 pm
by leyley
I've found some codes for reading sectors from HDs, but it seems that the codes doesn't fit for CDROM operations.
Does CDROM use same I/O ports as HDs do(1Fx,17x)?
Maybe I need something about IO ports...

Re: Read sectors from CD-ROM

Posted: Thu Nov 29, 2012 2:23 am
by Combuster
leyley wrote:http://wiki.osdev.org/ATAPI
(...)
Does CDROM use same I/O ports as HDs do(1Fx,17x)?
Learn to read. Please. [-X

Re: Read sectors from CD-ROM

Posted: Thu Nov 29, 2012 2:46 am
by egos
In other words read about ATAPI subset.

Re: Read sectors from CD-ROM

Posted: Thu Nov 29, 2012 3:09 am
by leyley
Combuster wrote:
leyley wrote:http://wiki.osdev.org/ATAPI
(...)
Does CDROM use same I/O ports as HDs do(1Fx,17x)?
Learn to read. Please. [-X
...................................................................
Now I know that they use same ports because they are seat on IDE.
Read HDs using ATA while CD-ROMs need ATAPI.
Is there any extra info about ATAPI PACKET?

Re: Read sectors from CD-ROM

Posted: Thu Nov 29, 2012 5:20 am
by egos
See PACKET command description. Here is packet to read sector(s):

Code: Select all

  db 0BEh
  db FORMAT ; 0 - any
  dd STARTSEC
  db 0
  dw SECCOUNT
  db FLAGS ; 10h - only data
  db 0
  db 0

Re: Read sectors from CD-ROM

Posted: Thu Nov 29, 2012 7:59 am
by leyley
egos wrote:See PACKET command description. Here is packet to read sector(s):

Code: Select all

  db 0BEh
  db FORMAT ; 0 - any
  dd STARTSEC
  db 0
  dw SECCOUNT
  db FLAGS ; 10h - only data
  db 0
  db 0
The "PACKET command" segment of ATAPI makes me confused because there's no further description of such command(maybe the wiki page needs to be updated?).
Thank you very much! I really appreciate that you can give me the detail of a PACKET and its description.