Skip to content

Commit 47d2d65

Browse files
author
okuji
committed
2005-09-03 Yoshinori K. Okuji <[email protected]>
* normal/completion.c (complete_arguments): Add the qualifier const into OPTIONS. From Omniflux <[email protected]>: * include/grub/terminfo.h: New file. * include/grub/tparm.h: Likewise. * include/grub/i386/pc/serial.h: Likewise. * term/terminfo.c: Likewise. * term/tparm.c: Likewise. * term/i386/pc/serial.c: Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added terminfo.mod and serial.mod. (terminfo_mod_SOURCES): New variable. (terminfo_mod_CFLAGS): Likewise. (serial_mod_SOURCES): Likewise. (serial_mod_CFLAGS): Likewise.
1 parent 48b671f commit 47d2d65

File tree

12 files changed

+1892
-4
lines changed

12 files changed

+1892
-4
lines changed

AUTHORS

+13
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@ in ext2fs.
88

99
Marco Gerards added ext2fs support, grub-emu, a new command-line
1010
engine, and fixed many bugs.
11+
12+
Omniflux added terminfo and serial support.
13+
14+
Vincent Pelletier added Sparc64 support.
15+
16+
Hollis Blanchard implemented many parts of PowerPC support.
17+
18+
Tomas Ebenlendr added the command chainloader into the normal mode,
19+
fixed some bugs.
20+
21+
Guillem Jover merged architecture-independent ELF support code.
22+
23+
Vesa Jaaskelainen added VBE support.

ChangeLog

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2005-09-03 Yoshinori K. Okuji <[email protected]>
2+
3+
* normal/completion.c (complete_arguments): Add the qualifier
4+
const into OPTIONS.
5+
6+
From Omniflux <[email protected]>:
7+
* include/grub/terminfo.h: New file.
8+
* include/grub/tparm.h: Likewise.
9+
* include/grub/i386/pc/serial.h: Likewise.
10+
* term/terminfo.c: Likewise.
11+
* term/tparm.c: Likewise.
12+
* term/i386/pc/serial.c: Likewise.
13+
* conf/i386-pc.rmk (pkgdata_MODULES): Added terminfo.mod and
14+
serial.mod.
15+
(terminfo_mod_SOURCES): New variable.
16+
(terminfo_mod_CFLAGS): Likewise.
17+
(serial_mod_SOURCES): Likewise.
18+
(serial_mod_CFLAGS): Likewise.
19+
120
2005-08-31 Yoshinori K. Okuji <[email protected]>
221

322
* DISTLIST: Replaced boot/powerpc/ieee1275/crt0.S and

THANKS

+2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ Johan Rydberg <[email protected]>
1212
Hollis Blanchard <[email protected]>
1313
Marco Gerards <[email protected]>
1414
NIIBE Yutaka <[email protected]>
15+
1516
Robert Bihlmeyer <[email protected]>
1617
Ruslan Nikolaev <[email protected]>
1718
Timothy Baldwin <[email protected]>
1819
Tomas Ebenlendr <[email protected]>
1920
Tsuneyoshi Yasuo <[email protected]>
21+
Vesa Jaaskelainen <[email protected]>
2022
Vincent Guffens <[email protected]>
2123
Vincent Pelletier <[email protected]>
2224
Vladimir Serbinenko <[email protected]>

conf/i386-pc.mk

+121-1
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,8 @@ pkgdata_MODULES = _chain.mod _linux.mod linux.mod fat.mod ufs.mod \
11681168
terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod \
11691169
apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod \
11701170
help.mod default.mod timeout.mod configfile.mod vbe.mod \
1171-
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod
1171+
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod \
1172+
terminfo.mod serial.mod
11721173

11731174
# For _chain.mod.
11741175
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
@@ -2499,6 +2500,125 @@ fs-manager.lst: font/manager.c genfslist.sh
24992500

25002501
font_mod_CFLAGS = $(COMMON_CFLAGS)
25012502

