Konami Man <[EMAIL PROTECTED]> wrote:
> Hello people... I have a satanic idea flying about my mind: to break
the DOS
> 2 limit of 32Mb/partition limit.
Even if I don't have any SCSI device (neither on MSX nor on my PC), I
find this idea very interesting ! It could also the problem of number of
partitions on a disk and a better "drive letter" use...
> Let's begin for the beginning. The 32 Mb limit is given by the sectors
> number limit. Only two bytes are prepared in the boot sector of the
> MS(X)-DOS disks for storing the number of sectors of the
disk/partition, at
> position #13 and #14 of the sector. Since sector size is 512 bytes,
the
> maximum partition size is 32768K.
For your information I'm not enough specialist or DOS evolution
historian to ensure the reliability of all the mecanism and their
"arrival date"... and also I don't have any harddisk on my MSX. So I
hope not to make too many mistakes...
> MS-DOS 4 and higher uses four bytes, in positions #20-#23 of the boot
> sector, for storing the number of sectors in partitions higher than
32Mb; in
> such case, #13-#14 stores the value 0. MSX-DOS 2 stores the string
"VOL_ID"
> in positions #20-#25 as a flag for indicating that the disk has a
serial
> number in positions #27-#2A.
>
> Another question is the FAT entry size. MSX-DOS uses a 12 bit FAT, as
well
> as MS-DOS for partitions smallest than a certain number of sectors (I
don't
> know if this number is also 65536). For highest partitions, a 16 bit
FAT is
> used. In positions #36-#3A of the boot sector in disks formatted with
MS-DOS
> 4 or higher you can found the string "FAT12" or "FAT16" referring to
the FAT
> entry size.
Addressable range:
2 Mb = 512 bytes * 2 ^ 12 (FAT12)
32 Mb = 512 bytes * 2 ^ 16 (FAT16)
(sector size which is assumed constant, even if coded at offset #B)
So even with a FAT16 the MS-DOS (up to version 3.3 I think) had a
problem for partitions bigger than 32 Mb.
MS-DOS 4.0 (or more) allowed to use FAT16 with an extra feature, the
cluster, which is a group of sectors, an do, even if the physical read
unit is 512 bytes, the assignements are now made per cluster instead of
sectors (I guess everyone knows about that), which is the allocation
unit.
So the number of clusters stays 65536 (and so also the number of files
per partition), maximum cluster size is 32 Kb (64 sectors per cluster),
allowing up to 2 GB size partitions.
But for two (or even three ?) reasons this is now changed using the
MS-DOS 7.0"b" from Windows 95b (OSR2 with FAT32):
* nowadays disks are between 2 and 8 GB (and even more for some very
expensive "Servers aimed" disks)
* putting so much sectors in a cluster causes a huge waste of diskspace,
most of the files are less than 8 Kb (even less with all the LNK files,
batches, GIF from internet, etc...), this waste can be as high as 30 %
(yes you've read THIRTY %) of the total disk capacity.
* and even maybe that only 6 bits were assigned in the boot sector for
the "sector per cluster" (offset #D) value (but I doubt it's the case).
Even MSX-DOS 1.0 handles clusters, because as far as I remember, each
tiny file on floppy disk occupied 1 Kb... which means 2 sectors per
cluster.
So on this basis, lets speculate that MSX-DOS 2.x can handle up to 64
sectors per clusters as MS-DOS can (and even lets dream that even 128
sectors (1000 0000 bin) can be grouped but maybe it's used as a special
flag value), and that the big total number of sectors value is stored on
4 bytes as with MS-DOS, we could have:
FAT12:
128 Mb = 512 bytes * 2 ^ 12 * 64
(4 times bigger than actual limitation, still using FAT12 but it needs
changes in boot sector for the number of sectors)
FAT16:
2048 Mb = 512 bytes * 2 ^ 16 * 64 (about 4 millions sectors, which is
the FAT16 limitation even on MS-DOS)
I guess SCSI disks on MSX system use FAT12 with clusters of up to 16
sectors... Correct me if I'm wrong.
If we avoid changing the number bits used in FAT, we also avoid all the
major changes in the access method (assuming cluster are already used,
without any limitation of bits above to 4 except the fact of the 2 bytes
for total sectors number).
Few years ago I tried to reduce the cluster size to 1 sector on a floppy
disk to reduce the waste (many tiny files on the disk) but it failed. I
tryed the same on RAMDISK, and it WORKED !!! so my hopes are great about
playing with cluster size...
> So, what kind of modifications are needed for MSX-DOS in order to read
big
> partitions? "Only" these, I think:
>
> 1) Change the method of knowing if the disk has a volume label. A good
way
> is to read position #26 of the boot sector. MS-DOS 4 and higher stores
the
> value #29 here as a DOS 4 ID flag, so I think we can use the same
value or
> other for the same purpose.
>
> 2) When reading 0 as number of sectors, DOS must read the actual
number of
> sectors in position #20-#23.
>
> 3) String at position #36 must be read for knowing the FAT type, and
> routines for handling 16 bit fat must be added.
nihil
if we can use the cluster size (128 Mb per partition and even 256 Mb if
128 sectors per cluster is allowed; and even 512 Mb if system assumes
that 0 sector per cluster means overflow and uses 256 but that's a bit
risky...)
> 4) Anyway there is a problem: the MSX-DOS functions for absoulte
sector
> read/write, and for getting the DPB. They works with 16 bit sector
numbers,
> so programs using these functions may probably have problems with
these new
> partitions.
nihil (see above)
> I think this is all the modifications needed, if I forget something
please
> correct me.
So we can hope that changing the cluster size up to 64 or 128 sectors
per cluster, plus changes as described in point 1 and 2 (adopt the same
boot sector interpretation for the total number of sectors, and moving
some other fields as VOL ID) can make the partitions 4 (or 8) times
bigger than now.
This would for less work than FAT16 already allow an interesting
enhancement...
FAT16 would need some changes in:
* direct sector access method
* the way of reading the FAT itself
* the way of coding the "begin at" field in the directory entry (offset
#1A in the 32 bytes long directory entry)
* all the other changes related to the total number of sectors as with
the FAT12 + big clusters method)
FAT12 + big clusters won't help having more files per partition, which
is still limitated to up to 4096 files, which is huge (on Win 3.1
system I never reached 3000, but now with Win95 I've doubled this
number, and so FAT16 is really needed).
When here I say "files", it should also include all the directories
entries and the special sectors used for the BOOT, the FAT itself and
the root directory.
So I'd say FAT12 + "big clusters" could be a step before FAT16, but
anyway anything done for the first won't be lost for the second.
FAT16 will never be used in MSX-DOS 2.x, because with such a big change
in its access method, it should already be named MSX-DOS 3 or 4 :-)
and even the needed changes to allow more than 32 Mb partition using
FAT12 + big clusters is a great change !!!
> And here is when I ask for help: Anyone has enough information about
DOS 2
> internals for doing these modifications? I have only the program
interface
> specifications and the function codes specification, and an incomplete
(and
> dutch) list of the DOS variables in page 3, given with Compass.
Information
> about the kernel in ROM, about the two RAM segments used by DOS 2, and
about
> the DOS variables in page 3 (but complete and english!) is needed.
Someone
> must have this information!!
>
> Another way is to make a program in multi-mente style capable to read
big
> partitions, using drivers for the absolute sectors read and write for
each
> controller (concretely, I have a Mega-SCSI). But I think it is better
to
> patch the DOS in the same way as MegaSCSI's MSXCDEX.
>
> Sorry for this big message, but I think that it is an important
subject.
> Please think about it. And if you have the DOS 2 information please
make it
> public!
I hope I haven't made too many errors, nor borred you about things you
already knew. I wish you can reach your aim with the collaboration of
all good willingness MSX users.
I wish to all the MSX users a Happy New Year !
MetalGear
---------------------------------------------------------------
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
WEB: http://www.ping.be/metalgear
Les Petits Déjeuners du Cinéma
http://www.ping.be/metalgear/ptitdej
Forum MSX mag.
http://www.mygale.org/05/forummsx
http://www.ping.be/metalgear/mirror/forummsx
---------------------------------------------------------------
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****