[U-Boot-Users] stand alone application

I am trying to write a stand alone application, which is supposed to be a board diagnostics for manufacturing. The way it supposes to work is as follows: U_boot could either download the diagnostics manually under the U_boot prompt, or be calling up do_tftp() directly if it is to be done automatically. Results generated from the diagnostics are to be recorded in the RAM, whose contents shall later be uploaded as a log file to an external server via tftp. After reading the examples provided in the example directory, I have the following questions:
(1) In my understanding, the stand alone application (the board diagnostic for manufacturing) is supposed to be compiled as a separately entity in the U-boot path and then be placed in an external server, waiting to be downloaded to the RAM on board; when either go <address> or do_go(address) is executed, control get passed to the stand alone application, how could the stand alone application be able to make calls to functions that are exported (those appeared in both exports.c and export.h), without some kind of "linking"? Unless go <address> or do_go(address) perform some sort of "linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
My expectation of how this could work is: on execution of the go <address> command or do_go (address), address of the jump table is to be loaded into a register, and it is the responsibility of the application to save the value of this register before anything else, in such a way to allow the application to call up functions that it elects by picking up the correct addresses of these functions via indexing. However, after reading the examples provided in U-boot, I have not seen any motion of saving the value of the register. However, vwhich register U-boot chooses to use would be processor dependent. This is just my two cents.
(2) Is uploading currently being supported in U-boot's tftp implementation? Judging from the do_tftp codes, it looks that only "downloading" action is supported not "uploading". Could someone confirm that or point to the place where "uploading" is implemented?
Any input would be greatly appreciated. Thanks.
Kow9loon

In message 9771147.post@talk.nabble.com you wrote:
I am trying to write a stand alone application, which is supposed to be a board diagnostics for manufacturing. The way it supposes to work is as follows: U_boot could either download the diagnostics manually under the U_boot prompt, or be calling up do_tftp() directly if it is to be done automatically. Results generated from the diagnostics are to be recorded in the RAM, whose contents shall later be uploaded as a log file to an external server via tftp. After reading the examples provided in the example
I recommend to use the existing log device; note that it is compatible with Linux's syslog mechanism.
(1) In my understanding, the stand alone application (the board diagnostic for manufacturing) is supposed to be compiled as a separately entity in the
Yes.
U-boot path and then be placed in an external server, waiting to be downloaded to the RAM on board; when either go <address> or do_go(address)
You can also store it in flash memory, or on some storage device, of course.
is executed, control get passed to the stand alone application, how could the stand alone application be able to make calls to functions that are exported (those appeared in both exports.c and export.h), without some kind of "linking"? Unless go <address> or do_go(address) perform some sort of
This is documented in the doc/README.standalone file; no linking is done.
"linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
The keyword is: jump table.
My expectation of how this could work is: on execution of the go <address>
Why don't you simply read the documentation instead of speculating?
command or do_go (address), address of the jump table is to be loaded into a register, and it is the responsibility of the application to save the value of this register before anything else, in such a way to allow the application to call up functions that it elects by picking up the correct addresses of these functions via indexing. However, after reading the examples provided in U-boot, I have not seen any motion of saving the value of the register. However, vwhich register U-boot chooses to use would be processor dependent. This is just my two cents.
You should RTFM.
(2) Is uploading currently being supported in U-boot's tftp implementation?
No.
Best regards,
Wolfgang Denk

