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

H. Peter Anvin hpa at zytor.com
Sat Dec 15 12:31:52 PST 2007


Gordon Schumacher wrote:
> On Fri, 14 Dec 2007 17:14:26 -0800, H. Peter Anvin wrote:
>> 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.)
>>   
> After a bunch more digging, I'd concluded the much the same thing. I'm 
> puzzled what you mean about the linker though - do you mean ld? If so 
> what does it have to do with what we're passing to com32's open function?

If you're keying on *data*, like strings, then you have to have a 
dispatch function somewhere, which will pull in every single device 
driver in any binary.

Hence opendev(), which only pulls in the requested device drivers.

>> 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.
>>   
> Well... so I have an lseek() function that works for com32 as well now, 
> even for seeking backwards. (To be fair I haven't tested it strenuously 
> yet.) I've also got some changes that allow one to use 
> open/read/lseek/etc. on the raw disk.
> 
> At this point, really, I have a bunch of patches to submit to y'all and 
> see what you think; I'm just working on getting the place to store them 
> set up first. Should be within the next week or so... I've been busy 
> busy, hehe...

OK :)

	-hpa




More information about the Syslinux mailing list