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


On Tue, Jan 24, 2006 at 06:54:31AM -0600, Peter Seebach wrote:
> 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.

You have old sources. That was moved into the POSIX package in
October.

gettimeofday is a funny function anyway. It is only recently added to
the POSIX standard, which is why it was not part of the POSIX package
in the first place. The POSIX package was based on an older version of
the standard which did not have gettimeofday.

> Okay, can you walk me through another one?  How do I get access to
> gettimeofday()?

rm -fr your source tree. Then take a look at:

http://ecos.sourceware.org/anoncvs.html

You should update your source code to the latest version. Then make
sure you have the POSIX package active. If you are using the net
template it will be included. If you were using the default template
you probably want to swap to the POSIX template.

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

Once you do have gettimeofday() and if you have a wallclock driver,
the time returned by time and gettimeoday should be "correct",
assuming your battery is not flat etc. You might have to take care of
timezones though.

        Andrew

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