From: Rob Landley <rob@landley.net>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: T Ziomek <ctz001@email.mot.com>,
David VomLehn <dvomlehn@cisco.com>,
linux-embedded@vger.kernel.org
Subject: Re: Some embedded topics
Date: Thu, 29 May 2008 12:31:10 -0500 [thread overview]
Message-ID: <200805291231.11529.rob@landley.net> (raw)
In-Reply-To: <8bd0f97a0805282121j10a99bb7ve92efc6a8dc8bbb1@mail.gmail.com>
On Wednesday 28 May 2008 23:21:52 Mike Frysinger wrote:
> On Wed, May 28, 2008 at 11:01 PM, Rob Landley wrote:
> > On Tuesday 27 May 2008 17:31:42 T Ziomek wrote:
> >> If I understand correctly David is talking about logging some trace-like
> >> info (so it exists before a HW watchdog expires), and having it
> >> somewhere "safe" from being disturbed by a HW reset.
> >
> > The standard way of doing this is to use the mem= kernel command line
> > parameter to tell the system it has less memory than it does, and using
> > what's left as a ramdisk. Years ago I saw some userspace thing running
> > as root mmap() /dev/mem (or whatever they're calling it these days) and
> > log to it. In theory you could even set the dmesg buffer up at the end
> > of physical memory with a smallish kernel patch, make it big, and set the
> > kernel to doing verbose printks.
> >
> > The trick is A) knowing the absolute physical address at which your debug
> > buffer lives so you can find it after the reboot, B) convincing the
> > system to do something useful with it on reboot rather than just
> > overwriting it with fresh log data.
>
> how about the fact that when the core resets, the memory controller is
> often reset as well ? that external memory is going to degrade. or
> do we just bite our thumb and weather the few random bit errors ?
> -mike
Mostly it isn't a problem because DRAM lasts longer than you think it does:
http://www.securityfocus.com/brief/686
Your memory controller init has to go out of its way to screw it up with a
memory test or some such. (That said, some of 'em do...)
The people who pioneered this stuff many moons ago were the big iron guys, and
when they had that kind of problem they'd use kexec to avoid going back
through brain-dead firmware that did stupid things to memory:
http://lwn.net/Articles/108595
This of course assumes you have spare ram for a while second kernel to sit
around and do nothing until you pass control to it to fetch your diagnostics.
Most embedded systems don't.
I'd probably start reading at http://lkcd.sf.net/doc/index.html if I wanted to
come back up to speed on this area. The "leave a bit of memory free at the
end with mem=" trick is the easy way to avoid having to include actual
_infrastructure_ for this stuff. If you have the memory budget for
infrastructure, there are people happily to deliver forklifts full...
This doesn't come up much for me. During development I put /dev/console on a
serial port and log stuff to that, so I still have it after the box has gone
south. By the time a device running from flash winds up in the end user's
hands, I usually don't even know who they _are_, let alone have enough of a
relationship with them that they'd want their appliance to spontaneously send
info to me even if it did start malfunctioning.
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
next prev parent reply other threads:[~2008-05-29 17:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <483C83DE.3040604@cisco.com>
[not found] ` <483C83DE.3040604-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2008-05-29 2:09 ` Some embedded topics Paul Gortmaker
[not found] ` <8bd0f97a0805271527i622a31b8t68ba24c80a2e034a@mail.gmail.com>
[not found] ` <20080527223142.GU26837@email.mot.com>
[not found] ` <20080527223142.GU26837-qbu1+ugcRq/by3iVrkZq2A@public.gmane.org>
2008-05-29 3:01 ` Rob Landley
[not found] ` <200805282201.48746.rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org>
2008-05-29 4:21 ` Mike Frysinger
[not found] ` <8bd0f97a0805282121j10a99bb7ve92efc6a8dc8bbb1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-05-29 5:38 ` Wolfgang Denk
2008-05-29 17:31 ` Rob Landley [this message]
2008-05-29 18:20 ` Mike Frysinger
2008-05-29 5:34 ` Wolfgang Denk
2008-05-29 9:31 ` Geert Uytterhoeven
2008-05-30 22:59 ` Tim Bird
2008-05-30 23:20 ` Jordan Crouse
2008-05-31 0:07 ` Josh Boyer
2008-05-31 13:32 ` Geert Uytterhoeven
[not found] ` <8bd0f97a0805271535w267be51fq669def9aa424e4e7@mail.gmail.com>
[not found] ` <840404080805280740q4486f377x49c106e20d9f5dc2@mail.gmail.com>
[not found] ` <840404080805280744t351da73fk885fa7b29c05659c@mail.gmail.com>
[not found] ` <483D7355.5050803@coritel.it>
[not found] ` <483D7355.5050803-5RgZt0ZUL+KonA0d6jMUrA@public.gmane.org>
2008-05-28 15:44 ` Fwd: " Joe MacDonald
2008-05-30 22:21 ` Tim Bird
2008-06-02 0:09 ` Rob Landley
2008-06-03 8:32 ` Marco Stornelli
[not found] ` <20080527173118.12ec691b@vader.jdub.homelinux.org>
[not found] ` <f608b67d0805271537m1b07e08y5dd84f7bbd8918cf@mail.gmail.com>
[not found] ` <20080527180200.56ffc588@vader.jdub.homelinux.org>
2008-05-30 22:36 ` Tim Bird
2008-05-31 0:04 ` Josh Boyer
2008-06-01 23:52 ` Rob Landley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200805291231.11529.rob@landley.net \
--to=rob@landley.net \
--cc=ctz001@email.mot.com \
--cc=dvomlehn@cisco.com \
--cc=linux-embedded@vger.kernel.org \
--cc=vapier.adi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).