hello_world.c 694 B

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