SD Card - boot sector
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > WebserverTalk Community > Data Storage > SD Card - boot sector




Pages (3): [1] 2 3 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SD Card - boot sector  
Peter Sommerfeld


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

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






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
larwe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

> 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?






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
psommerfeld@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

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






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
larwe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM


> 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/






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
Maxim S. Shatskih


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

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
maxim@storagecraft.com
http://www.storagecraft.com

"Peter Sommerfeld" <psommerfeld@gmail.com> wrote in message
news:1137006351.757006.163310@g43g2000cwa.googlegroups.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
>






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
Maxim S. Shatskih


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

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

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

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

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
maxim@storagecraft.com
http://www.storagecraft.com






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
larwe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM


Maxim S. Shatskih wrote:

> Windows does not support MBR and partitions on removable media, but requir
es
> 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.






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
larwe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM


Maxim S. Shatskih wrote:
> The card can have the MBR partition table. In this case, the boot sector i
s
> 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.






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
larwe


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM


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 bot
h
> 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.






[ Post a follow-up to this message ]



    Re: SD Card - boot sector  
Beverly Howard [Ms-MVP/MobileDev]


Report This Message To A Moderator Edit/Delete Message


 
01-14-06 07:46 AM

While I can't speak to the structure of the card itself, it's been my
observation that the card is only part of the equation... the reader
plays a bigger part with respect to "booting" devices and it's ability
to do so is dependant on both the computer's ability to boot from the
connection method and that computer's current bios configuration has to
be set to allow such a boot.

Of about half a dozen different usb card readers, I have two that show
up as usb boot devices on my system's boot selector menu and I have only
two computers out of about seven which offer the capability to boot from
usb devices... for example, my Sony Vaio Picturebook will boot via usb,
but it will only recognize one specific usb floppy drive as a valid boot
device.

With those two bootable SD readers, I can then use different boot
configurations stored on different SD cards to boot the pc.

Tip... disconnect all usb devices except a card reader and follow your
box's alternate boot steps... if the reader is bootable, it will show in
the boot device menu under an interesting variety of device names.

Beverly Howard [MS MVP-Mobile Devices]







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:40 AM.      Post New Thread    Post A Reply      
Pages (3): [1] 2 3 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register