2503+
# For terminfo.mod.
2504+
terminfo_mod_SOURCES = term/terminfo.c term/tparm.c
2505+
CLEANFILES += terminfo.mod mod-terminfo.o mod-terminfo.c pre-terminfo.o terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o def-terminfo.lst und-terminfo.lst
2506+
MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d
2507+
DEFSYMFILES += def-terminfo.lst
2508+
UNDSYMFILES += und-terminfo.lst
2509+
2510+
terminfo.mod: pre-terminfo.o mod-terminfo.o
2511+
-rm -f $@
2512+
$(LD) -r -d -o $@ $^
2513+
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
2514+
2515+
pre-terminfo.o: terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o
2516+
-rm -f $@
2517+
$(LD) -r -d -o $@ $^
2518+
2519+
mod-terminfo.o: mod-terminfo.c
2520+
$(CC) $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
2521+
2522+
mod-terminfo.c: moddep.lst genmodsrc.sh
2523+
sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1)
2524+
2525+
def-terminfo.lst: pre-terminfo.o
2526+
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminfo/' > $@
2527+
2528+
und-terminfo.lst: pre-terminfo.o
2529+
echo 'terminfo' > $@
2530+
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2531+
2532+
terminfo_mod-term_terminfo.o: term/terminfo.c
2533+
$(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
2534+
2535+
terminfo_mod-term_terminfo.d: term/terminfo.c
2536+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $< | sed 's,terminfo\.o[ :]*,terminfo_mod-term_terminfo.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2537+
2538+
-include terminfo_mod-term_terminfo.d
2539+
2540+
CLEANFILES += cmd-terminfo.lst fs-terminfo.lst
2541+
COMMANDFILES += cmd-terminfo.lst
2542+
FSFILES += fs-terminfo.lst
2543+
2544+
cmd-terminfo.lst: term/terminfo.c gencmdlist.sh
2545+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
2546+
2547+
fs-terminfo.lst: term/terminfo.c genfslist.sh
2548+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
2549+
2550+
2551+
terminfo_mod-term_tparm.o: term/tparm.c
2552+
$(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
2553+
2554+
terminfo_mod-term_tparm.d: term/tparm.c
2555+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $< | sed 's,tparm\.o[ :]*,terminfo_mod-term_tparm.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2556+
2557+
-include terminfo_mod-term_tparm.d
2558+
2559+
CLEANFILES += cmd-tparm.lst fs-tparm.lst
2560+
COMMANDFILES += cmd-tparm.lst
2561+
FSFILES += fs-tparm.lst
2562+
2563+
cmd-tparm.lst: term/tparm.c gencmdlist.sh
2564+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
2565+
2566+
fs-tparm.lst: term/tparm.c genfslist.sh
2567+
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
2568+
2569+
2570+
terminfo_mod_CFLAGS = $(COMMON_CFLAGS)
2571+
2572+
# For serial.mod.
2573+
serial_mod_SOURCES = term/i386/pc/serial.c
2574+
CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o def-serial.lst und-serial.lst
2575+
MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d
2576+
DEFSYMFILES += def-serial.lst
2577+
UNDSYMFILES += und-serial.lst
2578+
2579+
serial.mod: pre-serial.o mod-serial.o
2580+
-rm -f $@
2581+
$(LD) -r -d -o $@ $^
2582+
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
2583+
2584+
pre-serial.o: serial_mod-term_i386_pc_serial.o
2585+
-rm -f $@
2586+
$(LD) -r -d -o $@ $^
2587+
2588+
mod-serial.o: mod-serial.c
2589+
$(CC) $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $<
2590+
2591+
mod-serial.c: moddep.lst genmodsrc.sh
2592+
sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1)
2593+
2594+
def-serial.lst: pre-serial.o
2595+
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 serial/' > $@
2596+
2597+
und-serial.lst: pre-serial.o
2598+
echo 'serial' > $@
2599+
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2600+
2601+
serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c
2602+
$(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $<
2603+
2604+
serial_mod-term_i386_pc_serial.d: term/i386/pc/serial.c
2605+
set -e; $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -M $< | sed 's,serial\.o[ :]*,serial_mod-term_i386_pc_serial.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2606+
2607+
-include serial_mod-term_i386_pc_serial.d
2608+
2609+
CLEANFILES += cmd-serial.lst fs-serial.lst
2610+
COMMANDFILES += cmd-serial.lst
2611+
FSFILES += fs-serial.lst
2612+
2613+
cmd-serial.lst: term/i386/pc/serial.c gencmdlist.sh
2614+
set -e; $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1)
2615+
2616+
fs-serial.lst: term/i386/pc/serial.c genfslist.sh
2617+
set -e; $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1)
2618+
2619+
2620+
serial_mod_CFLAGS = $(COMMON_CFLAGS)
2621+
25022622
# For _multiboot.mod.
25032623
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
25042624
CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o def-_multiboot.lst und-_multiboot.lst

conf/i386-pc.rmk

+10-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ pkgdata_MODULES = _chain.mod _linux.mod linux.mod fat.mod ufs.mod \
114114
terminal.mod fshelp.mod chain.mod multiboot.mod amiga.mod \
115115
apple.mod pc.mod sun.mod loopback.mod reboot.mod halt.mod \
116116
help.mod default.mod timeout.mod configfile.mod vbe.mod \
117-
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod
117+
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod \
118+
terminfo.mod serial.mod
118119

119120
# For _chain.mod.
120121
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
@@ -216,6 +217,14 @@ vga_mod_CFLAGS = $(COMMON_CFLAGS)
216217
font_mod_SOURCES = font/manager.c
217218
font_mod_CFLAGS = $(COMMON_CFLAGS)
218219

