This is the mail archive of the ecos-devel@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: Querying Loader from Kernel


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]