Tech Support > Computer Hardware > Microprocessors > SD Card FAT support issues (dosfs, fatfs,fatlib)
SD Card FAT support issues (dosfs, fatfs,fatlib)
Posted by larwe on September 8th, 2006



David Brown wrote:

Impossible, this structure is not an internal thing; it's a logical
construct that generates structure out of a flat binary read of a
FAT/dir/MBR sector. Microsoft chose the field order


Posted by David Brown on September 10th, 2006


larwe wrote:
I was thinking about that possibility. However, that only has an effect
if you've got a structure like:

stuct {
uint8 byte1;
uint16 word1;
uint8 byte2;
}

If you are facing something like that, things are going to go wrong no
matter how you deal with it. If you use packed structs, you are going
to end up with non-aligned accesses, which can be a problem on some
targets. If you use non-packed structs, you'll get aligned accesses,
but it won't match the real structure.

Posted by larwe on September 10th, 2006



David Brown wrote:

I don't handle it that way, because (worse than the problem you
describe above) this is not endian-neutral. Take a look at the
structures in dosfs...


Posted by David Brown on September 11th, 2006


larwe wrote:
Ah, yes - endian differences. There's no end of fun to be had getting
these structures to work correctly! I seem to remember that Diab Data's
compilers had pragmas allowing you to specifically declare data as
little-endian or big-endian, and also as non-aligned - it would then
generate correct code for when you accessed the structure, regardless of
whether the endianness or alignment matched. If only other compilers
had the same sort of pragmas, your code would be a lot easier.


Posted by Peter Dickerson on September 11th, 2006


"larwe" <zwsdotcom@gmail.com> wrote in message
news:1157909783.631161.313910@e3g2000cwe.googlegro ups.com...
Its probably better in this case to use macros to define accessors. The
macros being there just to make the code more readable and self commenting.
There isn't any nice solution to this sort of problem for portable code.

Peter



Posted by Hans-Bernhard Broeker on September 11th, 2006


Peter Dickerson <first{dot}surname@tesco.net> wrote:

But of course there is: stop believing that C structs are meant to be
used as exact matches of externally defined data structures. They're
not. Use C structs for internal handling, but *only* interface them
to the outside world through a properly designed "serialization" layer
which handles the mapping from C integers to octets on the line or the
medium.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Posted by Peter Dickerson on September 11th, 2006


"Hans-Bernhard Broeker" <broeker@physik.rwth-aachen.de> wrote in message
news:4mlkj6F6o8lgU3@news.dfncis.de...
So we agree. There are solutions, but they aren't nice. :-)

Peter



Posted by Anton Erasmus on September 11th, 2006


On Fri, 08 Sep 2006 11:41:18 +0200, Dennis Greenwood
<dagwood@NOSPAMdagtronix.com> wrote:

Using the __attribute__((packed)) breaks the code generated using the
header files defined for the Philips LPC series which uses bitfields
to define the LPC hardware registers. Many of the small development
boards come with examples using these header files. In the GCC
documentation it also warns that code compiled with this attribute set
might not be binary compatible with code compiled without it.

Regards
Anton Erasmus

Posted by Isaac Bosompem on September 12th, 2006



larwe wrote:
of some sort?

-Isaac


Posted by Clifford Heath on September 12th, 2006


Isaac Bosompem wrote:
Where have you been for the last decade or so?

Posted by David Brown on September 12th, 2006


Clifford Heath wrote:
Perhaps he has been living in a country that still makes some attempt at
keeping patent laws rational, such as everywhere except the USA? Of
course, certain forces within the EU (i.e., big corporations) keep
trying to pervert the patent system here too.

Posted by Peter Dickerson on September 12th, 2006


"Isaac Bosompem" <x86asm@gmail.com> wrote in message
news:1158028096.034566.75900@i3g2000cwc.googlegrou ps.com...
I don't think that you can patent an algorithm, only its use. Clearly in
this case there its hard to separate the two though. The text of the first
patent talks about a computer system. Does that mean its OK if I'm not using
one? It may be difficult to convince a judge that my analytical instrument
is not a computer system. What if I never format the media? Here, the patent
relates to directory records and could apply to any 8.3 file system so the
formatting is probably a red herring. What if I never write the media,
perhaps I only want to read existing files? What if I want to open existing
files for write? I don't have to update the directory info at all unless I
change the length of the file or its starting cluster, and even if I do I
only need to update the original 8.3 FAT entry where the length is kept.

