[syslinux] [syslinux:disklib] disklib: make CHS calculation match core/fs/diskio.c
Michal Soltys
soltys at ziu.info
Wed Oct 13 14:44:44 PDT 2010
On 10-10-13 23:30, H. Peter Anvin wrote:
> On 10/13/2010 08:36 AM, syslinux-bot for Michal Soltys wrote:
>> Commit-ID: 9c8db7560e2dc83d1191bb2f90b4d4d0ae3d37d6
>> Gitweb: http://syslinux.zytor.com/commit/9c8db7560e2dc83d1191bb2f90b4d4d0ae3d37d6
>> Author: Michal Soltys<soltys at ziu.info>
>> AuthorDate: Wed, 13 Oct 2010 10:57:36 +0200
>> Committer: Michal Soltys<soltys at ziu.info>
>> CommitDate: Wed, 13 Oct 2010 10:57:36 +0200
>>
>> disklib: make CHS calculation match core/fs/diskio.c
>>
>> Signed-off-by: Michal Soltys<soltys at ziu.info>
>>
>
> I note that this code still:
>
> a) duplicates the code between read and write, and
Oki, I'll shrink it.
> b) doesn't check for CHS overflow.
>
lbacnt set in disk_get_params() is always valid (if function is
successful), and it's checked at the very begining of read/write
functions (along with other sanity checks).
CHS check is no longer necessary, as CHS is used only if ebios == 0, and
that implies that lbacnt is calculated from valid geometry (cbios == 1)
or faked (1/1/1) in which lbacnt == 1.
I'll update the comments to make it more clear.
More information about the Syslinux
mailing list