220+
# For terminfo.mod.
221+
terminfo_mod_SOURCES = term/terminfo.c term/tparm.c
222+
terminfo_mod_CFLAGS = $(COMMON_CFLAGS)
223+
224+
# For serial.mod.
225+
serial_mod_SOURCES = term/i386/pc/serial.c
226+
serial_mod_CFLAGS = $(COMMON_CFLAGS)
227+
219228
# For _multiboot.mod.
220229
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
221230
_multiboot_mod_CFLAGS = $(COMMON_CFLAGS)

include/grub/i386/pc/serial.h

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/* serial.h - serial device interface */
2+
/*
3+
* GRUB -- GRand Unified Bootloader
4+
* Copyright (C) 2000,2001,2002,2005 Free Software Foundation, Inc.
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation; either version 2 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program; if not, write to the Free Software
18+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19+
*/
20+
21+
#ifndef GRUB_SERIAL_MACHINE_HEADER
22+
#define GRUB_SERIAL_MACHINE_HEADER 1
23+
24+
/* Macros. */
25+
26+
/* The offsets of UART registers. */
27+
#define UART_TX 0
28+
#define UART_RX 0
29+
#define UART_DLL 0
30+
#define UART_IER 1
31+
#define UART_DLH 1
32+
#define UART_IIR 2
33+
#define UART_FCR 2
34+
#define UART_LCR 3
35+
#define UART_MCR 4
36+
#define UART_LSR 5
37+
#define UART_MSR 6
38+
#define UART_SR 7
39+
40+
/* For LSR bits. */
41+
#define UART_DATA_READY 0x01
42+
#define UART_EMPTY_TRANSMITTER 0x20
43+
44+
/* The type of parity. */
45+
#define UART_NO_PARITY 0x00
46+
#define UART_ODD_PARITY 0x08
47+
#define UART_EVEN_PARITY 0x18
48+
49+
/* The type of word length. */
50+
#define UART_5BITS_WORD 0x00
51+
#define UART_6BITS_WORD 0x01
52+
#define UART_7BITS_WORD 0x02
53+
#define UART_8BITS_WORD 0x03
54+
55+
/* The type of the length of stop bit. */
56+
#define UART_1_STOP_BIT 0x00
57+
#define UART_2_STOP_BITS 0x04
58+
59+
/* the switch of DLAB. */
60+
#define UART_DLAB 0x80
61+
62+
/* Enable the FIFO. */
63+
#define UART_ENABLE_FIFO 0xC7
64+
65+
/* Turn on DTR, RTS, and OUT2. */
66+
#define UART_ENABLE_MODEM 0x0B
67+
68+
#endif /* ! GRUB_SERIAL_MACHINE_HEADER */

include/grub/terminfo.h

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* GRUB -- GRand Unified Bootloader
3+
* Copyright (C) 2002,2003,2005 Free Software Foundation, Inc.
4+
*
5+
* GRUB is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with GRUB; if not, write to the Free Software
17+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18+
*/
19+
20+
#ifndef GRUB_TERMINFO_HEADER
21+
#define GRUB_TERMINFO_HEADER 1
22+
23+
#include <grub/err.h>
24+
#include <grub/types.h>
25+
26+
char *grub_terminfo_get_current (void);
27+
grub_err_t grub_terminfo_set_current (const char *);
28+
29+
void grub_terminfo_gotoxy (grub_uint8_t x, grub_uint8_t y);
30+
void grub_terminfo_cls (void);
31+
void grub_terminfo_reverse_video_on (void);
32+
void grub_terminfo_reverse_video_off (void);
33+
void grub_terminfo_cursor_on (void);
34+
void grub_terminfo_cursor_off (void);
35+
36+
#endif /* ! GRUB_TERMINFO_HEADER */

include/grub/tparm.h

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* tparm.h - parameter formatting of terminfo */
2+
/*
3+
* GRUB -- GRand Unified Bootloader
4+
* Copyright (C) 2002,2005 Free Software Foundation, Inc.
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation; either version 2 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program; if not, write to the Free Software
18+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19+
*/
20+
21+
#ifndef GRUB_TPARM_HEADER
22+
#define GRUB_TPARM_HEADER 1
23+
24+
/* Function prototypes. */
25+
char *grub_terminfo_tparm (const char *string, ...);
26+
27+
#endif /* ! GRUB_TPARM_HEADER */

normal/completion.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int
308308
complete_arguments (char *command)
309309
{
310310
grub_command_t cmd;
311-
struct grub_arg_option *option;
311+
const struct grub_arg_option *option;
312312
char shortarg[] = "- ";
313313

314314
cmd = grub_command_find (command);
@@ -322,7 +322,7 @@ complete_arguments (char *command)
322322
/* Add the short arguments. */
323323
for (option = cmd->options; option->doc; option++)
324324
{
325-
if (!option->shortarg)
325+
if (! option->shortarg)
326326
continue;
327327

328328
shortarg[1] = option->shortarg;

0 commit comments

Comments
 (0)