Forum: UltraISO
Topic: What is byte differences between USB-ZIP and U-HDD
started by: steve6375

Posted by steve6375 on Aug. 27 2008,18:54
Hi
I am trying to find out what is the difference between a USB-ZIP drive and a USB-HDD drive in terms of the bytes in the MBR or BPB.
I have tried to convert one type into another without success.
Must the MBR partition start at sector 32 for USB-ZIP?
Must the descriptor in the BPB at offset 24h be 0 rather than 80h and Media Descriptor at 15h be F0h rather than F8h?

I have tried all of these and still I cannot seem to make a USB-HDD into a USB-ZIP and vice versa!
What am I missing?
Please help.
Thanks
Steve

Posted by xoben on Sep. 15 2008,09:41
USB-ZIP is in SuperFloppy mode, which has no MBR like USB-HDD.
Posted by steve6375 on Sep. 15 2008,15:04

(xoben @ Sep. 15 2008,14:41)
QUOTE
USB-ZIP is in SuperFloppy mode, which has no MBR like USB-HDD.

Hi
Ok, I think I have worked it out.

First, there are two type of USB flash drives, those that report themselves as removable media and those that report as non-removable media type (via Inquiry command).

BIOSes can use this to determine how to treat the drive.
In the case of USB-ZIP drives (removable media), they do have a MBR and partition table, but when booted to by some BIOSes, they appear as a large floppy with no MBR.
i.e. when viewed under XP with disk editor, LBA 0 is the MBR and ptn table, just like any other hard disk, but if you boot from it, once you have booted, the USB drive is only accessible via  Int 13h DL=0h (ie floppy drive Int 13h calls) and you can use extended mode (Int 13 AH=42h/43h) calls to access it. When you do then LBA 0 is actually the BPB/volume boot sector and not the MBR (i.e. the BIOS adds the number of reserved sectors onto the LBA address for you). Hence it appears as a large floppy drive.

The other thing BIOSes can do is look at some bytes in the BPB table of the FAT16 volume boot sector. Bytes 15h is F0h for floppies and F8h for HDDs. Also byte 24h is the drive number, this must be 00h for floppies or 80h for HDDs.

So when you format a UFD for FAT16, the program you use to format it can set these bytes accordingly. For instance, if you format a UFD as the 2nd drive, byte 24h might be set to 81h. If you try to boot from this UFD drive you will get an error. Set it to 80h and it will work.

If you set these type bytes to floppy (F0h and 00h) then you can only boot it as a USB-ZIP type. If you set them to HDD type (F8h and 80h) then you can boot it as HDD type (but this is not always the case!).

BUT  - some BIOSes have their own rules! They can boot removable media as HDD, or others can boot same media as ZIP (large floppy).

On some USB UFDs you can use the BootIt.exe program to change between removable media and non-removable media - this sometimes makes a flash drive work on some BIOSes. e.g. Lexar Jump drive can do this.


This explains why if you format a UFD as a removable drive and have F0h/00h for bytes 15h and 24h and use it to boot to WinPE v2 (which only supports a hard disk boot) then it does not boot.

I have written a Windows USB drive format program which partitions and formats USB flash drives for FAT16. It can alter these bytes and also put different boot code into the BPB sector (boot sector of volume). I have experimented with this to show different behaviours with different BIOSes.

So, if your BIOS is set to boot to USB-ZIP, then FAT16 sectors should contain F0h/00h bytes at 15h and 24h. If set to boot as USB-HDD then bytes should be F8h/80h.
Booting to DOS will report A:> or C:> depending on these bytes.

If you want to boot to WinPE v2, then set device to be non-removable if possible, but many BIOSes will boot a removable UFD as a hard disk.

I have had more success when formatted as FAT16 than when formatted as FAT32, so always use FAT16 if possible.

HTH
:D