fdisk compatibility

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
octavio

Re:fdisk compatibility

Post by octavio »

Billy wrote: Microsofts documentations is not 100% accurate, there are a few things that are incorrent in it,
can you explain what things are incorrect.
I don?t care very much for some details because my intention
is to use my own filesystem later,but now is better to have
fat32 compatibility.
The code is relatively specific to my kernel, since it installs the bootsector and kernel, and points a variable in the bootsector to the first sector of the kernel on the disk.
Do you mean that if you change the kernel position it will not
boot?
i wrote a boot sector that search the kernel in a given path.
All of that could easily be changed however.
but porting it to my Os is not so easy,and i already have my own code.
do you know something about the 2TB limit on actual MBR?
Kemp

Re:fdisk compatibility

Post by Kemp »

Microsofts documentations is not 100% accurate, there are a few things that are incorrent in it
Much like that sentence ;D On to my point though, we have a question... Are the documents incorrect? Remember that this specification was created by Microsoft, maybe the documents are right and it is their implementation that is wrong? Or maybe you simply misread the docs?

Ponder these questions and then remember my questions don't really matter all that much ;)
JAAman

Re:fdisk compatibility

Post by JAAman »

I wrote a fat12/16/32 formatting utility that gives no errors in win98/win xp, and let me tell you, if I set the OEM string to anything but MSWIN4.1, it doesn't not work properly!
are you sure? because none of my FDs (windows 95,98,XP,DOS formatted) disks say 'MSWIN4.1' though i have seen this, windows (at least winXP) just puts random characters in the OEM_name field (which is supposed to contain the identity of the OS which formatted it) if it actually checks this it would make it incompatable with itself, and all non-windows (including DOS) OSs -- though i think i have seen it on my HDDs, but don't have a printout now to compare with -- though no version before win98 would say that -- therefore any HDD formated under DOS or win95 (or winXP) would be readable under win98? this doesn't sound right (of course FAT32 would be an exception since it couldn't be formatted under DOS, but win95 can -- and i don't think winXP says 'WINDOWS4.1'

i have looked at many disks (i use debug to read the bpb and then copy it into my boot-sector) and most all of them (certainly all formatted with winXP) contain random characters in that field

as for the File_system field -- it is a text field, therefore more suitable for human reading, not machine reading, i would never assume that any machine would use this field
have done multiple fat32 partitions ,one wiht only 7MB
it is possible that FAT32 is detected through the FS_type field in the MBR? don't know -- i do know that it must be correct, because win uses it to deturmine whether to use the CHS or LBA values in the MBR for finding the partition
Kemp

Re:fdisk compatibility

Post by Kemp »

Any software which is strict to the specs will determine the FAT type based purely on the number of clusters on the disk (think it's clusters, might be one of the other units, but definately not the field in the drive info block).
octavio

Re:fdisk compatibility

Post by octavio »

JAAman wrote: it is possible that FAT32 is detected through the FS_type field in the MBR? don't know -- i do know that it must be correct, because win uses it to deturmine whether to use the CHS or LBA values in the MBR for finding the partition
i think windows always uses the lba fieds if present (not zero ), and if the 16 bits total sectors is zero then it assumes that is a 32bit fat partition ,this is also the method i use on my
OS. Note that digital cameras also use a small fat32 partition.
About the OEM string is recomended to use 'mswin4.1' windows don?t care about this but other software could do.
Kemp

Re:fdisk compatibility

Post by Kemp »

There is considerable confusion over exactly how this works, which leads to many ?off by 1?, ?off by 2?, ?off by 10?, and ?massively off? errors. It is really quite simple how this works. The FAT type?one of FAT12, FAT16, or FAT32?is determined by the count of clusters on the volume and nothing else.
This is the one and only way that FAT type is determined. There is no such thing as a FAT12 volume that has more than 4084 clusters. There is no such thing as a FAT16 volume that has less than 4085 clusters or more than 65,524 clusters. There is no such thing as a FAT32 volume that has less than 65,525 clusters. If you try to make a FAT volume that violates this rule, Microsoft operating systems will not handle them correctly because they will think the volume has a different type of FAT than what you think it does.
Cjmovie

Re:fdisk compatibility

Post by Cjmovie »

JAAman wrote: are you sure? because none of my FDs (windows 95,98,XP,DOS formatted) disks say 'MSWIN4.1' though i have seen this, windows (at least winXP) just puts random characters in the OEM_name field (which is supposed to contain the identity of the OS which formatted it) if it actually checks this it would make it incompatable with itself, and all non-windows (including DOS) OSs -- though i think i have seen it on my HDDs, but don't have a printout now to compare with -- though no version before win98 would say that -- therefore any HDD formated under DOS or win95 (or winXP) would be readable under win98? this doesn't sound right (of course FAT32 would be an exception since it couldn't be formatted under DOS, but win95 can -- and i don't think winXP says 'WINDOWS4.1'

i have looked at many disks (i use debug to read the bpb and then copy it into my boot-sector) and most all of them (certainly all formatted with winXP) contain random characters in that field
Removable media have a random OEM id that ends with IHC (supposedly reverse of first 3 letters of "Chicago", code-name of W95) that allows the system to identify whether the disk has changed between reads or not.
JAAman

Re:fdisk compatibility

Post by JAAman »

octavio wrote: i think windows always uses the lba fieds if present (not zero ),
i don't think so -- i remember reading in an old MBR tutorial that the LBA field can sometimes contain garbage, and when LBA is used the CHS fields can contain garbage, therefore you cannot rely on that to determine which to use
octavio wrote: and if the 16 bits total sectors is zero then it assumes that is a 32bit fat partition ,this is also the method i use on my
OS.
no, FAT16 partitions can use the 32bit total sectors (your method limits FAT16 to a maximum of 32MB -- this is the FAT12 limit, not the FAT16 limit (which is 2GB -- or 22bits)
octavio wrote: Note that digital cameras also use a small fat32 partition.
yes, but not smaller than 8MB (which is the minimum for 65536 sectors) -- i wouldn't use it on any drive smaller than 128MB at least, due to the higher overhead required by FAT32
octavio wrote: About the OEM string is recomended to use 'mswin4.1' windows don?t care about this but other software could do.
that would break compatability with older and newer OSs (if they required 'mswin4.1'
octavio

Re:fdisk compatibility

Post by octavio »

JAAman wrote:no, FAT16 partitions can use the 32bit total sectors (your method limits FAT16 to a maximum of 32MB -- this is the FAT12 limit, not the FAT16 limit (which is 2GB -- or 22bits)
i did a mistake, i was talking about the fat size
on fat32 the 16bits fat size is zero and the 32 bits fat size is
not zero, but fat12-16 always use the 16 bits fat size.
yes, but not smaller than 8MB (which is the minimum for 65536 sectors)
i have one with 3MB and i have tested 32bit fat partitions
with only 14000 clusters ,and windows xp suport them without
problem.
To reduce the overhead i only use one fat copy, and another
advantage of using small fat32 partitions instead of fat12-16
is that i don?t have to write another boot sector for fat12-16.
octavio

Re:fdisk compatibility

Post by octavio »

Small partitions made with my fdisk program have some problems, windows can read the files but it can?t read
the free space. I would like to see how my digital camera
has a 3MB partition using 4KB clusters, somebody knows
a utility for reading the disk image?
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Re:fdisk compatibility

Post by nick8325 »

octavio wrote: Small partitions made with my fdisk program have some problems, windows can read the files but it can?t read
the free space. I would like to see how my digital camera
has a 3MB partition using 4KB clusters, somebody knows
a utility for reading the disk image?
IIRC WinHex can do the trick.
octavio

Re:fdisk compatibility

Post by octavio »

octavio wrote: I would like to see how my digital camera
has a 3MB partition using 4KB clusters, somebody knows
a utility for reading the disk image?
mistery solved: the digital camera uses fat12 filesystem (i need to sleep more), and fat32 must have at least 10000h clusters, now my problem is with linux, i have tested linex and mandrake and both see the partitions as not formatted, linex
also complains about invalid MBR.
Post Reply