Hi Eric,

> not new... Floppy supported 128 to 1024 bytes, for example... Yes,
> FreeDOS only supports 512 bytes at the moment. For unknown reason,
> this became even more hardcoded than it was before short ago. As
> far as I remember, the biggest that MS DOS supported was 4096 for
> WORM, but only with driver.sys?
> Another source mentions 2048 bytes used for MO drives... And wasn't
> there some far-east floppy format with 1024 byte sectors, too?

Technically, MS-DOS should support 8192 too. Bret mentioned this in some  
notes. It would also fit the byte count used as directory entry index into  
a single sector (256 * 32 = 8192).

> Note that supporting bigger sectors will need bigger buffers at
> some point

Yes, any buffer needs to have a (f.e.) 8192 byte data field then. Even for  
drives which have a smaller sector size. With the MS-DOS compatible  
buffers that FreeDOS currently uses (?) the useless space at the end of  
these large buffers can't be re-used when buffering drives with smaller  
sector size.

> and some way of detecting actual sector size.

On DOS's side, simply call the "Get BPB" device function (and insure the  
BPB is valid, i.e. no crucial values zero or -1). The bytes per sector  
field must be set correctly then. The default block device has to obtain  
the sector's size from the BIOS. There doesn't seem to be a standard Int13  
call for that. LBA BIOSes may provide Int13.48 (Get drive parameters), the  
returned table always contains a "bytes per sector" field. [I tested this  
on a 2002 standard PC BIOS, and it supports this call and returns valid  
data.] Otherwise, we either have to assume 512 bytes per sector, or read a  
single sector into an initialized 8192-byte buffer and determine how many  
bytes the read actually changed.

> I do not
> know whether MS DOS ever could BOOT from drives with big sectors.

I don't know either, but with the single-file boot architecture used by  
FreeDOS (which I'll adapt too) this depends solely on the boot loader in  
the boot sector.

> Note that we should also check whether kernel, FORMAT, FDISK, DOSFSCK
> and maybe other tools have "sign overflow" problems for 512 byte per
> sector drives above 1024 GB.

Suggestion: Just _never_ use signed data types for anything were a  
negative value doesn't make sense, such as file sizes and sector numbers  
;-)

> Of course as long
> as FDISK is happy (or you simply use Linux FDISK) you can limit your
> self to drive letters of at most 1024 GB each, avoiding any problems.

Of course as long as you are happy with it you could restrict yourself to  
8 GiB drives which can be addressed by CHS. With this reasoning we can  
avoid any more effort for developers!

> Talking about GPT and UEFI: Tom often mentioned that we should add
> GPT handling to our partition table parser (initdisk.c). Note that
> this might make the parser significantly more complex - not sure.

I'm pretty sure the GPT stuff allows partitioning with 64-bit sector  
addressing. This raises the question how this can be supported by us. Do  
EFI compatibility BIOSes support LBA with actual 64-bit addressing? (The  
LBA packet's sector number field is a 64-bit word, but actual  
implementations [that I've seen] used only 28 or 48 bit of these; known as  
LBA28 and LBA48. On the other hand, 48-bit addressing already enables very  
large drives.)

DOS file systems currently use 32-bit addressing for sectors. This can't  
be worked around by the OS, a new file system is required for that.  
However, such a 32-bit file system could reside at positions on the (GPT)  
disk were it needs to be addressed by LBA48 or "LBA64". This means: the  
DOS file system driver doesn't need to know about 64-bit sector  
addressing; the block device installed for DOS when booting does have to.

> On the other hand, not THAT many places would have
> to be changed to make FreeDOS aware of other sector sizes, at least if
> only block devices loaded AFTER boot would have to support other sizes.

How to access installed hard disks with larger sector sizes then? (Or  
anything which looks like a hard disk or floppy disk, i.e. can be accessed  
by DOS when booting.) Bret mentions in some places that a few USB pen  
drives do have larger sector sizes, such as 2048 bytes. DOS couldn't boot  
 from these then, too.

Regards,
Christian

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to