diff --git a/ChangeLog b/ChangeLog index 938e25e28..503cfcab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +1999-10-27 OKUJI Yoshinori + + * stage2/disk_io.c (set_device) [!STAGE1_5]: Remove the + preliminary Mach-style device name support. I've decided that + the support is not necessary. + (setup_part) [!STAGE1_5]: Do not strip the leading "/dev/". + * docs/help2man: Upgraded to 1.016. + * docs/mbchk.1: Regenerated. + * docs/grub.8: Likewise. + * grub/asmstub.c: Rename KEY_MAP to BIOS_KEY_MAP. + + * stage2/asm.S [!STAGE1_5] (set_int15_handler): Use 0 instead of + the maximum number for the segment. + [!STAGE1_5] (unset_int15_handler): Likewise. + [!STAGE1_5] (int15_handler): Almost rewritten. If non-carrier, + ignore the scancode. If the scancode is E1 or E0, then set + INT15_SKIP_FLAG to 0x74, and if the previous scancode is E1 or + E0, set INT15_SKIP_FLAG to 0xea. Clear bit 7 in %dl. Save bit 7 + of %al in %bl. Do not lcall. Use ljmp instead. + [!STAGE1_5] (key_map): Renamed to ... + [!STAGE1_5] (bios_key_map): ... this. + * stage2/builtins.c (keycode_func): Check if FROM is greater + than 0xff instead of double-checking for TO. Use BIOS_KEY_MAP + instead of KEY_MAP. + * stage2/shared.h (KEY_MAP_SIZE): Set to 32. + (key_map): Removed. + (bios_key_map): Declared. + 1999-10-26 OKUJI Yoshinori Now the BIOS drive remapping is functional. diff --git a/TODO b/TODO index 1b4531dab..01fc5ae05 100644 --- a/TODO +++ b/TODO @@ -12,8 +12,6 @@ Priorities: Things in this file are ranked with one to three !; the more, the higher priority. -* Support partition syntax to correspond with BSD ``slice'' syntax - (`(hd0,1a)' -> `/dev/hd0s2a'). !! ? Add a partition naming syntax that means ``the first partition of this type''. We need this for clean Hurd install floppies. * Add a real scripting language, possibly retaining backward diff --git a/docs/grub.8 b/docs/grub.8 index b76877513..192182d5f 100644 --- a/docs/grub.8 +++ b/docs/grub.8 @@ -1,12 +1,11 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013. +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.016. .TH GRUB "8" "October 1999" "GNU GRUB 0.5.94" FSF .SH NAME GRUB \- the grub shell .SH SYNOPSIS -.B GRUB +.B grub [\fIOPTION\fR]... .SH DESCRIPTION -.PP Enter the GRand Unified Bootloader command shell. .TP \fB\-\-batch\fR diff --git a/docs/help2man b/docs/help2man index d33f7cdf6..aa1df4837 100644 --- a/docs/help2man +++ b/docs/help2man @@ -18,6 +18,7 @@ # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Written by Brendan O'Dea +# Available from ftp://ftp.gnu.org/gnu/help2man/ use 5.004; use strict; @@ -26,7 +27,7 @@ use Text::Tabs qw(expand); use POSIX qw(strftime setlocale LC_TIME); my $this_program = 'help2man'; -my $this_version = '1.013'; +my $this_version = '1.016'; my $version_info = </dev/null` +# Grab help and version info from executable. +my $help_text = join '', map { expand $_ } `$ARGV[0] --help 2>/dev/null` or die "$this_program: can't get `--help' info from $ARGV[0]\n"; -my @version = paragraphs `$ARGV[0] --version 2>/dev/null` +my $version_text = join '', map { expand $_ } `$ARGV[0] --version 2>/dev/null` or die "$this_program: can't get `--version' info from $ARGV[0]\n"; my $date = strftime "%B %Y", localtime; @@ -165,7 +159,7 @@ if ($opt_output) # # and seperated from any copyright/author details by a blank line. -$_ = shift @version; +($_, $version_text) = split /\n+/, $version_text, 2; if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/) @@ -187,163 +181,208 @@ else $program =~ s!.*/!!; -# no info for `info' itself +# No info for `info' itself. $opt_no_info = 1 if $program eq 'info'; -# --name overrides --include contents -$include{NAME} = "$program \\- $opt_name" if $opt_name; +# --name overrides --include contents. +$include{NAME} = "$program \\- $opt_name\n" if $opt_name; -# Default (useless) NAME paragraph -$include{NAME} ||= "$program \\- manual page for $program $version"; +# Default (useless) NAME paragraph. +$include{NAME} ||= "$program \\- manual page for $program $version\n"; # Man pages traditionally have the page title in caps. my $PROGRAM = uc $program; -# Header. -print < are + # rendered in a constant width font. + if (/^( +)([\$\%>] )\S/) + { + my $indent = $1; + my $prefix = $2; + my $break = '.IP'; + $include{$sect} ||= ''; + while (s/^$indent\Q$prefix\E(\S.*)\n*//) + { + $include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n"; + $break = '.br'; + } + next; } - # Option subsections have second line indented. - if (s/^(\S.*)\n / /) + $include{$sect} ||= ''; + # Sub-sections have a trailing colon and the second line indented. + if (s/^(\S.*:) *\n / /) { - print qq(.SS "$1"\n); - $break = ''; + $include{$sect} .= qq(.SS "$1"\n); } - my $output = ''; - while (length) + my $indent = 0; + my $content = ''; + + # Tagged paragraph (option). + if (s/^( {1,10}(-\S+(?:, *-\S+)*))(?: +|\n( {20,}))([^\s-].*)\n//) { - my $indent = 0; - - # Tagged paragraph - if (s/^( +(\S.*?) +)(\S.*)\n?//) + $indent = length ($3 || $1); + my $tag = $2; + my $desc = $4; + unless ($3) { $indent = length $1; - $output .= ".TP\n$2\n$3\n"; - $break = 1; + $indent = length $1 if /^( {20,})[^\s-]/; } - # Indented paragraph - elsif (s/^( +)(\S.*)\n?//) - { - $indent = length $1; - $output .= ".IP\n$2\n"; - $break = 1; - } - - # Left justified paragraph - else - { - s/(.*)\n?//; - $output .= ".PP\n" if $break; - $output .= "$1\n"; - $break = 1; - } - - # Continuations - $output .= "$1\n" while s/^ {$indent}(\S.*)\n?//; + $content = ".TP\n\x82$tag\n\x82$desc\n"; } - $_ = $output; + # Tagged paragraph (other). + elsif (s/^( +(\S.*?) +)(\S.*)\n//) + { + $indent = length $1; + $content = ".TP\n\x82$2\n\x82$3\n"; + } - # Escape backslashes. - s/\\/\\e/g; + # Indented paragraph. + elsif (s/^( +)(\S.*)\n//) + { + $indent = length $1; + $content = ".IP\n\x82$2\n"; + } - # Convert options. - s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge; - print; -} + # Left justified paragraph. + else + { + s/(.*)\n//; + $content = ".PP\n" if $include{$sect}; + $content .= "$1\n"; + } -# Print any include items other than the ones we have already dealt -# with. -for (@include) -{ - print qq(.SH "$_"\n$include{$_}) - unless /^(NAME|SYNOPSIS|DESCRIPTION|SEE ALSO)$/; + # Append continuations. + $content .= "\x82$1\n" while s/^ {$indent}(\S.*)\n//; + + # Move to next paragraph. + s/^\n+//; + + for ($content) + { + # Leading dot protection. + s/\x82\./\x80/g; + s/\x82//g; + + # Convert options. + s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge; + } + + $include{$sect} .= $content; } # Refer to the real documentation. -if ($include{'SEE ALSO'} or !$opt_no_info) +unless ($opt_no_info) { - print qq(.SH "SEE ALSO"\n); - print $include{'SEE ALSO'}, ".PP\n" if $include{'SEE ALSO'}; - - print < je (0xeb) */ + xorb $(0x74 ^ 0xeb), ABS(int15_skip_flag) 1: - /* simulate the interrupt call */ - pushf + /* just cascade to the original */ /* ljmp */ - .byte 0x9a + .byte 0xea int15_offset: .word 0 int15_segment: .word 0 - iret .code32 - -ENTRY(key_map) + + .align 4 +ENTRY(bios_key_map) .space (KEY_MAP_SIZE + 1) * 2 @@ -622,7 +650,7 @@ int13_handler: /* set %ax and %bp to the original values */ movw 2(%bp), %ax movw (%bp), %bp - /* ljmp */ + /* lcall */ .byte 0x9a int13_offset: .word 0 int13_segment: .word 0 diff --git a/stage2/builtins.c b/stage2/builtins.c index 43b9131d7..33cac71d4 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -1503,7 +1503,7 @@ keycode_func (char *arg, int flags) safe_parse_maxint (&from_code, &from); if (errnum) return 1; - if (from < 0 || to > 0xff) + if (from < 0 || from > 0xff) { /* FIXME: more appropriate error code! */ errnum = ERR_NUMBER_PARSING; @@ -1513,13 +1513,13 @@ keycode_func (char *arg, int flags) /* Find an empty slot. */ for (i = 0; i < KEY_MAP_SIZE; i++) { - if ((key_map[i] & 0xff) == from) + if ((bios_key_map[i] & 0xff) == from) { /* Perhaps the user wants to overwrite the map. */ break; } - if (! key_map[i]) + if (! bios_key_map[i]) break; } @@ -1531,10 +1531,10 @@ keycode_func (char *arg, int flags) if (to == from) /* If TO is equal to FROM, delete the entry. */ - grub_memmove ((char *) &key_map[i], (char *) &key_map[i + 1], + grub_memmove ((char *) &bios_key_map[i], (char *) &bios_key_map[i + 1], sizeof (unsigned short) * (KEY_MAP_SIZE - i)); else - key_map[i] = (to << 8) | from; + bios_key_map[i] = (to << 8) | from; /* Ugly but should work. */ unset_int15_handler (); diff --git a/stage2/disk_io.c b/stage2/disk_io.c index 559a2f3d8..e608bb082 100644 --- a/stage2/disk_io.c +++ b/stage2/disk_io.c @@ -803,78 +803,6 @@ set_device (char *device) } } } - else - { - char ch; - - /* A Mach-style absolute partition name. */ - ch = *device; - if ((*device != 'f' && *device != 'h') || - (device += 2, (*(device - 1) != 'd'))) - errnum = ERR_DEV_FORMAT; - else - safe_parse_maxint (&device, (int *) ¤t_drive); - - disk_choice = 0; - if (ch != 'f') - current_drive += 0x80; - - if (errnum) - return 0; - - if (*device == '/') - { - part_choice = PART_CHOSEN; - result = 1; - } - else if (*device == 's') - { - /* An absolute PC partition. */ - disk_choice = 0; - part_choice ++; - device ++; - - if (*device >= '0' && *device <= '9') - { - part_choice ++; - current_partition = 0; - - if (!(current_drive & 0x80) || - !safe_parse_maxint (&device, (int *) ¤t_partition) || - (--current_partition) > 254) - { - errnum = ERR_DEV_FORMAT; - return 0; - } - - current_partition = (current_partition << 16) + 0xFFFF; - - if (*device >= 'a' && *device <= 'h') - { - /* A BSD partition within the slice. */ - current_partition = (((*(device ++) - 'a') << 8) - | (current_partition & 0xFF00FF)); - } - } - } - else if (*device >= 'a' && *device <= 'h') - { - /* An absolute BSD partition. */ - part_choice ++; - current_partition = ((*(device ++) - 'a') << 8) | 0xFF00FF; - } - - if (*device == '/') - { - if (part_choice == PART_DISK) - { - current_partition = saved_partition; - part_choice ++; - } - - result = 1; - } - } if (! sane_partition ()) return 0; @@ -963,11 +891,6 @@ setup_part (char *filename) #else /* ! STAGE1_5 */ - /* FIXME: decide on syntax for blocklist vs. old-style vs. /dev/hd0s1 */ - /* Strip any leading /dev. */ - if (substring ("/dev/", filename) < 1) - filename += 5; - if (*filename == '(') { if ((filename = set_device (filename)) == 0) diff --git a/stage2/shared.h b/stage2/shared.h index c5efa9db8..64584dd14 100644 --- a/stage2/shared.h +++ b/stage2/shared.h @@ -121,7 +121,7 @@ extern char *grub_scratch_mem; #define DRIVE_MAP_SIZE 8 /* The size of the key map. */ -#define KEY_MAP_SIZE 8 +#define KEY_MAP_SIZE 32 /* @@ -511,7 +511,7 @@ void set_int15_handler (void); void unset_int15_handler (void); /* The key map. */ -extern unsigned short key_map[]; +extern unsigned short bios_key_map[]; /* calls for direct boot-loader chaining */ void chain_stage1 (int segment, int offset, int part_table_addr)