Skip to content

Commit

Permalink
2005-09-03 Yoshinori K. Okuji <[email protected]>
Browse files Browse the repository at this point in the history
        * 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.
  • Loading branch information
okuji committed Sep 3, 2005
1 parent 48b671f commit 47d2d65
Show file tree
Hide file tree
Showing 12 changed files with 1,892 additions and 4 deletions.
13 changes: 13 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ in ext2fs.

Marco Gerards added ext2fs support, grub-emu, a new command-line
engine, and fixed many bugs.

Omniflux added terminfo and serial support.

Vincent Pelletier added Sparc64 support.

Hollis Blanchard implemented many parts of PowerPC support.

Tomas Ebenlendr added the command chainloader into the normal mode,
fixed some bugs.

Guillem Jover merged architecture-independent ELF support code.

Vesa Jaaskelainen added VBE support.
19 changes: 19 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
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.

2005-08-31 Yoshinori K. Okuji <[email protected]>

* DISTLIST: Replaced boot/powerpc/ieee1275/crt0.S and
Expand Down
2 changes: 2 additions & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Johan Rydberg <[email protected]>
Hollis Blanchard <[email protected]>
Marco Gerards <[email protected]>
NIIBE Yutaka <[email protected]>
Omniflux <[email protected]>
Robert Bihlmeyer <[email protected]>
Ruslan Nikolaev <[email protected]>
Timothy Baldwin <[email protected]>
Tomas Ebenlendr <[email protected]>
Tsuneyoshi Yasuo <[email protected]>
Vesa Jaaskelainen <[email protected]>
Vincent Guffens <[email protected]>
Vincent Pelletier <[email protected]>
Vladimir Serbinenko <[email protected]>
Expand Down
122 changes: 121 additions & 1 deletion conf/i386-pc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,8 @@ pkgdata_MODULES = _chain.mod _linux.mod linux.mod fat.mod ufs.mod \
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 vbe.mod \
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod \
terminfo.mod serial.mod

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

font_mod_CFLAGS = $(COMMON_CFLAGS)

# For terminfo.mod.
terminfo_mod_SOURCES = term/terminfo.c term/tparm.c
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
MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d
DEFSYMFILES += def-terminfo.lst
UNDSYMFILES += und-terminfo.lst

terminfo.mod: pre-terminfo.o mod-terminfo.o
-rm -f $@
$(LD) -r -d -o $@ $^
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@

pre-terminfo.o: terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o
-rm -f $@
$(LD) -r -d -o $@ $^

mod-terminfo.o: mod-terminfo.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<

mod-terminfo.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1)

def-terminfo.lst: pre-terminfo.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminfo/' > $@

und-terminfo.lst: pre-terminfo.o
echo 'terminfo' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@

terminfo_mod-term_terminfo.o: term/terminfo.c
$(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<

terminfo_mod-term_terminfo.d: term/terminfo.c
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 $@

-include terminfo_mod-term_terminfo.d

CLEANFILES += cmd-terminfo.lst fs-terminfo.lst
COMMANDFILES += cmd-terminfo.lst
FSFILES += fs-terminfo.lst

cmd-terminfo.lst: term/terminfo.c gencmdlist.sh
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)

fs-terminfo.lst: term/terminfo.c genfslist.sh
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)


terminfo_mod-term_tparm.o: term/tparm.c
$(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<

terminfo_mod-term_tparm.d: term/tparm.c
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 $@

-include terminfo_mod-term_tparm.d

CLEANFILES += cmd-tparm.lst fs-tparm.lst
COMMANDFILES += cmd-tparm.lst
FSFILES += fs-tparm.lst

cmd-tparm.lst: term/tparm.c gencmdlist.sh
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)

fs-tparm.lst: term/tparm.c genfslist.sh
set -e; $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)


terminfo_mod_CFLAGS = $(COMMON_CFLAGS)

# For serial.mod.
serial_mod_SOURCES = term/i386/pc/serial.c
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
MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d
DEFSYMFILES += def-serial.lst
UNDSYMFILES += und-serial.lst

serial.mod: pre-serial.o mod-serial.o
-rm -f $@
$(LD) -r -d -o $@ $^
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@

pre-serial.o: serial_mod-term_i386_pc_serial.o
-rm -f $@
$(LD) -r -d -o $@ $^

mod-serial.o: mod-serial.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $<

mod-serial.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1)

def-serial.lst: pre-serial.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 serial/' > $@

und-serial.lst: pre-serial.o
echo 'serial' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@

serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c
$(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $<

serial_mod-term_i386_pc_serial.d: term/i386/pc/serial.c
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 $@

-include serial_mod-term_i386_pc_serial.d

CLEANFILES += cmd-serial.lst fs-serial.lst
COMMANDFILES += cmd-serial.lst
FSFILES += fs-serial.lst

cmd-serial.lst: term/i386/pc/serial.c gencmdlist.sh
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)

