TIP: Click on subject to list as thread! ANSI
echo: os2
to: Will Honea
from: Jonathan de Boyne Pollard
date: 1999-11-17 09:32:29
subject: Multiple visible primary partitions

 JP>> I suspect that we might be begging Daniela to modify 
 JP>> Build_Next_VolCB() and Process_Partition() in OS2DASD.DMD .  (-:  
 JP>> 
 JP>> By the looks of it (i.e. from reading the source), Process_Partition()
 JP>> takes the first recognisable partition in the MBR that it finds, and
 JP>> Build_Next_VolCB() only calls it once per MBR.  
 JP>> 
 JP>> The modification should be relatively simple.  One simply needs to
 JP>> take the  for(i=0;i<4;++i) loop out of Process_Partition() and move 
 JP>> it into both Build_Next_VolCB() and BPBFromScratch(),  modifying it
 JP>> along the way so that it doesn't exit  prematurely any more by
 JP>> removing the `found' logic, and  make Process_Partition() take the
 JP>> current loop index as an extra parameter instead.
 JP>> 
 JP>> Daniela ?

 WH> I did something similar when I wrote a DOS driver to support more than
 WH> 2 drives and I seem to recall some nasty problems with it.  It's been
 WH> several years so I don't remember the details but a glance back at
 WH> the code shows I pulled it out.

The only problems would have been if you had coded it the way that linux does
in the `extended_partition' function in drivers\block\genhd.c .  (-:

linux does completely the wrong check for a valid partition table entry (It
*should* check the type byte to see whether it is non-zero, but instead it
checks the sector count and offset fields for sanity.) and then has the gall
to complain in comments that "sometimes the entry is full of garbage".  Well
no wonder!  It should be filtering out all of the type 00 entries.

Both FreeDOS and OpenDOS (a.k.a. DR-DOS) do the checks properly
(`processtable' in SOURCE\DOS-C\SRC\KERNEL\DSK.C in the former, `hard_init' in 
IBMBIO\DISK.ASM in the latter), checking the partition type *first*.

All three support multiple visible primary partitions without incident,
however.

As does Windows NT.  

And as, as I mentioned in a previous message, I suspect also does PC/MS-DOS,
given that in its earliest days it *only* supported primary partitions.

OS/2 Warp is very much on its own, here.  OS2DASD.DMD should be fixed.

 ¯ JdeBP ®

--- FleetStreet 1.22 NR
114/477
143/1
* Origin: JdeBP's point, using Squish (2:257/609.3)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.