[U-Boot-Users] custom loadable command shell

Andrew Wozniak awozniak at mc.com
Thu Mar 30 18:45:55 CEST 2006


Jerry, all good suggestions.

Jerry Van Baren wrote:
> Andrew Wozniak wrote:
>> Hi,
>>
>> I've been contemplating how to develop a U-Boot loadable applet which 
>> provides a set of custom commands which augment the standard U-Boot 
>> command set. The general idea is to keep a working version of U-Boot 
>> in Flash without modifying - and then simply installing the new 
>> command applet as it changes.
>>
>> The applet would include a command parser. If none of my custom 
>> commands are found, a call to the U-Boot parser (via ABI) would be 
>> made to handle U-Boot commands.
>>
>> This is just a concept phase and I was hoping to get some opinions on 
>> the feasibility and obstacle of this approach.
>>
>> Thanks for all comments. Andy
> 
> Hi Andy,
> 
> My first thought is:
> * Make the command table in u-boot longer than necessary (pad it with 
> empty elements)

Assuming that the default table is allocated at build time, this makes 
sense. Change the default table to be dynamically allocated at runtime 
might be too much effort.

> * Add to the ABI so that your plug-in could either find the command 
> table and add its commands to the table or create an "add a command" ABI 
> call to add an extension command to the table (call repeatedly to add 
> multiple commands or pass in an extension table that gets added to the 
> standard table).

I was thinking more in the line of "add a local table" function.

> * Better alternative(?): add a "add an extension table" ABI with a 
> pointer to an extension table.  If the parser doesn't find the command 
> in the built-in table, it searches the add-on table (if provided). 
> Disadvantage: only one add-on table would be supported.

The tricky part would be telling the default parser when NOT to parse 
the local table when the plug-in (applet) is no longer present - such as 
when it exits back to UBoot, possibly due to some applet error.

This would have to be handled no matter what table extension method is 
chosen.

> Viola' instant extension commands.  This would have the advantage of 
> using the existing parser.
> 
> I have not looked very closely at how difficult it would be to do this 
> but it appears to be possible.
> * It would require an extension of the ABI.

Easy, done that before.

> * The commands are scattered through the code as macros.  Making 
> extension room may or may not be difficult.  A add-on table would be 
> simpler.

I'm just at the planning stage - will have a few beers while reviewing 
the source ;)

-andy

> * The command structure has pieces that are #ifdefed in and out... your 
> extension either has to match configurations or the "add a command" 
> routine would have to handle missing/extra pieces.
> 
> gvb
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live 
> webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 




More information about the U-Boot mailing list