public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Need To Know about the Command Line Interface in U-boot.
@ 2010-08-11  6:05 prashantpurohit025 at gmail.com
  2010-08-11  6:37 ` Paul Hsu
  0 siblings, 1 reply; 2+ messages in thread
From: prashantpurohit025 at gmail.com @ 2010-08-11  6:05 UTC (permalink / raw)
  To: u-boot

?Hi all,

 I need to know how the command line interface has been developed in U-boot?

 I could understand few things about command line interface from command.h and command.c file.

 I am unable to get how from command line the U_BOOT_CMD macro has been called?

 Also, what is the need of the special section for U-boot i.e ".u_boot_cmd"?

 If any one has more info about it, please let me know as I am developing a similar command line interface for my application.

 Thanks in advance.

Cheers,
Prashant

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] Need To Know about the Command Line Interface in U-boot.
  2010-08-11  6:05 [U-Boot] Need To Know about the Command Line Interface in U-boot prashantpurohit025 at gmail.com
@ 2010-08-11  6:37 ` Paul Hsu
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Hsu @ 2010-08-11  6:37 UTC (permalink / raw)
  To: u-boot

About .u_boot_cmd section, you can see the u-boot.lds for each
processor core directory(arch/...).

This section collects all cmd_tbl_t structures into this section.
So each uboot command line command should use macro U_BOOT_CMD to
allocate the structure.

After compilation you can see how linker arrange the cmd_tbl_t
structures into .u_boot_cmd section.
EX.
...............
.u_boot_cmd     0x33f97fe4      0x468
 *(.u_boot_cmd)
 .u_boot_cmd    0x33f97fe4       0x18 common/libcommon.a(cmd_bdinfo.o)
                0x33f97fe4                __u_boot_cmd_bdinfo
 .u_boot_cmd    0x33f97ffc       0x30 common/libcommon.a(cmd_boot.o)
                0x33f97ffc                __u_boot_cmd_go
                0x33f98014                __u_boot_cmd_reset
 .u_boot_cmd    0x33f9802c       0x78 common/libcommon.a(cmd_bootm.o)
                0x33f9802c                __u_boot_cmd_bootm
                0x33f98044                __u_boot_cmd_boot
                0x33f9805c                __u_boot_cmd_bootd
                0x33f98074                __u_boot_cmd_iminfo
                0x33f9808c                __u_boot_cmd_imls
 .u_boot_cmd    0x33f980a4       0x30 common/libcommon.a(cmd_cache.o)
                0x33f980a4                __u_boot_cmd_icache
                0x33f980bc                __u_boot_cmd_dcache
 .u_boot_cmd    0x33f980d4       0x18 common/libcommon.a(cmd_console.o)
                0x33f980d4                __u_boot_cmd_coninfo
 .u_boot_cmd    0x33f980ec       0x18 common/libcommon.a(cmd_date.o)
                0x33f980ec                __u_boot_cmd_date
.............

See, just like a table in memory.

So you can use a for-loop to traverse the table and print each
command's description jusk like the _do_help()(in common/command.c)
do.


Paul






 Wed, Aug 11, 2010 at 2:05 PM,  <prashantpurohit025@gmail.com> wrote:
> Hi all,
>
> ?I need to know how the command line interface has been developed in U-boot?
>
> ?I could understand few things about command line interface from command.h and command.c file.
>
> ?I am unable to get how from command line the U_BOOT_CMD macro has been called?
>
> ?Also, what is the need of the special section for U-boot i.e ".u_boot_cmd"?
>
> ?If any one has more info about it, please let me know as I am developing a similar command line interface for my application.
>
> ?Thanks in advance.
>
> Cheers,
> Prashant
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-11  6:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11  6:05 [U-Boot] Need To Know about the Command Line Interface in U-boot prashantpurohit025 at gmail.com
2010-08-11  6:37 ` Paul Hsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox