Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Bug in FreeDOS FDISK 1.3.4 or BIOS? (Developers)

posted by tom Homepage, Germany (West), 23.11.2022, 16:22
(edited by tom on 23.11.2022, 18:40)

> Thanks to all for the feedback.
>
> By skimming over the FDISK source code I think I found a possible location
> yielding an off-by-one error:
>
> https://gitlab.com/FreeDOS/base/fdisk/-/blob/master/SOURCE/FDISK/FDISK/PDISKIO.C#L919
>
>
> pDrive->pri_part[index].end_cyl
> =Extract_Cylinder_From_LBA_Value(
> /* */
> (pDrive->pri_part[index].rel_sect
> +pDrive->pri_part[index].num_sect)...
>

>
> I think that should be
>
> pDrive->pri_part[index].end_cyl
> =Extract_Cylinder_From_LBA_Value(
> /* */
> (pDrive->pri_part[index].rel_sect
> +pDrive->pri_part[index].num_sect - 1)...
>

>
> Can anyone please double-check that?

I think that a) is a plausible place and b) looks right.

I also think that all occurences of

xyz.end_cyl = Extract_Cylinder_From_LBA_Value()

should be checked. It's quite horrible software:-D

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 81 users online (1 registered, 80 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum