There is obviously a way to create a bootloader that boots from USB
stick. But is there a general rule how to accomplish this? I know that
a stick might be emulated as a HDD or as a Floppy. But does it work
everytime .. are there any official specifications on how to do this,
or how the BIOS probes if a USB stick is bootable?
and I got questions as well...
The main thing for a HD-image is the 512 byte MBR (very first sector):
000 ... 19Fh your start code
1A0 ... 1BD best left free because windoze may write here...
1BE 1.partition entry
1CE 2.
1DE 3.
1EE 4.
1FE AA55h
Partition entries:
00h boot indicator 80h = active only one can be active
01h 3 byte partition start (CHS-format)
04h partition type (OS-indicator)
05h 3 byte partition end (CHS-format)
08h dword partition start sector offset (relative to this sector)
0Ch dword partition size (in sectors)
The BIOS loads the first 512 bytes of any drive to 0:7c00
(or equivalent) and usually don't care about partitions and where
they point to, so interpretation of partition entries is job of
your start code.
But I daubt that an active entry (80h) will indicate a HD
instead of a FD.
Most FD-bootcode start with 'EB nn 90'h, while MBRs dont start
with a jump.
HD,CD/DVD drives report their abilities to the BIOS/OS over an
Identify-Device block, I can't tell how/if an USB-stick responds
to an ID-command. Seems to be the job of the emulator... ??
__
wolfgang
The basic info I have I posted in your thread on comp.lang.asm.x86.
Wolfgang seems to have confirmed what I recalled about Windows overwritting
certain bytes.
The ATA-7 draft mentions: "ATAPI for Removable Media (SFF8070i)". The USB
Mass Storage Class mentions subclass 0x05 or SFF8070i for floppy. However,
a webpage states that the typical USB stick reports as USB class 08,
subclass 06 (SCSI)...
I'm not completely sure any of the following apply. Your going to have to
search via Yahoo or Google for these since I don't have any current links.
I looked for some, but didn't immediately find any valid ones. So, this may
be a little bit of work. If you really, really, really, can't locate one -
like after six solid hours of searching, I'll try to help you find a link.
Although I found copies on the Internet, I'm not going to .zip them up and
send them to you since they are copyrighted.
"SFF-8070i Specification for ATAPI Removable Rewritable Media Devices"
INF-8070.pdf
"Universal Serial Bus Mass Storage Specification For Bootability"
usb_msc_boot_1.0.pdf
"Universal Serial Bus Mass Storage Class Specification Overview"
usbmassover_10.pdf
usb_msc_overview_1.2.pdf
"Universial Serial Bus Mass Storage Class Control/Bulk/Interrupt (CBI)
Transport"
usb_msc_cbi_1.1.pdf
HTH,
Rod Pemberton
USB storage is usually SCSI over USB, but there is a simplified floppy-only version.
Visit www.usb.org and read the USB storage spec there.
--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com