custom loadable command shell
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
Quoted 8 lines · Andrew Wozniak
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.
Quoted 8 lines
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
Quoted 4 lines · In message <[email protected]> you wrote:
My first thought is:
* Make the command table in u-boot longer than necessary (pad it with empty elements)
No need to do that. Just read the docs.
Quoted 4 lines
* 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.
No need to do that. Just read the docs.
Quoted 2 lines
I have not looked very closely at how difficult it would be to do this but it appears to be possible.
More, it already has been done.
Quoted 1 line
* It would require an extension of the ABI.
Wrong.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Hegel was right when he said that we learn from history that man can never learn anything from history. - George Bernard Shaw
Jerry, all good suggestions.
Quoted 16 lines · Jerry Van Baren
Quoted 15 lines · Andrew Wozniak
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.
Quoted 7 lines
Quoted 1 line
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.
Quoted 5 lines
* 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.
Quoted 4 lines
* 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.
Quoted 6 lines
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.
Quoted 3 lines
* 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
Quoted 18 lines
* 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
Hi Andy,
Quoted 3 lines
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.
If it has its own parser, sounds like a standalone app is all that you need -- which is already supported.
Regards,
--Scott
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines
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.
If it has its own parser, sounds like a standalone app is all that you need -- which is already supported.
No new parser is needed at all.
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"He only drinks when he gets depressed." "Why does he get depressed?"
"Sometimes it's because he hasn't had a drink."
- Terry Pratchett, _Men at Arms_Quoted 6 lines · In message <[email protected]> you wrote:
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.
No problem to do this. There are already several boards which do this.
Quoted 3 lines
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.
No need to implement a new parser. The existing one deals perfectly fine with such a requirement. Just read the documentation.
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de They say a little knowledge is a dangerous thing, but it is not one half so bad as a lot of ignorance. - Terry Pratchett, _Equal Rites_
Hi,
Quoted 7 lines · in message <[email protected]> I wrote:
Quoted 4 lines
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.
No need to implement a new parser. The existing one deals perfectly fine with such a requirement. Just read the documentation.
Argh... sorry. Wrong answer. This has not been implemented yet, so you do need your own parser for now.
I apologize - too little sleep and/or too much beer.
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Every time history repeats itself the price goes up.