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
Signature · 2 lines
View this message in context: http://www.nabble.com/stand-alone-application-tf3498698.html#a9771147 Sent from the Uboot - Users mailing list archive at Nabble.com.
Quoted 8 lines · In message <[email protected]> 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_bootcould either download the diagnostics manually under theU_bootprompt, or be calling updo_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.
Quoted 2 lines
(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.
Quoted 2 lines
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.
Quoted 4 lines
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.candexport.h), without some kind of "linking"? Unless go <address> ordo_go(address)perform some sort of
This is documented in the doc/README.standalone file; no linking is done.
Quoted 2 lines
"linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
The keyword is: jump table.
Quoted 1 line
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?
Quoted 8 lines
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.
Quoted 1 line
(2) Is uploading currently being supported in U-boot's tftp implementation?
No.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 at 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
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
Quoted 92 lines · wd
Quoted 10 lines · In message <[email protected]> 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_bootcould either download the diagnostics manually under theU_bootprompt, or be calling updo_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 exampleI recommend to use the existing log device; note that it is compatible with Linux's syslog mechanism.
Quoted 4 lines
(1) In my understanding, the stand alone application (the board diagnostic
for manufacturing) is supposed to be compiled as a separately entity in theYes.
Quoted 3 lines
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.
Quoted 5 lines
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.candexport.h), without some kind
of "linking"? Unless go <address> ordo_go(address)perform some sort ofThis is documented in the doc/README.standalone file; no linking is done.
Quoted 2 lines
"linking" or "peudo linking" action, this doesn't sound possible. Could someone explain to me how this works?
The keyword is: jump table.
Quoted 2 lines
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?
Quoted 11 lines
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.
Quoted 2 lines
(2) Is uploading currently being supported in U-boot's tftp implementation?
No.
Best regards,
Wolfgang Denk
Signature · 17 lines
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 at 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=DEVDEV _______________________________________________ U-Boot-Users mailing list U-Boot-Users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Signature · 2 lines
View this message in context: http://www.nabble.com/stand-alone-application-tf3498698.html#a9779381 Sent from the Uboot - Users mailing list archive at Nabble.com.
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
Quoted 42 lines · 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_bootcould either download the diagnostics manually under theU_bootprompt, or be calling updo_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 bothexports.candexport.h), without some kind of "linking"? Unless go <address> ordo_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_tftpcodes, 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
Signature · 2 lines
View this message in context: http://www.nabble.com/stand-alone-application-tf3498698.html#a9779774 Sent from the Uboot - Users mailing list archive at Nabble.com.
Quoted 5 lines · In message <[email protected]> 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 is0x00040004. 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.
Quoted 3 lines
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.
Quoted 1 line
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
Signature · 6 lines
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 at denx.de Dealing with failure is easy: work hard to improve. Success is also easy to handle: you've solved the wrong problem. Work hard to improve.
Quoted 3 lines · In message <[email protected]> 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.
Quoted 4 lines
environment, if the start address is confined to
0x00040000? I would expect that, some how, the standalone application has to informU_bootwhere the start address is, beforeU_bootcould 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
Quoted 1 line
kow9loon wrote:
AND STOP TOP-POSTING / FULL-QUOTING!
Best regards,
Wolfgang Denk
Signature · 5 lines
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 at denx.de War is never imperative. -- McCoy, "Balance of Terror", stardate 1709.2