From a8f911357bd9afcb5d60635c13344d48242c755c Mon Sep 17 00:00:00 2001 From: hpa Date: Tue, 14 Apr 1998 04:22:15 +0000 Subject: [PATCH] Updated documentation, added keytab-lilo.pl. --- Makefile | 5 +-- NEWS | 9 +++-- TODO | 2 -- keytab-lilo.pl | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ syslinux.doc | 76 +++++++++++++++++++++++++++++++--------- 5 files changed, 178 insertions(+), 23 deletions(-) create mode 100755 keytab-lilo.pl diff --git a/Makefile b/Makefile index b19dfea..a8f7026 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ VERSION = $(shell cat version) SOURCES = ldlinux.asm syslinux.asm syslinux.c TARGETS = bootsect.bin ldlinux.sys syslinux.com syslinux DOCS = COPYING NEWS README TODO syslinux.doc -OTHER = Makefile bin2c.pl now.pl version +OTHER = Makefile bin2c.pl now.pl keytab-lilo.pl version all: $(TARGETS) ls -l $(TARGETS) @@ -64,7 +64,8 @@ syslinux: syslinux.o bootsect_bin.o ldlinux_bin.o $(CC) $(LDFLAGS) -o syslinux syslinux.o bootsect_bin.o ldlinux_bin.o install: all - install -c syslinux $(BINDIR) + chmod a+x keytab-lilo.pl + install -c syslinux keytab-lilo.pl $(BINDIR) tidy: rm -f ldlinux.bin *.lst *.o *_bin.c diff --git a/NEWS b/NEWS index bba7b05..0a0061a 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,13 @@ Changes in 1.35: - * Loading from partitions now should work properly. + * Loading from partitions now should work properly. (Actually + tested, this time. You should even be able to dd a floppy + to a partition and boot from it.) * Removed large workaround code for an alleged ancient BIOS bug I have never actually seen. - * Support for simple keyboard remappings (for localization, again.) + * Support for simple keyboard remappings, same as used by + LILO (once again to support localization.) The program + keytab-lilo.pl from the LILO distribution included to + generate such maps. Changes in 1.34: * Ability to load a VGA font on bootup (for localized Linux diff --git a/TODO b/TODO index 147bed3..5d2ea22 100644 --- a/TODO +++ b/TODO @@ -5,8 +5,6 @@ Currently scheduled for inclusion in 1.40: - Cleaned up documentation, with a real man page. - Boot ELKS, if at all possible (may have problems with i386 assumption.) -- Get booting from a partition working (two independent reports say - it's broken.) For a later release, perhaps: diff --git a/keytab-lilo.pl b/keytab-lilo.pl new file mode 100755 index 0000000..e131b43 --- /dev/null +++ b/keytab-lilo.pl @@ -0,0 +1,109 @@ +#!/usr/bin/perl +# -------------------------------------------------------------------------- +# This program was taken from the LILO-20 distribution; only this header +# was added. +# +# LILO program code, documentation and auxiliary programs are +# Copyright 1992-1997 Werner Almesberger. +# All rights reserved. +# +# Redistribution and use in source and binary forms of parts of or the +# whole original or derived work are permitted provided that the +# original work is properly attributed to the author. The name of the +# author may not be used to endorse or promote products derived from +# this software without specific prior written permission. This work +# is provided "as is" and without any express or implied warranties. +# -------------------------------------------------------------------------- + +$DEFAULT_PATH = "/usr/lib/kbd/keytables"; +$DEFAULT_MAP = "us"; +$DEFAULT_EXT = ".map"; + +sub usage +{ + print STDERR + "usage: $0 [ -p old_code=new_code ] ...\n". + (" "x(8+length $0))."[path]default_layout[.map] ] ". + "[path]kbd_layout[.map]\n"; + exit 1; +} + + +while ($ARGV[0] eq "-p") { + shift(@ARGV); + &usage unless $ARGV[0] =~ /=/; + $table[eval($`)] = eval($'); + shift(@ARGV); +} +&usage unless defined $ARGV[0]; +load_map("def",defined $ARGV[1] ? $ARGV[0] : undef); +load_map("kbd",defined $ARGV[1] ? $ARGV[1] : $ARGV[0]); +&build_table("plain","shift","ctrl","altgr","shift_ctrl", + "altgr_ctrl","alt","shift_alt","ctrl_alt"); +for ($i = 0; $i < 256; $i++) { + printf("%c",$table[$i] ? $table[$i] : $i) || die "print: $!"; +} +close STDOUT || die "close: $!"; + + +sub load_map +{ + local ($pfx,$map) = @_; + local ($empty,$current); + + $map = $DEFAULT_MAP unless defined $map; + $map = $DEFAULT_PATH."/".$map unless $map =~ m|/|; + $map .= $DEFAULT_EXT unless $map =~ m|/[^/]+\.[^/]+$|; + if (!open(FILE,"loadkeys -m $map |")) { + print STDERR "loadkeys -m $map: $!\n"; + exit 1; + } + undef $current; + $empty = 1; + while () { + chop; + if (/^u_short\s+(\S+)_map\[\S+\]\s+=\s+{\s*$/) { + die "active at beginning of map" if defined $current; + $current = $pfx.":".$1; + next; + } + undef $current if /^};\s*$/; + next unless defined $current; + s/\s//g; + $map{$current} .= $_; + $empty = 0; + } + close FILE; + return unless $empty; + print STDERR "Keymap is empty\n"; + exit 1; +} + + +sub build_table +{ + local (@maps) = @_; + local (@tmp); + + $set = 0; + for $map (@maps) { + $code = $set; + for (split(",",$map{"def:".$map})) { + die "bad map entry $_ (def, map $map)" unless /^0x\S\S(\S\S)$/; + $tmp[$code] = hex $1 unless $tmp[$code]; + $code++; + } + $set += 256; + } + $set = 0; + for $map (@maps) { + $code = $set; + for (split(",",$map{"kbd:".$map})) { + die "bad map entry $_ (kbd, map $map)" unless /^0x\S\S(\S\S)$/; + $table[$tmp[$code]] = hex $1 unless $table[$tmp[$code]]; + $code++; + } + $set += 256; + } + $table[0] = 0; +} diff --git a/syslinux.doc b/syslinux.doc index 9e66037..10caa4e 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -1,6 +1,6 @@ - SYSLINUX - Version 1.34 - March 4, 1998 + SYSLINUX + Version 1.35 + April 13, 1998 A bootloader for Linux using MS-DOS floppies @@ -33,19 +33,23 @@ In order to create a bootable Linux floppy using SYSLINUX, prepare a normal MS-DOS formatted floppy. Copy one or more Linux kernel files to it, then execute the DOS command: - SYSLINUX a: + SYSLINUX [-s] a: (or whichever drive letter is appropriate) or the Linux command: - syslinux /dev/fd0 + syslinux [-s] /dev/fd0 (or, again, whichever device is the correct one.) This will alter the boot sector on the disk and copy a file named LDLINUX.SYS into its root directory. +The -s option will install a "slow and stupid" version of SYSLINUX. +This version may work on some very buggy BIOSes on which SYSLINUX +would otherwise fail. + WARNING: There seems to be a bug in some recent experimental Linux kernels that causes floppy disk corruption when using the Linux syslinux installer. This bug exists in kernels @@ -71,7 +75,6 @@ the following items (case is insensitive for keywords; upper case is used here to indicate that a word should be typed verbatim): DEFAULT kernel options... - Sets the default command line. If SYSLINUX boots automatically, it will act just as if the entries after DEFAULT had been typed in at the "boot:" prompt, except that the option "auto" is @@ -82,7 +85,6 @@ DEFAULT kernel options... with no options. APPEND options... - Add one or more options to the kernel command line. These are added both for automatic and manual boots. The options are added at the very beginning of the kernel command line, @@ -92,7 +94,6 @@ APPEND options... LABEL label KERNEL kernel APPEND options... - Indicates that if "label" is entered as the kernel to boot, SYSLINUX should instead boot "kernel", and the specified APPEND options should be used instead of the ones specified in the @@ -116,17 +117,14 @@ LABEL label "v2.1.30" and "v2.1.31" will not be distinguishable. APPEND - - Append nothing. APPEND with a single hyphen as argument in a LABEL section can be used to override a global APPEND. IMPLICIT flag_val - If flag_val is 0, do not load a kernel image unless it has been explicitly named in a LABEL statement. The default is 1. TIMEOUT timeout - Indicates how long to wait at the boot: prompt until booting automatically, in units of 1/10 s. The timeout is cancelled as soon as the user types anything on the keyboard, the assumption @@ -145,8 +143,20 @@ FONT filename ignored. This only works on EGA and VGA cards; hopefully it should do nothing on others. -DISPLAY filename +KBDMAP keymap + Install a simple keyboard map. The keyboard remapper used is + *very* simplistic (it simply remaps the keycodes received from + the BIOS, which means that only the key combinations relevant + in the default layout -- usually U.S. English -- can be + mapped) but should at least help people with AZERTY keyboard + layout and the locations of = and , (two special characters + used heavily on the Linux kernel command line.) + + The included program keytab-lilo.pl from the LILO distribution + can be used to create such keymaps. The file keytab-lilo.doc + contains the documentation for this program. +DISPLAY filename Displays the indicated file on the screen at boot time (before the boot: prompt, if displayed). This option takes the place of the LINUXMSG.TXT and BOOTMSG.TXT files in SYSLINUX 1.0. Please @@ -155,7 +165,6 @@ DISPLAY filename NOTE: If the file is missing, this option is simply ignored. PROMPT flag_val - If flag_val is 0, display the boot: prompt only if the Shift or Alt key is pressed, or Caps Lock or Scroll lock is set (this is the default). If flag_val is 1, always display the boot: prompt. This @@ -167,7 +176,6 @@ F2 filename ...etc... F9 filename F0 filename - Displays the indicated file on the screen when a function key is pressed at the boot: prompt. This can be used to implement pre-boot online help (presumably for the kernel command line @@ -219,9 +227,9 @@ provided. The suggested manner is to let the initrd system mount the boot floppy and look for additional drivers in a predetermined location. -To bzImage and recent zImage kernels, SYSLINUX 1.30-1.32 will identify -using the ID byte 0x31. The ID range 0x32-0x3f is reserved for future -versions of SYSLINUX. +To bzImage and recent zImage kernels, SYSLINUX 1.30 and higher will +identify using the ID byte 0x31. The ID range 0x32-0x3f is reserved +for future versions of SYSLINUX. ++++ DISPLAY FILE FORMAT ++++ @@ -269,6 +277,40 @@ Any file that SYSLINUX uses can be marked hidden, system or readonly if so is convenient; SYSLINUX ignores all file attributes. The SYSLINUX installed automatically sets the readonly attribute on LDLINUX.SYS. + ++++ NOTES ON BOOTABLE CD-ROMS ++++ + +SYSLINUX can be used to create bootdisk images for El +Torito-compatible bootable CD-ROMs. However, it appears that many +BIOSes are very buggy when it comes to booting CD-ROMs. Some users +have reported that the following steps are helpful in making a CD-ROM +that is bootable on the largest possible number of machines: + + a) Use the -s (slow and stupid) option to SYSLINUX; + b) Put the boot image as close to the beginning of the + ISO 9660 filesystem as possible. + +A CD-ROM is so much faster than a floppy that the -s option shouldn't +matter from a speed perspective. + + ++++ BOOTING FROM A FAT FILESYSTEM PARTITION ++++ + +SYSLINUX can boot from a FAT12 or FAT16 filesystem partition on a hard +disk (FAT32, introduced in Windows 95 OSR-2, is not supported, +however.) The installation procedure is identical to the procedure +for installing it on a floppy, and should work under either DOS or +Linux. To boot from a partition, SYSLINUX needs to be launched from a +Master Boot Record or another boot loader, just like DOS itself would. + +Under DOS, you can install a standard simple MBR on the primary hard +disk by running the command: + + FDISK /MBR + +Then use the FDISK command to mark the appropriate partition active. + +SYSLINUX, like DOS, requires that the partition which contains it +lives entirely below cylinder 1024 for proper operation. + ++++ BUG REPORTS ++++ I would appreciate hearing of any problems you have with SYSLINUX. I -- 2.7.4