Memory card MBR and Microsoft

Started by Hydrophilic, February 03, 2011, 04:47 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Hydrophilic

I wasn't quite sure where to put this thread, but this is where it ended up!

In preperation for mod the uIEC firmware, I was checking the source code and noticed the provision for multiple disks on the same memory card... via the Master Boot Record found on IBM PCs (nowadays mostly Windows or Linux).

All of my SD cards (all 3 mind you) only have a single FAT file system.  But in an effort to test the firmware of uIEC, I decided I would like to setup multiple partitions on a memory card to see what happens... So I opened up the SD card with a sector editor, expecting to see a single floppy-disk-style FAT boot sector, but...

To my surprise I found an hard-disk-style MBR boot record.  Really strange because if you open "Disk Management" from Windows' "Computer Managment" the partition commands are grayed out (using Windows 2K or XP).  The Master Boot Record only had 1 partition, corresponding to the single FAT drive...

Okay, so MS doesn't want to let me create extra partitions, but the memory card seems to be set up to handle them, and the uIEC firmware is definately coded to handle them... so I decided to make some more...

Using a sector editor, I modified the MBR to have a second partion.  I also modified the boot record of the first partion to be smaller and added a second boot record for the remainder of the memory card.

Now creating boot records by hand is a bit risky so I wanted to run "ScanDisk" to be sure I hadn't fouled up anything... and that is where it gets interesting...

On Windows 2000, the memcard shows 2 partitions in "Disk Managment" but only the first one gets a drive letter (and thus the second is "invisible").  When I click the option "Add drive letter/path" and set an appropriate value, the system gives me an hour glass (please wait I can only do 1 billion things per second)... and then after waiting a few seconds I get a message "Please restart the computer to access the extra drive".

Ummm... that's something I would expect from Windows 98/ME... but okay here goes...

Several seconds later Win2K is back up, but the 2nd partition still isn't listed.  So I go back to Disk Management.  It still shows 2 partitions with only the first having a drive letter.  So I try again to assign a drive letter to the second partition and the same thing happens: hourglass (wait a few seconds) then message (please reboot).

Okay, so maybe Win2K drivers are out-of-date (it is 2011 by now), so lets give WinXP a try... Long story short: WinXP does the same crap... I don't have (an intend NEVER to have) WinVISTA.  Still debating Win7...

So you would think (I surely thought) that there was something screwed up with the MBR or 2nd partition boot record that I manually created... but...

Operating system #4 and #9 to the rescue!

If I boot Windows ME or Win98, then both drives show up just fine!  I run scan disk... no errors... I copy files to each partition on memory card... no errors...

The funny thing, IMHO, is that older Win9X (notorious for reboots) did not ask me to reboot and it worked... unlike the newer NT systems (promoted for fewer reboots) which told me to reboot but still failed... what a bunch of junk...

But this isn't a post to bash Microsoft, anybody can do that anywhere, anytime :)  The important thing is what happens when I stick that memory card into the uIEC and access it with a Commodore!

Good news!  Both partitions show up with $=P, I can change to either partition with CP, and the files I copied (using Win ME), all show up.

So Commodore firmware beats Windows XP...  If anyone would care to report about multiple SD partitions using Win 7, I'd love to know...

Edit
For anybody who still has access to Win ME or Win 98 SE, the extra partitions seem like a good way to hide data from lame Win7 hackers... I imagine it would show up fine with Linux' Mount, but I fouled up my Linux system a few years back and haven't fixed it yet...
/Edit
I'm kupo for kupo nuts!

BigDumbDinosaur

I seem to recall from many moons ago that multiple partition support was deprecated by Micro$oft in the NT family of operating systems.  This is not so say that multiple partitions on a single disk aren't possible, only that the NT family has no good reason to support them.

