Skip to main content.
Navigation:
DENX
>
U-Bootdoc
>
StandalonePrograms
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
U-Bootdoc
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
U-Bootdoc Home
Presentation
Changes
Index
Search
Go
List of pages in U-Bootdoc
Search
%SECTION0{NAME=StandalonePrograms}% Standalone Programs U-Boot can dynamically load independent software modules, called "standalone programs". Standalone programs have a standard C calling environment, and can use standard services like =printf()=, =malloc()=, =install_hdlr()=. Used for: * special test software that is used in bring-up but shall not be included with customer release * software that is needed only occasionally * code that performs special actions that were not foreseen (software updates) * code that shall not be made available under GPL Example: <verbatim> #include <common.h> #include <exports.h> int hello_world (int argc, char *argv[]) { int i; app_startup(argv); printf ("Example expects ABI version %d\n", XF_VERSION); printf ("Actual U-Boot ABI version %d\n", (int)get_version()); printf ("Hello World\n"); printf ("argc = %d\n", argc); for (i=0; i<=argc; ++i) { printf ("argv[%d] = \"%s\"\n", i, argv[i] ? argv[i] : "<NULL>"); } return (0); } </verbatim> Run: <verbatim> => tftp 40000 /tftpboot/hello_world.bin ... => go 40004 Hello World! This is a test. ## Starting application at 0x00040004 ... Hello World argc = 7 argv[0] = "40004" argv[1] = "Hello" argv[2] = "World!" argv[3] = "This" argv[4] = "is" argv[5] = "a" argv[6] = "test." argv[7] = "" ## Application terminated, rc = 0x0 </verbatim>
1.10. Command Interpreters
1. Abstract
1.12. Special Features
Prev
Home
Next