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]

Re: Accessing flash memory


In message <20060124124212.GA22772@lunn.ch>, Andrew Lunn writes:
>The filesystem layout is generally the same as the package
>layout. Unformtunetely, it does not work for this example: for example
>in packages/net/bsd_tcpip/current/include/machine/types.h. Work your
>way up the path. In this case bsd_tcpip is the 'package'. However it
>is not called that.

>$ ecosconfig list | grep -i BSD
>Package CYGPKG_NET_FREEBSD_STACK (FreeBSD Stack):
> aliases: freebsd_net
>Package CYGPKG_NET_OPENBSD_STACK (OpenBSD Stack):
> aliases: openbsd_net

>It is the OpenBSD stack, so the package is freebsd_net. However, we
>don't recommend you just add freebsd_net. Instead use the net
>template.

Ah-hah!

So, in eCos, if only one subsystem is currently using a given "utility"
feature, it's part of that package.  For instance, there's gettimeofday
implementations in ppp and snmp.

>The other way is look at the .cdl file for the package. eg
>
>> Can this feature be added from ecosconfig, or do I have to go edit the
>> ecos.ecc file manually?

>I think you need to add the package fileio. However there could be
>other dependancies i cannot see from just this little section of cdl.
>So add fileio and then take another look the ecos.ecc file and see
>what it says. It is an iterative process.

Okay.

>That is not fully correct. the configtool is a replacement for
>ecosconfig and a text editor. I prefer to use a text editor where
>others prefer a GUI tool. There are lots of CDL options in a typical
>ecos.ecc file and i find emacs's search commands very useful and fast
>to use as opposed to scrolling around in a GUI.

Okay, that makes more sense.

>I guess you are missing the importance of CDL.  To some extend this
>information is already available. It is described by the different CDL
>files. You just need to learn to read the files. Rather than
>documentation, what might be more usefull is a tool which can extract
>the depedancy information and show it in a more eCos newbie readable
>way. Documentation is hard to maintain, where as CDL is definitive.

That makes some sense.

Okay, can you walk me through another one?  How do I get access to
gettimeofday()?  It's in snmplib, which has weird dependencies ecosconfig
isn't smart enough to discern or resolve.  Or it's in ppp.  So I do the
obvious thing; "ecosconfig add ppp".  No joy; there's still no gettimeofday.

Actually, I confess to being completely stumped by the question of where
gettimeofday actually lives.  TONS of files use it (unsurprising, given how
general it is), but the only definitions in .c files are in ppp and snmp.
The headers are even weirder; sys/time.h seems to have a definition, but it's
actually #if 0'd out.  There's references to it in the hal tree for the
"synth" target, but I'm not on one of those.  I found, in
net/tcpip/current/include/sys/syscallargs.h, the very curious:

	struct sys_gettimeofday_args {
	...

But I can't find corresponding code outside of the synth tree.

In short, I'm totally confused.  There's a "wallclock" device which provides
access to a hardware clock, but I can't find out how to get from that to,
well, any kind of user code I can write that'll access it, let alone just
the cheap system call.

I feel like there's some basic element of the approach to development on eCos
that's still eluding me.  I can't possibly be the first person ever to want
to port an app that uses gettimeofday(), so I assume it's POSSIBLE to use it.

(In fact, obnoxiously, I had a config that did that, and then trashed it due
to another error, not realizing there was anything special about it.)

-s

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