This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

IDE + fatfs issues


I have a couple of questions about the implementation "rules" that are
checked on both IDE and fatfs "devices".

IDE:
On or about line 372 of ide_disk.c within function ide_disk_init()
after identifying the disk, the "Type" is verified:
    if (((ide_idData->general_conf>>8)&0x1f)!=2) {
        diag_printf("IDE device %d:%d is not a hard disk!\n",
                    info->port, info->chan);
        return false;
    }
I'm not sure where to look up the specifications for this. But my 8MB
compact flash reports a "type" of 4, not 2. (If this is platform
dependent, the board is a GE VMIVME7750. I use a standard PC
configuration with some home grown VME logic.) I can hack up this to
work. But I don't know if there is a more general way to perform this
test. I am open to suggestions for a solution. I would like to get _a_
solution into the main repository so I will not have to make this
"hack" in the future.

fatfs:
On or about line 1885 of fatfs_supp.c within function fatfs_init()
after reading the boot record, a number of fields are validated:
    // Check some known boot record values
    if (0x29 != boot_rec.ext_sig       ||
        0x55 != boot_rec.exe_marker[0] ||
        0xAA != boot_rec.exe_marker[1])
        return EINVAL;

I believe the first test is not always valid. On my Compact Flash
card, formatted with FreeDOS v0.9 beta, this field is 0x00. According
to Microsoft's documentation for fatfs, Windows NT requires this to be
either 0x28 or 0x29. I found other documentation that states that if
it is 0x29, then the next 3 fields are valid, but 0x00 was also valid.
As a temporary fix, I just hacked out the first check. I can submit a
"true" patch for this if requested. But I thought I would look for
some opinions first.

Thanks
David Brennan

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]