A computer components & hardware forum. HardwareBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » HardwareBanter forum » General Hardware & Peripherals » Storage & Hardrives
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

SD Card - boot sector



 
 
Thread Tools Display Modes
  #1  
Old January 11th 06, 07:05 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

Hi guys,

I am finding that reading the raw data off an SD in my embedded, that
the boot sector is not actually at address 0, but differs from card to
card (ie. my 64 MB has the boot sector at 4E00, and my 128 MB at C600).

Everything else before this is read as 0's.

I am not using any of the secure stuff on the card, just plain-old SPI.
I verifed I am reading the exact values vs. WinHex on a PC and card
reader.

Can anyone provide insight into this? Is there some non-readable secure
stuff on SD cards before the boot sector? Any ideas where I get more
info on this? (I have tons of info on the FAT field descriptions, etc
already).

Thanks!

-- Pete

  #2  
Old January 11th 06, 07:28 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

I am finding that reading the raw data off an SD in my embedded, that
the boot sector is not actually at address 0, but differs from card to
card (ie. my 64 MB has the boot sector at 4E00, and my 128 MB at C600).


What boot sector are you talking about - the DOS boot sector (first
sector of the FAT volume) or the MBR?

  #3  
Old January 11th 06, 08:20 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

It's the one where the 1st byte is EB and offset 3 in the sector has
the string "MSDOS5.0" on my FAT32-formatted card. I apolozige for not
knowing the correct term, but it must be the DOS boot sector?

-- Pete

  #4  
Old January 11th 06, 08:25 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector


It's the one where the 1st byte is EB and offset 3 in the sector has
the string "MSDOS5.0" on my FAT32-formatted card. I apolozige for not
knowing the correct term, but it must be the DOS boot sector?


That's the LBR. Removable flash media are formatted as hard disks. They
have an MBR (partition table) at sector 0. If you formatted the card on
Windows the MBR is probably set up so that the first partition is at
cylinder 0 head 1 sector 1 (i.e. you lose the first track on the disk).

Look at my DOSFS code for information on the MBR format and C code to
work out the start of the partition. http://www.zws.com/products/dosfs/

  #5  
Old January 11th 06, 11:21 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

The card can have the MBR partition table. In this case, the boot sector is
usually sector 63.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation

http://www.storagecraft.com

"Peter Sommerfeld" wrote in message
oups.com...
Hi guys,

I am finding that reading the raw data off an SD in my embedded, that
the boot sector is not actually at address 0, but differs from card to
card (ie. my 64 MB has the boot sector at 4E00, and my 128 MB at C600).

Everything else before this is read as 0's.

I am not using any of the secure stuff on the card, just plain-old SPI.
I verifed I am reading the exact values vs. WinHex on a PC and card
reader.

Can anyone provide insight into this? Is there some non-readable secure
stuff on SD cards before the boot sector? Any ideas where I get more
info on this? (I have tons of info on the FAT field descriptions, etc
already).

Thanks!

-- Pete


  #6  
Old January 11th 06, 11:25 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

That's the LBR. Removable flash media are formatted as hard disks.

Usually. This depends upon its controller firmware, whether it reports itself
as removable media or not.

If not - then it will have MBR, and will have the "hard disk" icon in Windows.

If yes - it will have no MBR (boot sector at sector 0) and will have the
"diskette drive" icon in Windows.

Windows does not support MBR and partitions on removable media, but requires
the partition table (MBR, GPT or Dynamic Disk) on a non-removable media.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation

http://www.storagecraft.com

  #7  
Old January 11th 06, 11:51 PM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector

"Maxim S. Shatskih" wrote in message
...
That's the LBR. Removable flash media are formatted as hard disks.


Usually. This depends upon its controller firmware, whether it reports
itself
as removable media or not.

If not - then it will have MBR, and will have the "hard disk" icon in
Windows.

