Re: Pretec CF-cards and FAT!



There are nothing but text at offset 0x1BE. Text range is about 0x1A1-0x1F3.

If I compare working card to not working card, there are differences only at
offset 0x20 and offsets 0x27-0x2a.

At offset 0x0E can be found the sector number where is FAT-table (these
cases sector number 8).

I took screen captures from sector 0 at both cards. But I don't know can I
send binaries here. So they can be found few days from the address (PNG
files, about 75kB each):

Pretec:
http://s49.yousendit.com/d.aspx?id=13YGBHW0BSU2G11MCOFUQ9WCRY

Sandisk:
http://s49.yousendit.com/d.aspx?id=22TYPZLKYZ15P0GZBDHKREMJED

If you can't get them, send to my email your valid email address and I will
send them straight to you.

Thanks, Janne


"Ten" <nospam@xxxxxxxxxxxxxxxxxxx> wrote in message
news:WiEPe.13746$PM3.1074@xxxxxxxxxxxxxxxxxxxxxxx
> For the 0xEB case, the first entry in the partition table (offset 0x1BE)
> will point to the sector that contains the MBR. The MBR contains the BPB
> which defines where the FATs are located and other important file system
> parameters. For the 0xFA case the BPB starts at offset (in sector 0)
> 0x0B. From the look of your output, it appears the driver is expecting to
> find a BPB in sector 0 instead of following the partition chain.
>
> I have a CF that has a similar sector 0 to yours. It has 0xFA in byte 0,
> no BPB, and a partition table at 0x1BE. So this is a hybrid confiruation.
>
> Apparently CE 4.2 is OK with this. One way to fix the driver is to have
> it check for the existence of these tokens in what it thinks is the BPB:
>
> At offset 0x15 the value should be 0xF8.
> At offset 0x36 - 0x3D there should be a left justified string that
> conatins the type of file system. Usually this is FAT12, FAT16, or FAT32.
> This string should be padded with spaces on the right.
>
> If these don't exist, jump to offset 0x1BE and read the first partition
> table entry. This will provide a sector offset to another sector. Jumpt
> to that sector and check for the MBR again.
>
> Nick.
>
>
> Ken Christensen wrote:
>> 0xEB is a valid PBR entry for a non-bootable disk. 0xFA is the first byte
>> of an MBR. Note that these are x86 instruction codes. The rest of the
>> records define the disk geometry. Your driver may be looking for an MBR
>> to use in identifying where the FAT is located and the configuration of
>> the file system. If this is the case, you would need a flash disk with an
>> MBR, or fix the CF driver to recognize the non-bootable, but properly
>> formatted CF cards.
>>
>>
>> "Rautiainen" wrote:
>>
>>
>>>Thank you for the answer guys.
>>>
>>>I read the raw data from the card and the byte 0 in sector 0 is 0xEB.
>>>That's correct, am I right?
>>>
>>>I've got two pretec cards so I don't think that the problem is corrupted
>>>card.
>>>
>>>Could it be possible that 0xFA is some kind of error number?
>>>
>>>
>>>"Ten" <nospam@xxxxxxxxxxxxxxxxxxx> wrote in message
>>>news:DLjPe.11982$PM3.1984@xxxxxxxxxxxxxxxxxxxxxxx
>>>
>>>>I'd use Hex Workshop because it has templates you can overlay on raw
>>>>disk sector data to decode the information. This works nicely on MBR
>>>>and PBRs (Master Boot Records and Partition Boot Records).
>>>>
>>>>If you use hexworkshop you need these mods to see the boot record
>>>>correctly.
>>>>
>>>>In the file C:\Program Files\BreakPoint Software\Hex Workshop
>>>>4.0\Structures\standard-types.hsl, change #pragma maxarray(128) to
>>>>#pragma maxarray(512).
>>>>
>>>>In the file filesystem.hsl, change the MBR structure to look like this:
>>>>// MBR
>>>>struct MASTER_BOOT_RECORD
>>>>{
>>>> UBYTE BootCode[128] ;
>>>> UBYTE BootData[130] ;
>>>> UBYTE Junk[188] ;
>>>> PART_ENTRY partitions[4] ;
>>>> WORD EndOfSectorMarker ;
>>>>} ;
>>>>
>>>>When you are in Hex Workshop, put the cursor at the beginning of the
>>>>sector.
>>>>
>>>>In the right pane, open a the filesystem library then add (the plus
>>>>sign) the structure overlay that you want.
>>>>
>>>>By the way 0xFA as the byte 0 in sector 0 is valid. CE 4.2 does not
>>>>complain about this.
>>>>
>>>>
>>>>
>>>>
>>>>Ken Christensen wrote:
>>>>
>>>>>Hello,
>>>>>I suggest gettting a raw card reader for your desktop something like
>>>>>Winhex. Take a look at the first sector and see if it has a valid MBR
>>>>>or PBR. WinCE and for that matter XP do not write an MBR onto CF. If
>>>>>yours is corrupt, then you will have to find a way of getting that
>>>>>section re-built. There were some freeware utilities on the net, google
>>>>>for them. Really though you should only need the BPB from the boot
>>>>>record to point to the partition table so you could just create one
>>>>>with winhex.
>>>>>
>>>>>
>>>>>"Rautiainen" wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Hello all,
>>>>>>
>>>>>>I've having problems with Pretec's industrial grade CF-cards and CE
>>>>>>3.0. Processor is PPC823. Cards are found but and initialized but CE
>>>>>>cannot understang the filesystem. CE always says asks to format the
>>>>>>card. I click 'format', no error comes to screen. Explorer founds
>>>>>>'Storage Card', but it cannot be write. I've tried to format the cards
>>>>>>with XP (FAT16, I even tried FAT32), it won't work either in CE.
>>>>>>
>>>>>>Other question: Is there any other industrial grade flash card
>>>>>>amnufacturers than Pretec? Sandisk doesn't make industrial grade cards
>>>>>>anymore.
>>>>>>
>>>>>>Thanks, Janne
>>>>>>
>>>>>>Some debug information:
>>>>>>
>>>>>><...>
>>>>>>
>>>>>>0x80f17cbc: PCMCIA:CallClientISR - returned from Client ISR
>>>>>>0x80f17cbc: PDCardReadAttrByte Address: 410200 Offset: 1 Data: 80
>>>>>>0x80f17cbc: PDCardWriteAttrByte Address: 410200 Offset: 1 Data: 80
>>>>>>0x80f17cbc: PCMCIA:IREQInt - Calling InterruptDone
>>>>>>0x80ea24dc: ATADISK:ATAWaitForDisk - ata_status = 0x58
>>>>>>0x80ea24dc: ATDISK:DoDiskIO done - status=0
>>>>>>0x80ea24dc: FATFS!MountDisk: BPB_HiddenSectors(-973207947) != 0
>>>>>>0x80ea24dc: FATFS!InitVolume: sector 0 byte 0 suspicious (0xfa)
>>>>>>0x80ea24dc: FATFS!InitVolume: invalid BPB, volume deemed invalid
>>>>>>0x80ea24dc: No cache has been setup !!!
>>>>>>0x80ea24dc: ATADISK:GetFolderName - RegQueryValueEx(Folder) returned
>>>>>>87
>>>>>>0x80ea24dc: FATFS!GetDeviceValue(DSK2:):
>>>>>>DriverKey='Drivers\PCMCIA\ATADisk', ActiveKey='Drivers\Active\20'
>>>>>>0x80ea24dc: FATFS!GetDeviceValue(DSK2:):
>>>>>>RegQueryValueEx(HKLM\Drivers\PCMCIA\ATADisk\Folder) failed (87)
>>>>>>0x80ea24dc: FATFS!RegisterVolume: successfully mounted volume
>>>>>>0x000c3848 as Storage Card
>>>>>>0x80ea24dc: FATFS!FATUIEvent(0x50134): Would you like the system to
>>>>>>format the Storage Card folder so that the system can use it?
>>>>>>WARNING: If you select Yes, any files in the Storage Card folder will
>>>>>>be erased!
>>>>>>0x80eb6e28: NOTIFICATION::XCeEventHasOccurred
>>>>>>0x80eb6e28: NOTIFICATION::HandleSystemEvent 7 /ADD DSK2:
>>>>>>
>>>>>><...>
>>>>>>
>>>>>>
>>>
>>>


.


Quantcast