hello_world.c 669 B

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