[U-Boot-Users] custom loadable command shell

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Tue Mar 28 23:06:50 CEST 2006


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

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




More information about the U-Boot mailing list