From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1E2BSO-0002RH-2Z for mharc-grub-devel@gnu.org; Mon, 08 Aug 2005 13:30:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2BSK-0002OM-NK for grub-devel@gnu.org; Mon, 08 Aug 2005 13:30:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2BQN-0001k6-Ca for grub-devel@gnu.org; Mon, 08 Aug 2005 13:28:44 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2BQM-0001i6-Ky for grub-devel@gnu.org; Mon, 08 Aug 2005 13:28:30 -0400 Received: from [64.233.184.194] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E2BZA-0007cQ-Ej for grub-devel@gnu.org; Mon, 08 Aug 2005 13:37:36 -0400 Received: by wproxy.gmail.com with SMTP id i23so1155487wra for ; Mon, 08 Aug 2005 10:23:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:disposition-notification-to:date:from:user-agent:x-accept-language:mime-version:to:subject:content-type; b=Cd/Tda5XWjLueZbAOyawDcLNY/+bXlcextH/KZw361h6kbgGT61ChYS8ZseY4/DSUbCtLrg3looZUkix5hpVny7J2R0FYzFPYBZNKgwK4lD3wh37YoleAvG037P5Vf99Ehj++6SCkeqvHECacz3kQ6o6pYj7shqbwt8QrRUlsu4= Received: by 10.54.36.64 with SMTP id j64mr4964577wrj; Mon, 08 Aug 2005 10:23:24 -0700 (PDT) Received: from ?192.168.1.100? ([83.77.10.7]) by mx.gmail.com with ESMTP id 24sm8251560wrl.2005.08.08.10.23.20; Mon, 08 Aug 2005 10:23:24 -0700 (PDT) Message-ID: <42F79506.2040108@gmail.com> Date: Mon, 08 Aug 2005 19:23:18 +0200 From: Vladimir Serbinenko User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="------------020303040503090602080204" Subject: hexcat + grub_ncurses_getwh X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2005 17:30:33 -0000 This is a multi-part message in MIME format. --------------020303040503090602080204 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit I wrote a new patch: grub_ncurses_getwh + hexcat. hexcat shows the contents of file like hex editors. Vladimir 2005-08-08 Vladimir Serbinenko * commands/hexcat.c: new file * conf/i386-pc.rmk (hexcat): new module (grub_emu): hexcat added * conf/powerpc-ieee1275.rmk: Likewise * normal/cmdline.c: include grub/machine/console.h (grub_cmdline_get): support for special keys in grub-emu * normal/menu.c: include grub/machine/console.h (run_menu): support for special keys in grub-emu * util/console.c (grub_ncurses_getwh): New function * util/grub-emu.c: call to grub_hexcat_init() and grub_hexcat_fini() --------------020303040503090602080204 Content-Type: text/x-patch; name="hexcat.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="hexcat.patch" diff -urpN ./grub2_2/commands/hexcat.c ./grub2_3/commands/hexcat.c --- ./grub2_2/commands/hexcat.c 1970-01-01 01:00:00.000000000 +0100 +++ ./grub2_3/commands/hexcat.c 2005-08-08 15:48:43.000000000 +0200 @@ -0,0 +1,111 @@ +/* hexcat.c - command to show the contents of a file in hexadecimal */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2005 Free Software Foundation, Inc. + * Vladimir Serbinenko + * + * GRUB 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; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) + +{ + grub_file_t file; + char buf[16]; + unsigned int offset =3D 0; + grub_ssize_t size; + + if (argc !=3D 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + file =3D grub_file_open (args[0]); + if (! file) + return 0; + =20 + while ((size =3D grub_file_read (file, buf, sizeof (buf))) > 0) + { + int i; + + grub_printf ("%08x: ", offset); + + for (i =3D 0; i < size; i++) + { + unsigned int c =3D buf[i]; + =20 + grub_printf ("%02x ", c & 0xFF); + } + + for (; i < 16; i++) + grub_printf (" "); + =20 + for (i =3D 0; i < size; i++) + { + unsigned char c =3D buf[i]; + =20 + if (grub_isprint (c) || c =3D=3D ' ') + grub_putchar (c); + else + grub_putchar ('.'); + } + =20 + grub_putchar ('\n'); + + offset +=3D 16; + } + + grub_putchar ('\n'); + grub_refresh (); + grub_file_close (file); + =20 + return 0; +} + +=0C +#ifdef GRUB_UTIL +void +grub_hexcat_init (void) +{ + grub_register_command ("hexcat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,= + "hexcat FILE", "Show the contents of a file in hexadecimal.", 0); +} + +void +grub_hexcat_fini (void) +{ + grub_unregister_command ("hexcat"); +} +#else /* ! GRUB_UTIL */ +GRUB_MOD_INIT +{ + (void) mod; /* To stop warning. */ + grub_register_command ("hexcat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,= + "hexcat FILE", "Show the contents of a file ins hexadecimal.", 0); +} + +GRUB_MOD_FINI +{ + grub_unregister_command ("hexcat"); +} +#endif /* ! GRUB_UTIL */ diff -urpN ./grub2_2/conf/i386-pc.mk ./grub2_3/conf/i386-pc.mk --- ./grub2_2/conf/i386-pc.mk 2005-08-08 12:05:33.000000000 +0200 +++ ./grub2_3/conf/i386-pc.mk 2005-08-08 15:10:19.000000000 +0200 @@ -671,11 +671,11 @@ grub_probefs-fs_fshelp.d: fs/fshelp.c =20 =20 # For grub-emu. -grub_emu_SOURCES =3D commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ - commands/terminal.c commands/ls.c commands/timeout.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ - disk/loopback.c \ +grub_emu_SOURCES =3D commands/boot.c commands/cat.c commands/hexcat.c = \ + commands/cmp.c commands/configfile.c commands/default.c \ + commands/help.c commands/terminal.c commands/ls.c \ + commands/timeout.c commands/i386/pc/halt.c \ + commands/i386/pc/reboot.c disk/loopback.c \ fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c \ fs/minix.c fs/ufs.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ @@ -687,10 +687,10 @@ grub_emu_SOURCES =3D commands/boot.c comma util/console.c util/grub-emu.c util/misc.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/i386/pc/misc.c -CLEANFILES +=3D grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.= o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-command= s_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_em= u-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_i386_pc_hal= t.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-= fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_e= mu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o g= rub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-ke= rn_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub= _emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-ker= n_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal= _arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-norma= l_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal= _menu_entry.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-= partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util= _grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_em= u-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o -MOSTLYCLEANFILES +=3D grub_emu-commands_boot.d grub_emu-commands_cat.d g= rub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_d= efault.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-c= ommands_ls.d grub_emu-commands_timeout.d grub_emu-commands_i386_pc_halt.d= grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_= ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-= fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ufs.d grub= _emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_= env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_em= u-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_p= artition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_ar= g.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_c= ontext.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_me= nu_entry.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-par= tmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_gr= ub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-u= til_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d +CLEANFILES +=3D grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.= o grub_emu-commands_hexcat.o grub_emu-commands_cmp.o grub_emu-commands_co= nfigfile.o grub_emu-commands_default.o grub_emu-commands_help.o grub_emu-= commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_timeout.o gr= ub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_em= u-disk_loopback.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp= =2Eo grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-f= s_minix.o grub_emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o g= rub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_f= ile.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub= _emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_em= u-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-no= rmal_command.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-= normal_menu.o grub_emu-normal_menu_entry.o grub_emu-partmap_amiga.o grub_= emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu= -util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-ut= il_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_= pc_misc.o +MOSTLYCLEANFILES +=3D grub_emu-commands_boot.d grub_emu-commands_cat.d g= rub_emu-commands_hexcat.d grub_emu-commands_cmp.d grub_emu-commands_confi= gfile.d grub_emu-commands_default.d grub_emu-commands_help.d grub_emu-com= mands_terminal.d grub_emu-commands_ls.d grub_emu-commands_timeout.d grub_= emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-d= isk_loopback.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d = grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_min= ix.d grub_emu-fs_ufs.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_e= mu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d= grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-= kern_misc.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-ker= n_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_= command.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-norma= l_menu.d grub_emu-normal_menu_entry.d grub_emu-partmap_amiga.d grub_emu-p= artmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-util= _console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i3= 86_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_mi= sc.d =20 -grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-comm= ands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o gru= b_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o= grub_emu-commands_timeout.o grub_emu-commands_i386_pc_halt.o grub_emu-co= mmands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_ext2.o grub_= emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o= grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o grub_emu-kern_de= vice.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_e= mu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loade= r.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition.o g= rub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu= -normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_context.o gru= b_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o g= rub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o gr= ub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_emu.o gru= b_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_= getroot.o grub_emu-util_i386_pc_misc.o +grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-comm= ands_hexcat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub= _emu-commands_default.o grub_emu-commands_help.o grub_emu-commands_termin= al.o grub_emu-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands= _i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback= =2Eo grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-f= s_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_= emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl= =2Eo grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_em= u-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_mis= c.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o= grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.= o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o= grub_emu-normal_menu_entry.o grub_emu-partmap_amiga.o grub_emu-partmap_a= pple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console= =2Eo grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_= biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) =20 grub_emu-commands_boot.o: commands/boot.c @@ -709,6 +709,14 @@ grub_emu-commands_cat.d: commands/cat.c =20 -include grub_emu-commands_cat.d =20 +grub_emu-commands_hexcat.o: commands/hexcat.c + $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_C= FLAGS) -DGRUB_UTIL=3D1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-commands_hexcat.d: commands/hexcat.c + set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS= ) $(BUILD_CFLAGS) -DGRUB_UTIL=3D1 $(grub_emu_CFLAGS) -M $< | sed 's,he= xcat\.o[ :]*,grub_emu-commands_hexcat.o $@ : ,g' > $@; [ -s $@ ] || rm= -f $@ + +-include grub_emu-commands_hexcat.d + grub_emu-commands_cmp.o: commands/cmp.c $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_C= FLAGS) -DGRUB_UTIL=3D1 $(grub_emu_CFLAGS) -c -o $@ $< =20 @@ -1132,7 +1140,7 @@ pkgdata_MODULES =3D _chain.mod _linux.mod=20 terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod \ apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod \ help.mod default.mod timeout.mod configfile.mod sendkey.mod \ - activate.mod parttype.mod + activate.mod parttype.mod hexcat.mod =20 # For _chain.mod. _chain_mod_SOURCES =3D loader/i386/pc/chainloader.c @@ -2324,6 +2332,56 @@ fs-cat.lst: commands/cat.c genfslist.sh =20 cat_mod_CFLAGS =3D $(COMMON_CFLAGS) =20 +# For hexcat.mod. +hexcat_mod_SOURCES =3D commands/hexcat.c +CLEANFILES +=3D hexcat.mod mod-hexcat.o mod-hexcat.c pre-hexcat.o hexcat= _mod-commands_hexcat.o def-hexcat.lst und-hexcat.lst +MOSTLYCLEANFILES +=3D hexcat_mod-commands_hexcat.d +DEFSYMFILES +=3D def-hexcat.lst +UNDSYMFILES +=3D und-hexcat.lst + +hexcat.mod: pre-hexcat.o mod-hexcat.o + -rm -f $@ + $(LD) -r -d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R= .comment $@ + +pre-hexcat.o: hexcat_mod-commands_hexcat.o + -rm -f $@ + $(LD) -r -d -o $@ $^ + +mod-hexcat.o: mod-hexcat.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(hexcat_mod_CFLAGS) -c -o $@ $< + +mod-hexcat.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'hexcat' $< > $@ || (rm -f $@; exit 1) + +def-hexcat.lst: pre-hexcat.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hexcat/' > $@= + +und-hexcat.lst: pre-hexcat.o + echo 'hexcat' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +hexcat_mod-commands_hexcat.o: commands/hexcat.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(hexcat_mo= d_CFLAGS) -c -o $@ $< + +hexcat_mod-commands_hexcat.d: commands/hexcat.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -M $< | sed 's,hexcat\.o[ :]*,hexcat_mod-commands= _hexcat.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include hexcat_mod-commands_hexcat.d + +CLEANFILES +=3D cmd-hexcat.lst fs-hexcat.lst +COMMANDFILES +=3D cmd-hexcat.lst +FSFILES +=3D fs-hexcat.lst + +cmd-hexcat.lst: commands/hexcat.c gencmdlist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexcat > $@ ||= (rm -f $@; exit 1) + +fs-hexcat.lst: commands/hexcat.c genfslist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexcat > $@ || = (rm -f $@; exit 1) + + +hexcat_mod_CFLAGS =3D $(COMMON_CFLAGS) + # For help.mod. help_mod_SOURCES =3D commands/help.c CLEANFILES +=3D help.mod mod-help.o mod-help.c pre-help.o help_mod-comma= nds_help.o def-help.lst und-help.lst diff -urpN ./grub2_2/conf/i386-pc.rmk ./grub2_3/conf/i386-pc.rmk --- ./grub2_2/conf/i386-pc.rmk 2005-08-08 12:05:33.000000000 +0200 +++ ./grub2_3/conf/i386-pc.rmk 2005-08-08 15:08:59.000000000 +0200 @@ -75,11 +75,11 @@ grub_probefs_SOURCES =3D util/i386/pc/grub fs/hfs.c fs/jfs.c kern/fs.c kern/env.c fs/fshelp.c =20 # For grub-emu. -grub_emu_SOURCES =3D commands/boot.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/default.c commands/help.c \ - commands/terminal.c commands/ls.c commands/timeout.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ - disk/loopback.c \ +grub_emu_SOURCES =3D commands/boot.c commands/cat.c commands/hexcat.c = \ + commands/cmp.c commands/configfile.c commands/default.c \ + commands/help.c commands/terminal.c commands/ls.c \ + commands/timeout.c commands/i386/pc/halt.c \ + commands/i386/pc/reboot.c disk/loopback.c \ fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c \ fs/minix.c fs/ufs.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ @@ -110,7 +110,7 @@ pkgdata_MODULES =3D _chain.mod _linux.mod=20 terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod \ apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod \ help.mod default.mod timeout.mod configfile.mod sendkey.mod \ - activate.mod parttype.mod + activate.mod parttype.mod hexcat.mod =20 # For _chain.mod. _chain_mod_SOURCES =3D loader/i386/pc/chainloader.c @@ -203,6 +203,10 @@ cmp_mod_CFLAGS =3D $(COMMON_CFLAGS) cat_mod_SOURCES =3D commands/cat.c cat_mod_CFLAGS =3D $(COMMON_CFLAGS) =20 +# For hexcat.mod. +hexcat_mod_SOURCES =3D commands/hexcat.c +hexcat_mod_CFLAGS =3D $(COMMON_CFLAGS) + # For help.mod. help_mod_SOURCES =3D commands/help.c help_mod_CFLAGS =3D $(COMMON_CFLAGS) diff -urpN ./grub2_2/conf/powerpc-ieee1275.mk ./grub2_3/conf/powerpc-ieee= 1275.mk --- ./grub2_2/conf/powerpc-ieee1275.mk 2005-08-08 12:05:33.000000000 +020= 0 +++ ./grub2_3/conf/powerpc-ieee1275.mk 2005-08-08 15:10:20.000000000 +020= 0 @@ -67,7 +67,7 @@ grub_emu_SOURCES =3D commands/boot.c comma commands/configfile.c commands/default.c commands/help.c \ commands/terminal.c commands/ls.c commands/timeout.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ - disk/loopback.c \ + disk/loopback.c commands/hexcat.c \ fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c \ fs/minix.c fs/ufs.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ @@ -79,10 +79,10 @@ grub_emu_SOURCES =3D commands/boot.c comma util/console.c util/grub-emu.c util/misc.c \ util/i386/pc/biosdisk.c util/i386/pc/getroot.c \ util/powerpc/ieee1275/misc.c -CLEANFILES +=3D grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.= o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-command= s_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_em= u-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_ha= lt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_em= u-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub= _emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o= grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-= kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o gr= ub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-k= ern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-norm= al_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-nor= mal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-norm= al_menu_entry.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_em= u-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-ut= il_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_= emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o -MOSTLYCLEANFILES +=3D grub_emu-commands_boot.d grub_emu-commands_cat.d g= rub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_d= efault.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-c= ommands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.= d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-f= s_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_em= u-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ufs.d gr= ub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-ker= n_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_= emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern= _partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_= arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal= _context.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_= menu_entry.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-p= artmap_pc.d grub_emu-partmap_sun.d grub_emu-util_console.d grub_emu-util_= grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu= -util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d +CLEANFILES +=3D grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.= o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-command= s_default.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_em= u-commands_ls.o grub_emu-commands_timeout.o grub_emu-commands_ieee1275_ha= lt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_em= u-commands_hexcat.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshe= lp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-f= s_minix.o grub_emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o g= rub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_f= ile.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub= _emu-kern_misc.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_em= u-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-no= rmal_command.o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-= normal_menu.o grub_emu-normal_menu_entry.o grub_emu-partmap_amiga.o grub_= emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu= -util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-ut= il_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_power= pc_ieee1275_misc.o +MOSTLYCLEANFILES +=3D grub_emu-commands_boot.d grub_emu-commands_cat.d g= rub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_d= efault.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-c= ommands_ls.d grub_emu-commands_timeout.d grub_emu-commands_ieee1275_halt.= d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-c= ommands_hexcat.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.= d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_m= inix.d grub_emu-fs_ufs.d grub_emu-kern_device.d grub_emu-kern_disk.d grub= _emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file= =2Ed grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_= emu-kern_misc.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu= -kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-nor= mal_command.d grub_emu-normal_context.d grub_emu-normal_main.d grub_emu-n= ormal_menu.d grub_emu-normal_menu_entry.d grub_emu-partmap_amiga.d grub_e= mu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-= util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-uti= l_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerp= c_ieee1275_misc.d =20 -grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-comm= ands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o gru= b_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o= grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-c= ommands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_ext2.o gru= b_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660= =2Eo grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ufs.o grub_emu-ker= n_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o gr= ub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_l= oader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_partition= =2Eo grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o gr= ub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_context= =2Eo grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_e= ntry.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap= _pc.o grub_emu-partmap_sun.o grub_emu-util_console.o grub_emu-util_grub_e= mu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_= i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o +grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-comm= ands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_default.o gru= b_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o= grub_emu-commands_timeout.o grub_emu-commands_ieee1275_halt.o grub_emu-c= ommands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-commands_hexc= at.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-f= s_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_= emu-fs_ufs.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl= =2Eo grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_em= u-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_mis= c.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o= grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.= o grub_emu-normal_context.o grub_emu-normal_main.o grub_emu-normal_menu.o= grub_emu-normal_menu_entry.o grub_emu-partmap_amiga.o grub_emu-partmap_a= pple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-util_console= =2Eo grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_= biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275= _misc.o $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS) =20 grub_emu-commands_boot.o: commands/boot.c @@ -181,6 +181,14 @@ grub_emu-disk_loopback.d: disk/loopback. =20 -include grub_emu-disk_loopback.d =20 +grub_emu-commands_hexcat.o: commands/hexcat.c + $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_C= FLAGS) -DGRUB_UTIL=3D1 $(grub_emu_CFLAGS) -c -o $@ $< + +grub_emu-commands_hexcat.d: commands/hexcat.c + set -e; $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS= ) $(BUILD_CFLAGS) -DGRUB_UTIL=3D1 $(grub_emu_CFLAGS) -M $< | sed 's,he= xcat\.o[ :]*,grub_emu-commands_hexcat.o $@ : ,g' > $@; [ -s $@ ] || rm= -f $@ + +-include grub_emu-commands_hexcat.d + grub_emu-fs_ext2.o: fs/ext2.c $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRU= B_UTIL=3D1 $(grub_emu_CFLAGS) -c -o $@ $< =20 @@ -721,7 +729,7 @@ pkgdata_MODULES =3D _linux.mod linux.mod f hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - default.mod timeout.mod configfile.mod + default.mod timeout.mod configfile.mod hexcat.mod =20 # For fshelp.mod. fshelp_mod_SOURCES =3D fs/fshelp.c @@ -1664,6 +1672,56 @@ fs-cat.lst: commands/cat.c genfslist.sh =20 cat_mod_CFLAGS =3D $(COMMON_CFLAGS) =20 +# For hexcat.mod. +hexcat_mod_SOURCES =3D commands/hexcat.c +CLEANFILES +=3D hexcat.mod mod-hexcat.o mod-hexcat.c pre-hexcat.o hexcat= _mod-commands_hexcat.o def-hexcat.lst und-hexcat.lst +MOSTLYCLEANFILES +=3D hexcat_mod-commands_hexcat.d +DEFSYMFILES +=3D def-hexcat.lst +UNDSYMFILES +=3D und-hexcat.lst + +hexcat.mod: pre-hexcat.o mod-hexcat.o + -rm -f $@ + $(LD) -r -d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R= .comment $@ + +pre-hexcat.o: hexcat_mod-commands_hexcat.o + -rm -f $@ + $(LD) -r -d -o $@ $^ + +mod-hexcat.o: mod-hexcat.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(hexcat_mod_CFLAGS) -c -o $@ $< + +mod-hexcat.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'hexcat' $< > $@ || (rm -f $@; exit 1) + +def-hexcat.lst: pre-hexcat.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hexcat/' > $@= + +und-hexcat.lst: pre-hexcat.o + echo 'hexcat' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +hexcat_mod-commands_hexcat.o: commands/hexcat.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(hexcat_mo= d_CFLAGS) -c -o $@ $< + +hexcat_mod-commands_hexcat.d: commands/hexcat.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -M $< | sed 's,hexcat\.o[ :]*,hexcat_mod-commands= _hexcat.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include hexcat_mod-commands_hexcat.d + +CLEANFILES +=3D cmd-hexcat.lst fs-hexcat.lst +COMMANDFILES +=3D cmd-hexcat.lst +FSFILES +=3D fs-hexcat.lst + +cmd-hexcat.lst: commands/hexcat.c gencmdlist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexcat > $@ ||= (rm -f $@; exit 1) + +fs-hexcat.lst: commands/hexcat.c genfslist.sh + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) = $(hexcat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexcat > $@ || = (rm -f $@; exit 1) + + +hexcat_mod_CFLAGS =3D $(COMMON_CFLAGS) + # For font.mod. font_mod_SOURCES =3D font/manager.c CLEANFILES +=3D font.mod mod-font.o mod-font.c pre-font.o font_mod-font_= manager.o def-font.lst und-font.lst diff -urpN ./grub2_2/conf/powerpc-ieee1275.rmk ./grub2_3/conf/powerpc-iee= e1275.rmk --- ./grub2_2/conf/powerpc-ieee1275.rmk 2005-08-08 12:05:33.000000000 +02= 00 +++ ./grub2_3/conf/powerpc-ieee1275.rmk 2005-08-08 15:10:12.000000000 +02= 00 @@ -37,7 +37,7 @@ grub_emu_SOURCES =3D commands/boot.c comma commands/configfile.c commands/default.c commands/help.c \ commands/terminal.c commands/ls.c commands/timeout.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ - disk/loopback.c \ + disk/loopback.c commands/hexcat.c \ fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c fs/jfs.c \ fs/minix.c fs/ufs.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ @@ -73,7 +73,7 @@ pkgdata_MODULES =3D _linux.mod linux.mod f hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - default.mod timeout.mod configfile.mod + default.mod timeout.mod configfile.mod hexcat.mod =20 # For fshelp.mod. fshelp_mod_SOURCES =3D fs/fshelp.c @@ -147,6 +147,10 @@ cmp_mod_CFLAGS =3D $(COMMON_CFLAGS) cat_mod_SOURCES =3D commands/cat.c cat_mod_CFLAGS =3D $(COMMON_CFLAGS) =20 +# For hexcat.mod. +hexcat_mod_SOURCES =3D commands/hexcat.c +hexcat_mod_CFLAGS =3D $(COMMON_CFLAGS) + # For font.mod. font_mod_SOURCES =3D font/manager.c font_mod_CFLAGS =3D $(COMMON_CFLAGS) diff -urpN ./grub2_2/normal/cmdline.c ./grub2_3/normal/cmdline.c --- ./grub2_2/normal/cmdline.c 2005-08-08 12:05:42.000000000 +0200 +++ ./grub2_3/normal/cmdline.c 2005-08-08 16:34:09.000000000 +0200 @@ -27,6 +27,7 @@ #include #include #include +#include =20 static char *kill_buf; =20 @@ -474,7 +475,7 @@ grub_cmdline_get (const char *prompt, ch grub_size_t lpos, llen; grub_size_t plen; char buf[max_len]; - int key; + int key, key0; int histpos =3D 0; auto void cl_insert (const char *str); auto void cl_delete (unsigned len); @@ -564,18 +565,20 @@ grub_cmdline_get (const char *prompt, ch if (hist_used =3D=3D 0) grub_history_add (buf); =20 - while ((key =3D GRUB_TERM_ASCII_CHAR (grub_getkey ())) !=3D '\n' && ke= y !=3D '\r') + while ((key =3D GRUB_TERM_ASCII_CHAR (key0 =3D grub_getkey ())) !=3D '= \n' && key !=3D '\r') { if (readline) { switch (key) { case 1: /* Ctrl-a */ + key_home: lpos =3D 0; cl_set_pos (); break; =20 case 2: /* Ctrl-b */ + key_left: if (lpos > 0) { lpos--; @@ -584,11 +587,13 @@ grub_cmdline_get (const char *prompt, ch break; =20 case 5: /* Ctrl-e */ + key_end: lpos =3D llen; cl_set_pos (); break; =20 case 6: /* Ctrl-f */ + key_right: if (lpos < llen) { lpos++; @@ -641,6 +646,7 @@ grub_cmdline_get (const char *prompt, ch break; =20 case 14: /* Ctrl-n */ + key_down: { char *hist; =20 @@ -658,7 +664,9 @@ grub_cmdline_get (const char *prompt, ch =20 break; } + case 16: /* Ctrl-p */ + key_up: { char *hist; =20 @@ -703,6 +711,28 @@ grub_cmdline_get (const char *prompt, ch if (kill_buf) cl_insert (kill_buf); break; + =20 + default: + switch (key0) + { + case GRUB_CONSOLE_KEY_HOME: + goto key_home; + + case GRUB_CONSOLE_KEY_END: + goto key_end; + + case GRUB_CONSOLE_KEY_LEFT: + goto key_left; + + case GRUB_CONSOLE_KEY_RIGHT: + goto key_right; + + case GRUB_CONSOLE_KEY_UP: + goto key_up; + + case GRUB_CONSOLE_KEY_DOWN: + goto key_down; + } } } =20 diff -urpN ./grub2_2/normal/menu.c ./grub2_3/normal/menu.c --- ./grub2_2/normal/menu.c 2005-08-08 12:05:42.000000000 +0200 +++ ./grub2_3/normal/menu.c 2005-08-08 16:16:30.000000000 +0200 @@ -23,6 +23,7 @@ #include #include #include +#include =20 static void draw_border (void) @@ -195,7 +196,7 @@ run_menu (grub_menu_t menu, int nested) =20 while (1) { - int c; + int c, c0; =20 if (menu->timeout > 0) { @@ -226,7 +227,7 @@ run_menu (grub_menu_t menu, int nested) =20 if (grub_checkkey () >=3D 0 || menu->timeout < 0) { - c =3D GRUB_TERM_ASCII_CHAR (grub_getkey ()); + c =3D GRUB_TERM_ASCII_CHAR (c0 =3D grub_getkey ()); =20 if (menu->timeout >=3D 0) { @@ -242,6 +243,7 @@ run_menu (grub_menu_t menu, int nested) { case 16: case '^': + key_up: if (offset > 0) { print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 0, @@ -259,6 +261,7 @@ run_menu (grub_menu_t menu, int nested) =20 case 14: case 'v': + key_down: if (menu->size > first + offset + 1) { if (offset < GRUB_TERM_NUM_ENTRIES - 1) @@ -300,6 +303,17 @@ run_menu (grub_menu_t menu, int nested) goto refresh; =20 default: + + switch (c0) + { + case GRUB_CONSOLE_KEY_DOWN: + goto key_down; + + case GRUB_CONSOLE_KEY_UP: + goto key_up; + + } + break; } =20 diff -urpN ./grub2_2/util/console.c ./grub2_3/util/console.c --- ./grub2_2/util/console.c 2005-08-08 12:05:42.000000000 +0200 +++ ./grub2_3/util/console.c 2005-08-08 15:42:52.000000000 +0200 @@ -258,6 +258,12 @@ grub_ncurses_init (void) return 0; } =20 +static grub_uint16_t +grub_ncurses_getwh (void) +{ + return (getmaxx (stdscr) << 8) | getmaxy (stdscr); +} + static grub_err_t grub_ncurses_fini (void) { @@ -274,6 +280,7 @@ static struct grub_term grub_ncurses_ter .putchar =3D grub_ncurses_putchar, .checkkey =3D grub_ncurses_checkkey, .getkey =3D grub_ncurses_getkey, + .getwh =3D grub_ncurses_getwh, .getxy =3D grub_ncurses_getxy, .gotoxy =3D grub_ncurses_gotoxy, .cls =3D grub_ncurses_cls, diff -urpN ./grub2_2/util/grub-emu.c ./grub2_3/util/grub-emu.c --- ./grub2_2/util/grub-emu.c 2005-08-08 12:05:42.000000000 +0200 +++ ./grub2_3/util/grub-emu.c 2005-08-08 15:15:05.000000000 +0200 @@ -186,6 +186,7 @@ main (int argc, char *argv[]) grub_boot_init (); grub_cmp_init (); grub_cat_init (); + grub_hexcat_init (); grub_terminal_init (); grub_loop_init (); grub_help_init (); @@ -219,6 +220,7 @@ main (int argc, char *argv[]) grub_fat_fini (); grub_boot_fini (); grub_cmp_fini (); + grub_hexcat_fini (); grub_cat_fini (); grub_terminal_fini (); grub_amiga_partition_map_fini (); --------------020303040503090602080204--