Thank you for the reply and the direction. I am a novice in U_boot, though I have some prior experience in working on other boot codes.
There is still another outstanding question that I would like to raisie, however. In the Standalone-README file, it states that for PowerPC, the load adress is 0x00040000, and the start address is 0x00040004. On the board that I am working on, those two addresses aren't available. Is that a way for me to have the load address and the start address to be RELOCATED to addresses that fall within the aforementioned range? Any comment would be greatly welcomed. Thanks.
Best Regards,
Kow9loon
wd wrote:
In message 9771147.post@talk.nabble.com you wrote:
I am trying to write a stand alone application, which is supposed to be a board diagnostics for manufacturing. The way it supposes to work is as follows: U_boot could either download the diagnostics manually under the U_boot prompt, or be calling up do_tftp() directly if it is to be done automatically. Results generated from the diagnostics are to be recorded in the RAM, whose contents shall later be uploaded as a log file to an external server via tftp. After reading the examples provided in the example
I recommend to use the existing log device; note that it is compatible with Linux's syslog mechanism.
(1) In my understanding, the stand alone application (the board diagnostic for manufacturing) is supposed to be compiled as a separately entity in the
Yes.
U-boot path and then be placed in an external server, waiting to be downloaded to the RAM on board; when either go <address> or do_go(address)
You can also store it in flash memory, or on some storage device, of course.
is executed, control get passed to the stand alone application, how could the stand alone application be able to make calls to functions that are exported (those appeared in both exports.c and export.h), without some kind of "linking"? Unless go <address> or do_go(address) perform some sort of
This is documented in the doc/README.standalone file; no linking is done.
"linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
The keyword is: jump table.
My expectation of how this could work is: on execution of the go
<address>
Why don't you simply read the documentation instead of speculating?
command or do_go (address), address of the jump table is to be loaded into a register, and it is the responsibility of the application to save the value of this register before anything else, in such a way to allow the application to call up functions that it elects by picking up the correct addresses of these functions via indexing. However, after reading the examples provided in U-boot, I have not seen any motion of saving the value of the register. However, vwhich register U-boot chooses to use would be processor dependent. This is just my two cents.
You should RTFM.
(2) Is uploading currently being supported in U-boot's tftp implementation?
No.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de When properly administered, vacations do not diminish productivity: for every week you're away and get nothing done, there's another when your boss is away and you get twice as much done. -- Daniel B. Luten
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

In message 9779381.post@talk.nabble.com you wrote:
There is still another outstanding question that I would like to raisie, however. In the Standalone-README file, it states that for PowerPC, the load adress is 0x00040000, and the start address is 0x00040004. On the board that I am working on, those two addresses aren't available. Is that a way for me
Chose any other free address you like, then.
to have the load address and the start address to be RELOCATED to addresses that fall within the aforementioned range? Any comment would be greatly welcomed. Thanks.
No relocation is done here. You link for a fixed address.
wd wrote:
[Full quote deleted.]
Please don't top post / full quote. Learn to quote. See http://www.netmeister.org/news/learn2quote.html
Best regards,
Wolfgang Denk

After giving the matter some more thoughts, another question also comes into mind:
How could I ensure that control is passed to the entry point of my standalone application, which I designate, running in the PowerPC environment, if the start address is confined to 0x00040000? I would expect that, some how, the standalone application has to inform U_boot where the start address is, before U_boot could get to the correct entry point. Please correct me if I am wrong. Thank you again.
Regards,
Kow9loon
kow9loon wrote:
I am trying to write a stand alone application, which is supposed to be a board diagnostics for manufacturing. The way it supposes to work is as follows: U_boot could either download the diagnostics manually under the U_boot prompt, or be calling up do_tftp() directly if it is to be done automatically. Results generated from the diagnostics are to be recorded in the RAM, whose contents shall later be uploaded as a log file to an external server via tftp. After reading the examples provided in the example directory, I have the following questions:
(1) In my understanding, the stand alone application (the board diagnostic for manufacturing) is supposed to be compiled as a separately entity in the U-boot path and then be placed in an external server, waiting to be downloaded to the RAM on board; when either go <address> or do_go(address) is executed, control get passed to the stand alone application, how could the stand alone application be able to make calls to functions that are exported (those appeared in both exports.c and export.h), without some kind of "linking"? Unless go <address> or do_go(address) perform some sort of "linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
My expectation of how this could work is: on execution of the go <address> command or do_go (address), address of the jump table is to be loaded into a register, and it is the responsibility of the application to save the value of this register before anything else, in such a way to allow the application to call up functions that it elects by picking up the correct addresses of these functions via indexing. However, after reading the examples provided in U-boot, I have not seen any motion of saving the value of the register. However, vwhich register U-boot chooses to use would be processor dependent. This is just my two cents.
(2) Is uploading currently being supported in U-boot's tftp implementation? Judging from the do_tftp codes, it looks that only "downloading" action is supported not "uploading". Could someone confirm that or point to the place where "uploading" is implemented?
Any input would be greatly appreciated. Thanks.
Kow9loon

In message 9779774.post@talk.nabble.com you wrote:
How could I ensure that control is passed to the entry point of my standalone application, which I designate, running in the PowerPC
You enter the correct entry point address as argument of the go command. You are expected to know what you are doing.
environment, if the start address is confined to 0x00040000? I would expect that, some how, the standalone application has to inform U_boot where the start address is, before U_boot could get to the correct entry point. Please correct me if I am wrong. Thank you again.
Did you bother to read the FAQ? I guess not. See especially http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
kow9loon wrote:
AND STOP TOP-POSTING / FULL-QUOTING!
Best regards,
Wolfgang Denk
participants (2)
-
kow9loon
-
Wolfgang Denk