.SUFFIXES: .lss .c .o .elf .c32 .lnx
-all: hello.c32 \
+all: hello.c32 cat.c32 \
fancyhello.c32 fancyhello.lnx \
- keytest.c32 keytest.lnx
+ keytest.c32 keytest.lnx \
.PRECIOUS: %.o
%.o: %.S
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <console.h>
+
+int main(int argc, char *argv[])
+{
+ FILE *f;
+ int ch;
+ int i;
+
+ openconsole(&dev_stdcon_r, &dev_stdcon_w);
+
+ printf("argv = %p\n", argv);
+ for ( i = 0 ; i <= argc ; i++ )
+ printf("argv[%d] = %p = \"%s\"\n", i, argv[i], argv[i]);
+
+ if ( argc < 2 ) {
+ fprintf(stderr, "Missing file name!\n");
+ exit(1);
+ }
+
+ printf("File = %s\n", argv[1]);
+
+ f = fopen(argv[1], "r");
+ while ( (ch = getc(f)) != EOF )
+ putchar(ch);
+
+ fclose(f);
+
+ return 0;
+}
limited to 255 characters.
+
+Note that EXTLINUX installs in the filesystem partition like a
+well-behaved bootloader :) Thus, it needs a master boot record in the
+partition table; the mbr.bin shipped with SYSLINUX should work well.
+To install it just do:
+
+ cat mbr.bin > /dev/XXX
+
+... where /dev/XXX is the appropriate master device, e.g. /dev/hda,
+and make sure the correct partition in set active.
+
+
+If you have multiple disks in a software RAID configuration, the
+preferred way to boot is:
+
+- Create a separate RAID-1 partition for /boot. Note that the Linux
+ RAID-1 driver can span as many disks as you wish.
+
+- Install the MBR on *each disk*, and mark the RAID-1 partition
+ active.
+
+- Run "extlinux /boot" to install extlinux. This will install it on
+ all the drives in the RAID-1 set, which means you can boot any
+ combination of drives in any order.