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), 11.01.2021, 23:13

> > 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).
>
> I do not understand...
exactly. You do not understand.
It could help to read the relevant source code; search for Read_Partitiontables().


> Why should FDISK "round down" the
> start or end of the partition at all? It always has to
> round AWAY from the actual start and end of existing
> partitions. So in your example, if new partitions are
> to have boundaries which are multiples of 1000 sectors,
> the previous partition has to end at or before 5000 in
> both examples and the next partition has to start at
> 10000 or later in the first and 11000 or later in the
> second example. Rounding to NEAREST cylinder boundaries
> seems to be always a bad idea?
it's not 'rounding to NEAREST'. it's round DOWN for partition start,
round UP for (partition end + partition size). basically, FDISK thinks that partitions start at head=0, sector = 1, and end at head = 255, sector 63.


> Or are you saying the rounding just fails to know whether
> it has to be up or rather down at the relevant moment, so
> the author decided to simply round to nearest all times?
no.

> Regarding your next post: You say it would be hard to mark
> clusters in non-FAT filesystems as blocked. My assumption
> was that the FDISK bug only makes the END of FAT partitions
> overlap later partitions.
this bug has absolutely nothing to do with partition types.

> I agree that it is a good thing if the KERNEL detects any
> overlaps. Which makes me wonder whether it would be easy
> to automatically block access to trailing overlapping FAT
> clusters?
I really doubt other OS will implement code not to overwrite
partitions created by some buggy FDISK.

> Of course that still will not help you when the
> partitions are also accessed by OTHER operating systems, so
> a tool to mark overlapping clusters bad still sounds good.
Sure. And of course, you are not in charge to create such a tool :-(

 

Complete thread:

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