Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Current FreeDOS fdisk utility (Users)

posted by tom Homepage, Germany (West), 17.01.2021, 14:58

> > I think I understand the problem now, and it's not easy to fix.
> >
> > for ease of arithmetic, assume a cylinder size of 1000 sectors.
> >
> > if an existing 4500 sector partition extends from 5200 to 9700, FDISK
> will
> > "round down" this partition to 5000 through 9999, will create the next
> > partition at 10000, and everybody is happy.
> >
> > if an existing 4500 sector partition extends from 5600 to 10100, FDISK
> will
> > "round down" this partition to 5000 through 9999, will create the next
> > partition at 10000, and everybody is unhappy (sooner or later).
>
> unfortunately, I think my explanation was wrong, at least as far as
> Read_Partiton_Tables() is concerned. IMO this should work as expected.
>
> the bug must be somewhere else.
>
> unfortunately, the package as delivered doesn't compile as catgets.* is
> missing.

I found and fixed it in FDISK 1.22

like in a difficult Sudoku after the expert pointed it out to you.
once you see it, it's easy to see.

PDISKIO.C, line 954-964 should be changed to

          pDrive->pri_part[index].end_head=pDrive->total_head;
          pDrive->pri_part[index].end_sect=pDrive->total_sect;
          pDrive->pri_part[index].end_cyl
           =Extract_Cylinder_From_LBA_Value(
           /* */
           (pDrive->pri_part[index].rel_sect
           +pDrive->pri_part[index].num_sect)
          0,                           // !!,pDrive->pri_part[index].end_head
           1,                           // !!,pDrive->pri_part[index].end_sect
       ,pDrive->total_head
           ,pDrive->total_sect);


and similarly 1071 through 1091.

I will see if I can fix Japheth's recent 2 bugs.

 

Complete thread:

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