fs-serial.lst: term/i386/pc/serial.c genfslist.sh
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)


serial_mod_CFLAGS = $(COMMON_CFLAGS)

# For _multiboot.mod.
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
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
Expand Down
11 changes: 10 additions & 1 deletion conf/i386-pc.rmk
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ pkgdata_MODULES = _chain.mod _linux.mod linux.mod fat.mod ufs.mod \
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 vbe.mod \
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod
vesafb.mod vbetest.mod vbeinfo.mod search.mod gzio.mod \
terminfo.mod serial.mod

# For _chain.mod.
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
Expand Down Expand Up @@ -216,6 +217,14 @@ vga_mod_CFLAGS = $(COMMON_CFLAGS)
font_mod_SOURCES = font/manager.c
font_mod_CFLAGS = $(COMMON_CFLAGS)

# For terminfo.mod.
terminfo_mod_SOURCES = term/terminfo.c term/tparm.c
terminfo_mod_CFLAGS = $(COMMON_CFLAGS)

# For serial.mod.
serial_mod_SOURCES = term/i386/pc/serial.c
serial_mod_CFLAGS = $(COMMON_CFLAGS)

# For _multiboot.mod.
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
_multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
Expand Down
68 changes: 68 additions & 0 deletions include/grub/i386/pc/serial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* serial.h - serial device interface */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000,2001,2002,2005 Free Software Foundation, Inc.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef GRUB_SERIAL_MACHINE_HEADER
#define GRUB_SERIAL_MACHINE_HEADER 1

/* Macros. */

/* The offsets of UART registers. */
#define UART_TX 0
#define UART_RX 0
#define UART_DLL 0
#define UART_IER 1
#define UART_DLH 1
#define UART_IIR 2
#define UART_FCR 2
#define UART_LCR 3
#define UART_MCR 4
#define UART_LSR 5
#define UART_MSR 6
#define UART_SR 7

/* For LSR bits. */
#define UART_DATA_READY 0x01
#define UART_EMPTY_TRANSMITTER 0x20

/* The type of parity. */
#define UART_NO_PARITY 0x00
#define UART_ODD_PARITY 0x08
#define UART_EVEN_PARITY 0x18

/* The type of word length. */
#define UART_5BITS_WORD 0x00
#define UART_6BITS_WORD 0x01
#define UART_7BITS_WORD 0x02
#define UART_8BITS_WORD 0x03

/* The type of the length of stop bit. */
#define UART_1_STOP_BIT 0x00
#define UART_2_STOP_BITS 0x04

/* the switch of DLAB. */
#define UART_DLAB 0x80

/* Enable the FIFO. */
#define UART_ENABLE_FIFO 0xC7

/* Turn on DTR, RTS, and OUT2. */
#define UART_ENABLE_MODEM 0x0B

#endif /* ! GRUB_SERIAL_MACHINE_HEADER */
36 changes: 36 additions & 0 deletions include/grub/terminfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005 Free Software Foundation, Inc.
*
* 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.
*/

#ifndef GRUB_TERMINFO_HEADER
#define GRUB_TERMINFO_HEADER 1

#include <grub/err.h>
#include <grub/types.h>

char *grub_terminfo_get_current (void);
grub_err_t grub_terminfo_set_current (const char *);

void grub_terminfo_gotoxy (grub_uint8_t x, grub_uint8_t y);
void grub_terminfo_cls (void);
void grub_terminfo_reverse_video_on (void);
void grub_terminfo_reverse_video_off (void);
void grub_terminfo_cursor_on (void);
void grub_terminfo_cursor_off (void);

#endif /* ! GRUB_TERMINFO_HEADER */
27 changes: 27 additions & 0 deletions include/grub/tparm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* tparm.h - parameter formatting of terminfo */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2005 Free Software Foundation, Inc.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef GRUB_TPARM_HEADER
#define GRUB_TPARM_HEADER 1

/* Function prototypes. */
char *grub_terminfo_tparm (const char *string, ...);

#endif /* ! GRUB_TPARM_HEADER */
4 changes: 2 additions & 2 deletions normal/completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int
complete_arguments (char *command)
{
grub_command_t cmd;
struct grub_arg_option *option;
const struct grub_arg_option *option;
char shortarg[] = "- ";

cmd = grub_command_find (command);
Expand All @@ -322,7 +322,7 @@ complete_arguments (char *command)
/* Add the short arguments. */
for (option = cmd->options; option->doc; option++)
{
if (!option->shortarg)
if (! option->shortarg)
continue;

shortarg[1] = option->shortarg;
Expand Down
Loading

0 comments on commit 47d2d65

Please sign in to comment.