aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-11-05 13:13:25 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-11-05 13:21:04 +0000
commit0b26e59c8f5dc7a8a124a033a78e08c7a2028bcd (patch)
tree9a892c852fabd0a75d10c856105b4488cc87f66c /com32/samples
parentcdeba8ac82f529a3a4a544c4e8346887ef81cb74 (diff)
parentb210bd5bfd0d7182b0a65f507c7557eeb90d5b16 (diff)
downloadsyslinux-0b26e59c8f5dc7a8a124a033a78e08c7a2028bcd.tar.gz
syslinux-0b26e59c8f5dc7a8a124a033a78e08c7a2028bcd.tar.xz
syslinux-0b26e59c8f5dc7a8a124a033a78e08c7a2028bcd.zip
Merge tag 'syslinux-5.00-pre9' into for-hpa/elflink/firmware
This merge also includes the Syslinux-4.06 release. Conflicts: Makefile com32/hdt/Makefile com32/modules/Makefile com32/samples/hello.c mtools/Makefile
Diffstat (limited to 'com32/samples')
-rw-r--r--com32/samples/hello.c43
1 files changed, 14 insertions, 29 deletions
diff --git a/com32/samples/hello.c b/com32/samples/hello.c
index eef85283..d3d4d299 100644
--- a/com32/samples/hello.c
+++ b/com32/samples/hello.c
@@ -1,41 +1,26 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
- * Boston MA 02111-1307, USA; either version 2 of the License, or
- * (at your option) any later version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
/*
- * hello.c
+ * hello.c - A simple ELF module that sorts a couple of numbers
*
- * Hello, World! using libcom32
+ * Created on: Aug 11, 2008
+ * Author: Stefan Bucur <stefanb@zytor.com>
*/
-#include <string.h>
#include <stdio.h>
-#include <console.h>
+#include <stdlib.h>
-int main(int argc, char *argv[])
-{
- int i;
+#include "sort.h"
+
+#define NUM_COUNT 10
+#define MAX_NUM 100
-#if 0
- /* this hangs! */
- openconsole(&dev_stdcon_r, &dev_stdcon_w);
-#else
- /* this works */
- openconsole(&dev_rawcon_r, &dev_ansiserial_w);
-#endif
+int main(int argc __unused, char **argv __unused)
+{
+ int *nums = NULL;
- printf("Hello, World!\n");
+ nums = malloc(NUM_COUNT * sizeof(int));
+ printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&main, nums);
- for (i = 1; i < argc; i++)
- printf("%s%c", argv[i], (i == argc - 1) ? '\n' : ' ');
+ free(nums);
return 0;
}