hello_world.c 689 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2000
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #include <common.h>
  7. #include <exports.h>
  8. int hello_world(int argc, char *const argv[])
  9. {
  10. int i;
  11. /* Print the ABI version */
  12. app_startup(argv);
  13. printf ("Example expects ABI version %d\n", XF_VERSION);
  14. printf ("Actual U-Boot ABI version %d\n", (int)get_version());
  15. printf ("Hello World\n");
  16. printf ("argc = %d\n", argc);
  17. for (i=0; i<=argc; ++i) {
  18. printf ("argv[%d] = \"%s\"\n",
  19. i,
  20. argv[i] ? argv[i] : "<NULL>");
  21. }
  22. printf ("Hit any key to exit ... ");
  23. while (!tstc())
  24. ;
  25. /* consume input */
  26. (void) getc();
  27. printf ("\n\n");
  28. return (0);
  29. }