If yes - it will have no MBR (boot sector at sector 0) and will have the
"diskette drive" icon in Windows.

Windows does not support MBR and partitions on removable media, but
requires
the partition table (MBR, GPT or Dynamic Disk) on a non-removable media.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation

http://www.storagecraft.com


Sometimes removeable media come with the MBR / partition table and so
formatting will retain will retain the MBR. However if the disk is
subsequently damaged then windows will totally reformat the disk, with no
MBR and the dos boot sector as sector 0. It is worthwhile checking for both
instances. I do this by checking if the first byte of sector 0 is 0xEB.

Ross


  #8  
Old January 12th 06, 01:18 AM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector


Maxim S. Shatskih wrote:

Windows does not support MBR and partitions on removable media, but requires
the partition table (MBR, GPT or Dynamic Disk) on a non-removable media.


In a practical sense: all embedded systems that I have seen (cameras,
mainly) that use removable media will format it as a hard disk. I
suspect that most media playback devices would not recognize a "big
floppy" flash disk. Some flash media specifications explicitly require
an MBR (SSFDC comes to mind).

All the USB adapters I've used - which is many different types - cause
Windows to format cards with an MBR. As a matter of interest, the units
I have also report as removable to Windows.

It's safe to say that anybody who doesn't format flash media with an
MBR is being a maverick.

  #9  
Old January 12th 06, 01:20 AM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector


Maxim S. Shatskih wrote:
The card can have the MBR partition table. In this case, the boot sector is
usually sector 63.


That's an amazingly broad generalization, broad to the point of being
dangerously wrong. It depends entirely on the size of the card -
because it's determined by the reported CHS geometry of the card,
presumably for legacy FDISK reasons. The LBR is generally _one track_
away from the MBR.

For the specific sizes of SD card you've used in recent times, maybe
spt was always 63.

The OP's post clearly shows that your generalization isn't even true
for the cards he happens to have lying about.

  #10  
Old January 12th 06, 01:23 AM posted to microsoft.public.pocketpc,comp.arch.embedded,comp.arch.storage
external usenet poster
 
Posts: n/a
Default SD Card - boot sector


Ross Marchant wrote:

Sometimes removeable media come with the MBR / partition table and so
formatting will retain will retain the MBR. However if the disk is
subsequently damaged then windows will totally reformat the disk, with no
MBR and the dos boot sector as sector 0. It is worthwhile checking for both
instances. I do this by checking if the first byte of sector 0 is 0xEB.


What kind of interface were you using to access the drive?

I just did the following: On a linux box:

dd if=/dev/zero of=/dev/sda bs=512 count=100

then using the inbuilt O2Micro SD reader slot in my laptop, reformatted
the card in Windows. The resulting card had an MBR with one partition
(not marked active).

So I don't think it's as consistent as this.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mbr for 40G harddrive? *selah* Storage (alternative) 60 July 12th 05 02:27 PM
FS printers/parts trays, printheads -- oki fujitsu dl3700 dl3800 hp genicom epson ibm dec jetdirect laserjet lexmark qms okidata microline 320 ml320 393 tally printronix tektronix qms toshiba zebra otc ibm intermec 7755 boul st laurent montreal ca cisco Printers 2 May 22nd 05 02:05 AM
FS PRINTER PARTS trays fusers drums printheads -- oki fujitsu hp genicom epson ibm dec jetdirect laserjet lexnmark qms okidata ml320 mannesmann tally printonix tektronix qms toshiba zebra otc ibm lexmark intermec dec compaq montreal canada toronto o [email protected] Printers 2 May 8th 05 09:58 PM
Help moving data and boot sector to diffferent hard drive Ross Meador Storage (alternative) 7 February 10th 05 04:24 PM
Upgrade Difficulties Ron B Gateway Computers 0 February 14th 04 03:26 AM


All times are GMT +1. The time now is 12:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 HardwareBanter.
The comments are property of their posters.