Hi Joe, On Mon, 19 Dec 2011 23:16:20 +1300 IVP wrote: > >The thing is, you see, I bought two of this particular card. Card #1 >went into my camera, Card #2 I use for dsPIC file storage > >Card #2 I formatted in a card reader, its MBR ended up in sector 0. >It works perfectly and I can read any file saved to it with a PC=20 >Card #1 was formatted by the camera and its MBR is (apparently) >at sector 0x2000 I think you are mixing up terms here, which would make unsterstanding and answering the actual question a bit difficult ... The sector you are looking for is the Partition-Boot-Sector (PBR),=20 which holds the FAT specific boot and layout information. The MBR is the Master-Boot-Sector, which holds boot-code plus a table with FOUR possible partitions on the medium. Your card #2 is a card WITHOUT partitioning (no MBR) with the PBR in the very first sector. Often called 'large floppy format' since that is what the classical floppy disks used to have. Your card #1 is card with a partition table in the MBR, which is the first = sector, and the first partition table entry points you to sector 0x2000 where the partition starts, and the PBR for the FAT filesystem should be ... >It really puzzles me. Frhed, if dd has made a good file, shows clearly >that the MBR is at sector 0x2000 and yet that sector, as can be seen >in the analyser trace, appears to be full of zeroes. The transition from >high to low right under the first 0 of '0000 2000' is the 0xfe token, so >there's no mistake that what follows is data, and that should be the >'ex.MSDOS5.0' etc string, not zeroes This string signature (which can have many other contents not just MSDOS) represents the 'creator' of the filesystem, it is probably wiser to check f= or the string at offset 0x36, which should start with uppercase 'FAT'. See the start of a FAT boot sector below, created by something else than MS= DOS: ++++++++++++ 00000- eb 44 90 44 46 53 65 65 38 2e 78 00 02 40 01 00 [.D.DFSee8.x..@..] 00010- 02 00 02 00 00 f8 00 01 3f 00 f0 00 3f 00 00 00 [........?...?...] 00020- 11 e8 3f 00 80 00 29 08 ea d9 48 44 65 76 65 6c [..?...)...HDevel] 00030- 6f 70 20 20 20 20 46 41 54 20 20 20 20 20 00 00 [op FAT ..] ++++++++++++ It has the creator signature 'DFSee8.x' instead of 'MSDOS5.0' Of course this does not help you with finding out why reading that sector 0= x2000 does not seem to work, but it may help in the discussion ... One other thing that may go wrong in some cases, you seem to be checking the very first byte of the first sector being ZERO to determine wether it i= s an MBR sector with partition tables or a FAT-PBR. That is NOT very reliable, although it may work on many SD cards. But many MBR sectors DO have (PC) executable code there, often starting wit= h a JUMP instruction.=20 You need somewhat more sophisticated checks to see if it is an MBR. Regards, JvW Jan van Wijk, author of DFSee; http://www.dfsee.com ---------------------------------------------------------------------------= ---- --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .