SD Card - boot sector

This is true, but the reported numbers exist anyway and are visible at the int 13h level if nowhere else.

I presume that some USB devices support int 13h type access emulation then. Also note that PCMCIA adapters (all that I have tested, anyway) appear at the int 13h level. While I was developing my first DOS filesystem many moons ago for digital picture frames, I had to use PCMCIA adapters to check my work, because the USB adapters only gave me int 25/26h level access.

I repeat: 63 sectors is a generalization and given that we are messing with data storage devices, a dangerous one. Please don't let your

63-sector-track assumption stomp on my storage media - let me know what embedded devices you are involved with building, so I can avoid them.

Are you telling me that if I have two partitions on a CF card, and I accidentally damage the logical structure of the first one, Windows will silently blow away the second partition if I reformat the card? Marvelous.

Reply to
larwe
Loading thread data ...

Yes, looked at Disk driver source - Windows supports MBR on removable media, but uses only the very first valid partition off it.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Reply to
Maxim S. Shatskih

Windows cannot support more then 1 partition on removable media.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Reply to
Maxim S. Shatskih

First, I was mistaken. MBR is supported on removable media. But only 1 partition is used on it. Look at Disk driver source from the DDK (if you have one).

Second, do not mix removable _media_ and removable _device_. USB and 1394 disks are fixed-media removable devices. Iomega ZIP USB is a removable media (special diskettes) removable device.

Most USB flash drives are emulating the removable media - the USB diskette drive with the diskette glued to it forever. But some old USB flash drives emulate the real USB-attached hard disk.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Reply to
Maxim S. Shatskih

I'm speaking about what Windows uses. If the disk is not in BIOS - then yes, H=255 S=63.

Anyway CHS are obsolete, and I think that all modern OSes will work fine the the MBR disk where the next partition starts at physical sector 1 (not skipping a track).

More so. Linux runs fine with complete junk in CHS values in MBR entries.

All IO requests to disk are long ago going using LBA, both int 13h and native (using the OS's driver).

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
Reply to
Maxim S. Shatskih

Ok, so if the MBR is effectively obsolete on removable media under Windows, which explains my findings, what is the best method for determining the equivalent 'CHS' and partition information from the USB disk?

Thanks, Alex

Reply to
alexbohner

Once more - in Windows, if the disk is not registered in BIOS, then H=63 and S=255. Also, if the disk is registered in BIOS as LBA, then once again - H=63 and S=255 by definition.

CHS values are no more used for IO since around 2000, neither in Windows nor in Linux. Their only use is to fill the obsolete MBR values. BTW, Linux boots and works fine with nonsense CHS values in the MBR :-) it was Linux kernel 2.2.

Why do you ever need CHS? It is absolutely sure that, for a flash drive, they are fake, used only to satisfy MS-DOS. All real IO is done using LBA.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

 wrote in message
news:1138021986.336106.86960@g43g2000cwa.googlegroups.com...
> Ok, so if the MBR is effectively obsolete on removable media under
> Windows, which explains my findings, what is the best method for
> determining the equivalent 'CHS' and partition information from the USB
> disk?
>
> Thanks,
> Alex
>
Reply to
Maxim S. Shatskih

Thanks for the clarification. I think I jumped the gun and didn't ask the proper questions to resolve the problem.

- Assuming H=63 and S=255, will the calulated disk size always be correct when using the cylinder count found with IOCTL_DISK_GET_DRIVE_GEOMETRY?

- Can a RemovableMedia hold multiple partitions? If there is no MBR, yet it works fine in both Linux and Windows machines I'm not sure how this would be handled?

- Is it possible for a RemovableMedia device (or partition) to be set active (bootable) like a fixed disk?

- Without an MBR, what is the proper method for reading the partition information from the disk (eg, type, size, sectors, etc)?

Thanks, Alex

Reply to
alexbohner

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.