public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Querying Loader from Kernel
@ 2009-06-29 19:00 Eric Bresie
  2009-07-01 16:55 ` H Hartley Sweeten
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Bresie @ 2009-06-29 19:00 UTC (permalink / raw)
  To: ecos-devel

Is it possible to query info from the loader (Redboot) from the loaded kernel?

I'd like to have Redboot version indicated in syslog or something to
confirm version details at both loader and kernel level.

With dmesg I see some indication of the mtd partitions but nothing
else beyond that.

Any ideas?

Eric

-- 
Eric Bresie
ebresie@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Querying Loader from Kernel
  2009-06-29 19:00 Querying Loader from Kernel Eric Bresie
@ 2009-07-01 16:55 ` H Hartley Sweeten
  2009-07-01 17:06   ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: H Hartley Sweeten @ 2009-07-01 16:55 UTC (permalink / raw)
  To: Eric Bresie, ecos-devel

On Monday, June 29, 2009 12:00 PM, Eric Bresie wrote:
> Is it possible to query info from the loader (Redboot) from the
> loaded kernel?
>
> I'd like to have Redboot version indicated in syslog or something
> to confirm version details at both loader and kernel level.
>
> With dmesg I see some indication of the mtd partitions but nothing
> else beyond that.
>
> Any ideas?

I'm not sure you can query the info from the kernel but maybe from
userspace.

You can use the fconfig utility to parse the mtd partition that
contains your Redboot config.  Create an alias in Redboot that has
the version information you need.  For example I set a serial number
on each of my boards as:

alias/SNUM: 0x27260017

Then use fconfig to read it:

/ #fconfig -r -d /dev/mtd3 -n alias/SNUM
0x27260017
/ #

Regards,
Hartley

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Querying Loader from Kernel
  2009-07-01 16:55 ` H Hartley Sweeten
@ 2009-07-01 17:06   ` Gary Thomas
  2009-07-01 17:17     ` H Hartley Sweeten
  0 siblings, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2009-07-01 17:06 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: Eric Bresie, ecos-devel

H Hartley Sweeten wrote:
> On Monday, June 29, 2009 12:00 PM, Eric Bresie wrote:
>> Is it possible to query info from the loader (Redboot) from the
>> loaded kernel?
>>
>> I'd like to have Redboot version indicated in syslog or something
>> to confirm version details at both loader and kernel level.
>>
>> With dmesg I see some indication of the mtd partitions but nothing
>> else beyond that.
>>
>> Any ideas?
> 
> I'm not sure you can query the info from the kernel but maybe from
> userspace.
> 
> You can use the fconfig utility to parse the mtd partition that
> contains your Redboot config.  Create an alias in Redboot that has
> the version information you need.  For example I set a serial number
> on each of my boards as:
> 
> alias/SNUM: 0x27260017
> 
> Then use fconfig to read it:
> 
> / #fconfig -r -d /dev/mtd3 -n alias/SNUM
> 0x27260017
> / #

Two things:
 * What is the 'fconfig' utility and where did you get it?
 * This only works for data stored in 'fconfig'  I think the
   original poster was interested in other data, such as the
   build version string, etc.  The best way to provide that
   would be to pass it to Linux during 'exec'.  The details
   depend on the architecture (e.g. PowerPC does things differently
   from how ARM works, etc)


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Querying Loader from Kernel
  2009-07-01 17:06   ` Gary Thomas
@ 2009-07-01 17:17     ` H Hartley Sweeten
  0 siblings, 0 replies; 4+ messages in thread
From: H Hartley Sweeten @ 2009-07-01 17:17 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Eric Bresie, ecos-devel

On Wednesday, July 01, 2009 10:07 AM, Gary Thomas wrote:
>>> Is it possible to query info from the loader (Redboot) from the
>>> loaded kernel?
>>>
>>> I'd like to have Redboot version indicated in syslog or something
>>> to confirm version details at both loader and kernel level.
>>>
>>> With dmesg I see some indication of the mtd partitions but nothing
>>> else beyond that.
>>>
>>> Any ideas?
>> 
>> I'm not sure you can query the info from the kernel but maybe from
>> userspace.
>> 
>> You can use the fconfig utility to parse the mtd partition that
>> contains your Redboot config.  Create an alias in Redboot that has
>> the version information you need.  For example I set a serial number
>> on each of my boards as:
>> 
>> alias/SNUM: 0x27260017
>> 
>> Then use fconfig to read it:
>> 
>> / #fconfig -r -d /dev/mtd3 -n alias/SNUM
>> 0x27260017
>> / #
>
> Two things:
>  * What is the 'fconfig' utility and where did you get it?
>  * This only works for data stored in 'fconfig'  I think the
>    original poster was interested in other data, such as the
>    build version string, etc.  The best way to provide that
>    would be to pass it to Linux during 'exec'.  The details
>    depend on the architecture (e.g. PowerPC does things differently
>    from how ARM works, etc)

I found the 'fconfig' as one of the packages in buildroot.  You can
get it here:

http://andrzejekiert.ovh.org/software.html.en

I agree this only works for data stored in 'fconfig' that's why I
suggested setting an alias for the needed information.

I'm not sure how you would pass the information to linux during
'exec'.  And, as you mentioned, whatever mechanism is used it will
probably not be portable between architectures.  I think with
ARM it would need to be passed as an ATAG.

It might be possible to create a kernel driver that parses the
kernel command line for some sort of information then creates a
sysfs entry containing that info or just spits it out for dmesg.
Not really sure...

Regards,
Hartley

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-01 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-29 19:00 Querying Loader from Kernel Eric Bresie
2009-07-01 16:55 ` H Hartley Sweeten
2009-07-01 17:06   ` Gary Thomas
2009-07-01 17:17     ` H Hartley Sweeten

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 read-only IMAP folder(s) and NNTP newsgroup(s).