In fact, in my case, reading LFN but only writing 8.3 would get me most of
the way.

Murky stuff these patents.

Peter



Posted by Peter Dickerson on September 12th, 2006


"Peter Dickerson" <first{dot}surname@tesco.net> wrote in message
news:W2vNg.19722$7D6.5515@newsfe2-win.ntli.net...
Sorry to follow up on my own post but it appears that the legal problems of
LFN and FAT can be avoided by paying MS 25 cents a pop. For my situation,
where the numbers are small and the unit cost quite high its probably worth
it. Many, including me, may resent having to do that but I also resent
starving or being sued.

I have also had my attention directed towards commercial FAT support code
that has support for LFN. I'm still investigating that. I'm fairly sure it
can do what I want but I'm not clear whether there is more work integrating
with my other requirements than adding LFN to open/free/public code.

Peter



Posted by larwe on September 12th, 2006



Peter Dickerson wrote:

In the United States you can patent an algorithm.


Posted by Clifford Heath on September 13th, 2006


larwe wrote:
The way it's done is by describing the algorithm in terms of
the operation of a physical device with a descriptive title.
For example, you might refer to a computer as a "processing
unit" or somesuch, with a "computer" being a proffered example
of what a "processing unit" might be. The patent office accepts
the patent because it's described in terms of a physical
implementation, and the patent lawyers can then argue that an
offending implementation fits the descriptive titles. I'm not
really sure how other countries go about denying such claims...

Posted by larwe on September 13th, 2006



Clifford Heath wrote:

Mmm, I just finished writing an article about similar issues. Basically
my summary was:

a) IP issues are the biggest barrier to entry into the embedded
engineering market, and

b) The EU doesn't "do" software patents - bully for them - but the
definitions are so vague that the lawyers are kicking up their heels in
joy.


Posted by Peter Dickerson on September 13th, 2006


"larwe" <zwsdotcom@gmail.com> wrote in message
news:1158105301.023708.313780@h48g2000cwc.googlegr oups.com...
I see a significant difference between 'software' and 'algorithm'.
Ultimately I'm more interested in solving my problem than figuring out the
niceties of the patent system.

Peter



Posted by Chris Hills on September 13th, 2006


In article <TiCNg.12798$Mh2.9757@newsfe6-win.ntli.net>, Peter Dickerson
<first{dot}surname@tesco.net> writes
The problem is that you may have a conflict as you could not release the
source code with the commercial stuff in it. The Open source may require
you to release the modified code...

This is always the problem when using open source. One licence wants all
the adapted code to be released and the other says you can't....

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/




Posted by Chris Hills on September 13th, 2006


In article <1158111536.747511.157950@e3g2000cwe.googlegroups. com>, larwe
<zwsdotcom@gmail.com> writes
How so?
There are VERY many patents in the electronic and embedded world... CD
and DVD's for a start... hasn't stifled them.

The EU couldn't do SW patents because there is a reciprocal agreement
with the US on patents. As soon as the EU had them all the US ones
would apply in the EU...... Not a good idea.

For example an EU company could show that it invented the system years
before a US company took the patent.... The EU company probably would
not have known about the later US patent . What then?




--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ chris@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/




Posted by Peter Dickerson on September 13th, 2006


"Chris Hills" <chris@phaedsys.org> wrote in message
news:+clV7kBK37BFFABl@phaedsys.demon.co.uk...
Actually, in the case of FatFS the terms are "You can use, modify and
republish it for non-profit or profit use without any limitation under your
responsibility". Not that I necessarily want to do that. I think that if I
do make use of such code I should at least give something back in return.
That might only be providing help and assistance to others who go that
route, or it might mean releasing some code. In any case the company I'm
working for have their own views, such as wanting there to be someone to
blame when things don't work. Buying in a solution means there is someone
other than me available for that role, and there is someone who can provide
support when I'm hit by a truck. A file full of source code is only a small
part of the story.

It seems DosFS has a similar, though more wordy, license.

Peter




Similar Posts