- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In response to:
http://forum.niosforum.com/forum/index.php...indpost&p=15096 (http://forum.niosforum.com/forum/index.php?showtopic=3837&view=findpost&p=15096) > How to add your cumstom commands into the u-boot? First read: doc/README.commands -- the file has many interesting details. But to summarize:<div class='quotetop'>QUOTE </div> --- Quote Start --- Commands are added to U-Boot by creating a new command structure. This is done by first including command.h Then using the U_BOOT_CMD() macro to fill in a cmd_tbl_t struct. U_BOOT_CMD(name,maxargs,repeatable,command,"usage","help") name: is the name of the commad. THIS IS NOT a string. maxargs: the maximumn numbers of arguments this function takes command: Function pointer (*cmd)(struct cmd_tbl_s *, int, int, char *[]); usage: Short description. This is a string help: long description. This is a string [/b] --- Quote End --- A good example of a custom command is the 'epcs' command (cpu/nios2/epcs.c). This is a Nios II custom command. However, you can create board-specific custom commands by following the same process in your board's source tree. > where is the source code for the command "cp" ? and so on... Most generic u-boot commands are found in the 'common' tree. You can grep for "U_BOOT_CMD" to find where all of the commands are implemented. The 'cp' command is implemented, for example, in common/cmd_mem.c. Regards, --ScottLink Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page