extlinux: Document need for MBR, and usage on a RAID system.
authorhpa <hpa>
Tue, 21 Dec 2004 22:32:12 +0000 (22:32 +0000)
committerhpa <hpa>
Tue, 21 Dec 2004 22:32:12 +0000 (22:32 +0000)
Add cat.c32 as one of the sample programs.

com32/samples/Makefile
com32/samples/cat.c [new file with mode: 0644]
extlinux.doc

index ddcdaa2..07d8156 100644 (file)
@@ -39,9 +39,9 @@ LNXLIBS          = ../libutil/libutil_lnx.a
 
 .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
diff --git a/com32/samples/cat.c b/com32/samples/cat.c
new file mode 100644 (file)
index 0000000..277427f
--- /dev/null
@@ -0,0 +1,31 @@
+#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;
+}
index 9844cb7..54e649d 100644 (file)
@@ -30,3 +30,27 @@ It works the same way as SYSLINUX, with a few slight modifications.
    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.