2009-12-20 Robert Millan <rmh.grub@aybabtu.com>

* kern/mips/yeeloong/init.c (grub_video_sm712_init)
	(grub_video_video_init, grub_video_bitmap_init)
	(grub_font_manager_init, grub_term_gfxterm_init)
	(grub_at_keyboard_init): New extern declarations.
	(grub_machine_init): Initialize gfxterm and at_keyboard.
	
	* kern/main.c (grub_main): Revert grub_printf delay kludge.
	
	* util/grub-install.in: Revert embed of `at_keyboard.mod' and
	`gfxterm.mod' into core image.
	
	* conf/mips.rmk (pkglib_IMAGES, kernel_img_SOURCES)
	(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
	(kernel_img_FORMAT): Copy to ...
	
	* conf/mips-qemu-mips.rmk (pkglib_IMAGES, kernel_img_SOURCES)
	(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
	(kernel_img_FORMAT): ... here, and ...
	
	* conf/mips-yeeloong.rmk (pkglib_IMAGES, kernel_img_SOURCES)
	(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
	(kernel_img_FORMAT): ... here.
	
	(kernel_img_SOURCES): Add files necessary for output (gfxterm)
	and input (at_keyboard) terminals in kernel.
	(kernel_img_CFLAGS): Add `-DUSE_ASCII_FAILBACK'.
	
	(pkglib_MODULES): Remove `pci.mod'.
	(pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS)
	(sm712_mod_SOURCES, sm712_mod_CFLAGS, sm712_mod_LDFLAGS)
	(at_keyboard_mod_SOURCES, at_keyboard_mod_CFLAGS)
	(at_keyboard_mod_LDFLAGS): Remove variables.
This commit is contained in:
Robert Millan 2010-01-20 01:19:53 +00:00
parent ca2a220a74
commit e3538adaea
7 changed files with 100 additions and 46 deletions

View file

@ -1,3 +1,38 @@
2009-12-20 Robert Millan <rmh.grub@aybabtu.com>
* kern/mips/yeeloong/init.c (grub_video_sm712_init)
(grub_video_video_init, grub_video_bitmap_init)
(grub_font_manager_init, grub_term_gfxterm_init)
(grub_at_keyboard_init): New extern declarations.
(grub_machine_init): Initialize gfxterm and at_keyboard.
* kern/main.c (grub_main): Revert grub_printf delay kludge.
* util/grub-install.in: Revert embed of `at_keyboard.mod' and
`gfxterm.mod' into core image.
* conf/mips.rmk (pkglib_IMAGES, kernel_img_SOURCES)
(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
(kernel_img_FORMAT): Copy to ...
* conf/mips-qemu-mips.rmk (pkglib_IMAGES, kernel_img_SOURCES)
(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
(kernel_img_FORMAT): ... here, and ...
* conf/mips-yeeloong.rmk (pkglib_IMAGES, kernel_img_SOURCES)
(kernel_img_CFLAGS, kernel_img_ASFLAGS, kernel_img_LDFLAGS)
(kernel_img_FORMAT): ... here.
(kernel_img_SOURCES): Add files necessary for output (gfxterm)
and input (at_keyboard) terminals in kernel.
(kernel_img_CFLAGS): Add `-DUSE_ASCII_FAILBACK'.
(pkglib_MODULES): Remove `pci.mod'.
(pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS)
(sm712_mod_SOURCES, sm712_mod_CFLAGS, sm712_mod_LDFLAGS)
(at_keyboard_mod_SOURCES, at_keyboard_mod_CFLAGS)
(at_keyboard_mod_LDFLAGS): Remove variables.
2010-01-11 Felix Zielcke <fzielcke@z-51.de> 2010-01-11 Felix Zielcke <fzielcke@z-51.de>
* po/POTFILES: Replace `term/i386/pc/serial.c' with `term/serial.c'. * po/POTFILES: Replace `term/i386/pc/serial.c' with `term/serial.c'.

View file

@ -4,3 +4,20 @@ target_machine=qemu-mips
COMMON_CFLAGS += -march=mips3 COMMON_CFLAGS += -march=mips3
COMMON_ASFLAGS += -march=mips3 COMMON_ASFLAGS += -march=mips3
include $(srcdir)/conf/mips.mk include $(srcdir)/conf/mips.mk
pkglib_IMAGES = kernel.img
kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
kern/main.c kern/device.c kern/$(target_cpu)/init.c \
kern/$(target_cpu)/$(target_machine)/init.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
kern/misc.c kern/mm.c kern/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c kern/time.c \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_FORMAT = binary

View file

@ -5,11 +5,30 @@ COMMON_CFLAGS += -march=mips3
COMMON_ASFLAGS += -march=mips3 COMMON_ASFLAGS += -march=mips3
include $(srcdir)/conf/mips.mk include $(srcdir)/conf/mips.mk
# For pci.mod. pkglib_IMAGES = kernel.img
pkglib_MODULES += pci.mod kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
pci_mod_SOURCES = bus/pci.c bus/bonito.c kern/main.c kern/device.c kern/$(target_cpu)/init.c \
pci_mod_CFLAGS = $(COMMON_CFLAGS) kern/$(target_cpu)/$(target_machine)/init.c \
pci_mod_LDFLAGS = $(COMMON_LDFLAGS) kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
kern/misc.c kern/mm.c kern/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c kern/time.c \
kern/$(target_cpu)/cache.S \
\
term/at_keyboard.c \
font/font_cmd.c font/font.c io/bufio.c \
video/video.c video/fb/video_fb.c video/fb/fbblit.c \
video/fb/fbfill.c video/fb/fbutil.c video/bitmap.c \
video/sm712.c bus/pci.c bus/bonito.c \
term/gfxterm.c commands/extcmd.c lib/arg.c \
symlist.c
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DUSE_ASCII_FAILBACK
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_FORMAT = binary
# For ata.mod. # For ata.mod.
pkglib_MODULES += ata.mod pkglib_MODULES += ata.mod
@ -17,24 +36,12 @@ ata_mod_SOURCES = disk/ata.c
ata_mod_CFLAGS = $(COMMON_CFLAGS) ata_mod_CFLAGS = $(COMMON_CFLAGS)
ata_mod_LDFLAGS = $(COMMON_LDFLAGS) ata_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod.
pkglib_MODULES += sm712.mod
sm712_mod_SOURCES = video/sm712.c
sm712_mod_CFLAGS = $(COMMON_CFLAGS)
sm712_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod # For lspci.mod
pkglib_MODULES += lspci.mod pkglib_MODULES += lspci.mod
lspci_mod_SOURCES = commands/lspci.c lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For at_keyboard.mod.
pkglib_MODULES += at_keyboard.mod
at_keyboard_mod_SOURCES = term/at_keyboard.c
at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS)
at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For ata_pthru.mod. # For ata_pthru.mod.
pkglib_MODULES += ata_pthru.mod pkglib_MODULES += ata_pthru.mod
ata_pthru_mod_SOURCES = disk/ata_pthru.c ata_pthru_mod_SOURCES = disk/ata_pthru.c

View file

@ -25,24 +25,6 @@ symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Programs
pkglib_IMAGES = kernel.img
kernel_img_SOURCES = kern/$(target_cpu)/startup.S \
kern/main.c kern/device.c kern/$(target_cpu)/init.c \
kern/$(target_cpu)/$(target_machine)/init.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
kern/misc.c kern/mm.c kern/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c kern/time.c \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
-Wl,-N,-S,-Ttext,$(LINK_BASE),-Bstatic
kernel_img_FORMAT = binary
# Scripts. # Scripts.
sbin_SCRIPTS = sbin_SCRIPTS =
bin_SCRIPTS = bin_SCRIPTS =

View file

@ -152,6 +152,12 @@ grub_main (void)
/* First of all, initialize the machine. */ /* First of all, initialize the machine. */
grub_machine_init (); grub_machine_init ();
/* Hello. */
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
grub_printf ("Welcome to GRUB!\n\n");
grub_refresh ();
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
/* Load pre-loaded modules and free the space. */ /* Load pre-loaded modules and free the space. */
grub_register_exported_symbols (); grub_register_exported_symbols ();
#ifdef GRUB_LINKER_HAVE_INIT #ifdef GRUB_LINKER_HAVE_INIT
@ -159,12 +165,6 @@ grub_main (void)
#endif #endif
grub_load_modules (); grub_load_modules ();
/* Hello. */
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
grub_printf ("Welcome to GRUB!\n\n");
grub_refresh ();
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
/* It is better to set the root device as soon as possible, /* It is better to set the root device as soon as possible,
for convenience. */ for convenience. */
grub_machine_set_prefix (); grub_machine_set_prefix ();

View file

@ -1,6 +1,6 @@
/* /*
* GRUB -- GRand Unified Bootloader * GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc. * Copyright (C) 2009,2010 Free Software Foundation, Inc.
* *
* GRUB is free software: you can redistribute it and/or modify * GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,6 +28,13 @@
#include <grub/machine/memory.h> #include <grub/machine/memory.h>
#include <grub/cpu/kernel.h> #include <grub/cpu/kernel.h>
extern void grub_video_sm712_init (void);
extern void grub_video_video_init (void);
extern void grub_video_bitmap_init (void);
extern void grub_font_manager_init (void);
extern void grub_term_gfxterm_init (void);
extern void grub_at_keyboard_init (void);
/* FIXME: use interrupt to count high. */ /* FIXME: use interrupt to count high. */
grub_uint64_t grub_uint64_t
grub_get_rtc (void) grub_get_rtc (void)
@ -87,6 +94,16 @@ grub_machine_init (void)
- (((grub_addr_t) modend) - GRUB_ARCH_LOWMEMVSTART)); - (((grub_addr_t) modend) - GRUB_ARCH_LOWMEMVSTART));
/* FIXME: use upper memory as well. */ /* FIXME: use upper memory as well. */
grub_install_get_time_ms (grub_rtc_get_time_ms); grub_install_get_time_ms (grub_rtc_get_time_ms);
/* Initialize output terminal (can't be done earlier, as gfxterm
relies on a working heap. */
grub_video_sm712_init ();
grub_video_video_init ();
grub_video_bitmap_init ();
grub_font_manager_init ();
grub_term_gfxterm_init ();
grub_at_keyboard_init ();
} }
void void

View file

@ -292,10 +292,6 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul
# Device abstraction module, if any (lvm, raid). # Device abstraction module, if any (lvm, raid).
devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}`
if [ "${target_cpu}-${platform}" = "mips-yeeloong" ] ; then
modules="sm712 gfxterm at_keyboard $modules"
fi
# The order in this list is critical. Be careful when modifying it. # The order in this list is critical. Be careful when modifying it.
modules="$modules $disk_module" modules="$modules $disk_module"
modules="$modules $fs_module $partmap_module $devabstraction_module" modules="$modules $fs_module $partmap_module $devabstraction_module"