[syslinux] Read disk with open()/read()?

H. Peter Anvin hpa at zytor.com
Fri Dec 14 17:14:26 PST 2007


Gordon Schumacher wrote:
> Is there already a way to read directly from the disk, perhaps via 
> INT22/19h, using the COM32 open()/read() functions?

> If not, I'd like to propose adding the ability to do something like:
> int fd = open("//", O_RDONLY);
> to allow reading from the raw disk.
> 
> I am working on building a COM32 module out of the checkisomd5 tool from 
> isomd5sum, but I need a way to
> access the raw disk in order to do that.

Using the COM32 library, no.  You could create a device descriptor for 
it and use opendev() (I don't use filename tricks, because it prevents 
the linker from doing its job.)

chain.c has code to read raw disks, obviously, but it doesn't use the 
device layer.  I'm not 100% sure if using the device layer is desirable, 
  since it's rather limited and doesn't (currently) support seeks, but 
I'd be interested in hearing people's opinion on it.

	-hpa




More information about the Syslinux mailing list