Back in the olden days of MS-DOS, the use of multiple partitions was much more common due to limitations of the "final" (1987 version) FAT16 filesystem.  FAT16 could not address more than two GB of disk space, due to the limitations of the clustering storage that was (still is) used (the 1984 version of FAT16 could only address 32 MB of disk).  Also, recall that until Windows 95 OSR2, there was no 32 bit filesystem support (FAT32) in the DOS derivatives.  Even after FAT32 was introduced, Billy-ware continued to recognize extended DOS partitions.  As all NT filesystems are either 32 or 64 bits, there's no reason to use extended DOS partitions.

Incidentally, it's possible to install an NT operating system on a FAT32 filesystem, as support for FAT32 continues to be present to this day.
x86?  We ain't got no x86.  We don't need no stinking x86!

Hydrophilic

#2
Quote from: BigDumbDinosaur As all NT filesystems are either 32 or 64 bits, there's no reason to use extended DOS partitions.
Unless you want (or the Billy-ware requires) each OS to have a seperate partition.  The MBR only supports 4 partitions, so if you want more (for me, over a dozen) then you are required to used extended partitions.

More importantly, there are only 2 (primary) partitions on this test card, all listed in the MBR.  So extended partitions aren't really relevavent.

I was curious to test the limits of the uIEC firmware which seems to be designed to handle at least 16 partitions, but if I added all 16 (and they actually showed up in Windows) then the total number (on my PC) would exceed 26 ... error!

Ummm... maybe you are referring to memory cards in general and I am thinking of my HD in particular?  Well going back to memory cards, the two 2GB cards I have are formatted with FAT16, and the one 32MB card I have is formatted as FAT12 (to my surprise).  In other words, none of them use 32 bit nor 64 bit file systems; they are all DOS-type file systems; I have never seen a memory card in NTFS format, although I don't see why it couldn't be done...

Edit
Quote from: BDDAlso, recall that until Windows 95 OSR2, there was no 32 bit filesystem support (FAT32) in the DOS derivatives
That reminds me, I have found an NTFS driver (read-only) that I can use in DOS mode, or more importantly Windows 3.11, but I have yet to find a FAT32 driver for DOS 6.22.  I guess I could re-configure my Win3.11 partition to run under DOS 7.1, but would prefer to leave it as DOS 6 for historical reasons...

This is going a bit off topic... ooops!
/Edit
I'm kupo for kupo nuts!

bacon

Quote from: Hydrophilic on February 03, 2011, 04:47 AM
I imagine it would show up fine with Linux' Mount, but I fouled up my Linux system a few years back and haven't fixed it yet...
Yes, Linux handles SD cards just like a hard disk. Making several partitions is a snap with the graphical partition editors (Qparted, Gparted) that come standard on all modern Linux distros.
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.

brain

Quote from: Hydrophilic on February 03, 2011, 04:47 AM
Using a sector editor, I modified the MBR to have a second partion.  I also modified the boot record of the first partion to be smaller and added a second boot record for the remainder of the memory card.
Egad, kinda scary.  I'd recommend using "Windows Enabler" and then you can use the grayed out features in Windows NT.
Quote
Okay, so maybe Win2K drivers are out-of-date (it is 2011 by now), so lets give WinXP a try... Long story short: WinXP does the same crap... I don't have (an intend NEVER to have) WinVISTA.  Still debating Win7...
Windows NT-7 does not allow multiple partitions on removable cards.  In fact, the MBR stuff was added to the sd2iec codebase because uIEC supports HDDs (uIEC/IDE), which can have multiple partitions.  It will support up to 15.
Quote
Good news!  Both partitions show up with $=P, I can change to either partition with CP, and the files I copied (using Win ME), all show up.
As the author of the $=P code, I'm glad you found it useful.  It took some time to make it work correctly.

Jim

Hydrophilic

Quote from: brain
As the author of the $=P code, I'm glad you found it useful.  It took some time to make it work correctly.
Very useful, thank you!  In retrobution (word?), I took the time to be sure burst-load on the SD2IEC (uIEC) works with multiple partitions.  For example, CP2 (goto partition 2) but you can still burst-load from partition 1 with, for example, "1:filename" ... or vice-versa ...

Thanks for the info about NT7!  I'm still using WinME for my multi-part SD (to busy to fix my Linux partition).
I'm kupo for kupo nuts!