reading a DVD TOC from a kernel module

1 view
Skip to first unread message

Slava Imameyev

unread,
Oct 9, 2010, 11:55:05 PM10/9/10
to ata-sc...@lists.apple.com
Hi,

Recently I stumbled across the following problem -
  - It is impossible to retrieve a DVD TOC from the kernel module

To clarify - a kernel module can get a pointer to any object in a DVD stack, but the module is external to the DVD stack so to be graceful it invokes only public functions, also the module can't allocate a SCSITask class object as doesn't inherit from any SCSI related class. So the only option is to invoke readTOC() which fails for DVD.

Is this failure a deliberate by design? What are the reasons for this? 
On Windows there was no problem in issuing a SCSI request from a kernel module which retrieved a DVD TOC ( at least it didn't failed though I can't bet that it returned a correct information ).

Regards,
Slava

Chris Sarcone

unread,
Oct 11, 2010, 8:24:41 PM10/11/10
to Slava Imameyev, ata-sc...@lists.apple.com
Slava --

Recently I stumbled across the following problem -
  - It is impossible to retrieve a DVD TOC from the kernel module

To clarify - a kernel module can get a pointer to any object in a DVD stack, but the module is external to the DVD stack so to be graceful it invokes only public functions, also the module can't allocate a SCSITask class object as doesn't inherit from any SCSI related class. So the only option is to invoke readTOC() which fails for DVD.

DVDs do not have a Table Of Contents like CDs do. They have Disc (neé DVD) structures.

Is this failure a deliberate by design? What are the reasons for this? 

The reason is that they are different as defined by the SCSI MMC and Mt Fuji specs. I suggest you read the specification and figure out exactly what your software requires, then issue the proper command(s).

On Windows there was no problem in issuing a SCSI request from a kernel module which retrieved a DVD TOC ( at least it didn't failed though I can't bet that it returned a correct information ).

I won't speculate as to why Windows returns something without an error. The drive returns an error, so OS X returns an error.

HTH,

-- Chris


------------------

6 Infinite Loop

M/S 306-2MS

Cupertino CA 95014

phone: (408) 974-4033

fax:   (408) 862-7577

email: sar...@apple.com


Slava Imameyev

unread,
Oct 12, 2010, 11:34:46 PM10/12/10
to Chris Sarcone, ata-sc...@lists.apple.com


Thanks

> I won't speculate as to why Windows returns something without an error. The drive returns an error, so OS X returns an error.

 I checked the TOC returned by Windows - it contains some reasonable values and consistent across different PCs, also this is a requirement from Microsoft for drivers to support READ TOC command.

> I suggest you read the specification and figure out exactly what your software requires, then issue the proper command(s).

 There are compatibility issues when a software for Windows need to be ported on Mac( it is impossible to say a customer - "Mac doesn't support this" especially for heterogeneous hardware ) .
  Windows supports a reach SCSI interface available from both user and kernel mode ( and this doesn't create any security issues ) and never fails READ TOC command for DVD, it is reasonable to expect the same for Mac OS X but it happens not to be the case - a Mac OS X interface is prohibitively restrictive, especially for DVD.
 The most bewildering is that readToc() function is present in every DVD related class of a driver stack and there is no any mention that it actually always fails. In fact I will have to build a TOC by hand or else a compatibility with Windows is impossible.
 Also, I do not se any reason for restricting access to the SCSITask class.
Reply all
Reply to author
Forward
0 new messages