[syslinux] [syslinux:disklib] disklib: make CHS calculation match core/fs/diskio.c

Michal Soltys soltys at ziu.info
Thu Oct 14 14:13:55 PDT 2010


On 10-10-14 17:53, H. Peter Anvin wrote:
> On 10/14/2010 02:42 AM, Michal Soltys wrote:
>>  On 10-10-14 02:40, H. Peter Anvin wrote:
>>>
>>>  Ideally, the code should be merged as closely as possible with
>>>  core/fs/diskio.c, with the goal of making the diskio.c the *only* code
>>>  in Syslinux 5.
>>
>>  So in context of v5 - completely remove disklib, or keep it as a small
>>  as-necessary wrapper around ./core/fs/diskio.c (for sake of com32
>>  modules) ?
>
> It will depend on what makes sense.  I have the idea of actually
> supporting opening raw disks with "open" for Syslinux 5, but it might
> not be feasible ... and even then it might be desirable to have a
> compatibility wrapper.
>

Hmmm, partiter.{c,h} I keep in chaindev differentiates between dos, gpt 
and raw disks now. If there's anything that doesn't click with sanity 
checks, the disk is "iterated" as raw (well, de-facto it's more like a 
disk iterator now). I added it to make possible booting whatever code 
someone might put in the beginning of some disk (disregarding any magic 
values). There's also "raw handover" thingy, that prepares handover area 
for the whole disk.

+/- It could be somewhat close to your idea.

> *However*, the core diskio code will need to be expanded to understand
> partitions, so a lot of the code currently in disklib should be possible
> to merge into the new core.
>
> 	-hpa
>

I think, with pretty minor adjustments to diskio.c, I could make disklib 
use diskio.c stuff right now. Looking at *rdwr_sectors, it's a waste not 
to use them (self adjusting chunked access, tolerance to crazy bioses). 
Not that there would be much left of disklib after that...

Well, I'll do that extra patch removing duplicated code + adjusting 
comments, and go on with diskio/disklib stuff. I'll ping you back when I 
have something.




More information about the Syslinux mailing list