[coreboot] coreboot gpxe

Mats Erik Andersson mats.andersson at gisladisker.se
Wed Oct 1 20:51:53 CEST 2008


Chris Kilgour <techie at whiterocker.com> wrote
> >> http://www.whiterocker.com/gpxe/
> >>
> >>     
> 
> FYI - libpayload-lplconsole.patch was put together against libpayload r
> 3345.  I'm pretty sure the patch doesn't apply cleanly to the latest
> libpayload.
> 
> Chris.
> 

I can provide an almost complete aliment in that direction.
The patch provided below is constructed against todays trunk,
and it solves everything except the build step

    build/lib/lplconsole.o(.text+0x9c3): I funktionen "cb_parse_header":
    : undefined reference to `strncmp'

arising at the very last "ls -N -T ....." command. I had no really good
idea as to the best inclusion path to "strncmp()", and therefore I had
to leave the patchwork at that point. Most of you are more clever than
me in this respect.

Please forgive me for intruding,

Mats Erik Andersson

----


Index: libpayload/curses/tinycurses.c
===================================================================
--- libpayload/curses/tinycurses.c	(revision 3623)
+++ libpayload/curses/tinycurses.c	(arbetskopia)
@@ -736,8 +736,10 @@
 		for (x = win->_line[y].firstchar; x <= win->_line[y].lastchar; x++) {
 			attr_t attr = win->_line[y].text[x].attr;
 
+#ifdef CONFIG_VIDEO_CONSOLE
 			unsigned int c =
 				((int)color_pairs[PAIR_NUMBER(attr)]) << 8;
+#endif
 
 #ifdef CONFIG_SERIAL_CONSOLE
 			if (curses_flags & F_ENABLE_SERIAL) {
Index: libpayload/Makefile
===================================================================
--- libpayload/Makefile	(revision 3623)
+++ libpayload/Makefile	(arbetskopia)
@@ -95,12 +95,45 @@
 STACKPROTECT += $(call cc-option, -fno-stack-protector,)
 
 # TODO: Re-add -Os as soon as we find out why it caused problems.
-CFLAGS := -Wall -Werror $(STACKPROTECT) -nostdinc $(INCLUDES) -ffreestanding
+CFLAGS := -Wall -Werror $(STACKPROTECT) -ggdb -nostdinc $(INCLUDES) -ffreestanding
 
 all: lib
 
-lib: prepare $(obj)/lib/libpayload.a copystuff
+lib: prepare $(obj)/lib/libpayload.a copystuff $(obj)/lib/lplconsole.o
 
+LPL_CONSOLE_OBJS = $(obj)/libc/console.o $(obj)/drivers/pci.o \
+	$(obj)/i386/timer.o $(obj)/i386/sysinfo.o $(obj)/i386/coreboot.o \
+	$(obj)/libc/ipchecksum.o $(obj)/i386/virtual.o
+
+ifeq ($(CONFIG_SERIAL_CONSOLE),y)
+LPL_CONSOLE_OBJS += $(obj)/drivers/serial.o
+endif
+
+ifeq ($(CONFIG_PC_KEYBOARD),y)
+LPL_CONSOLE_OBJS += $(obj)/drivers/keyboard.o
+endif
+
+ifeq ($(CONFIG_VIDEO_CONSOLE),y)
+LPL_CONSOLE_OBJS += $(obj)/drivers/video/font8x16.o \
+	$(obj)/drivers/video/video.o 
+endif
+
+ifeq ($(CONFIG_VGA_VIDEO_CONSOLE),y)
+LPL_CONSOLE_OBJS += $(obj)/drivers/video/vga.o
+endif
+
+ifeq ($(CONFIG_GEODE_VIDEO_CONSOLE),y)
+LPL_CONSOLE_OBJS += $(obj)/drivers/video/geode.o
+endif
+
+$(obj)/lib/lplconsole.o: $(LPL_CONSOLE_OBJS)
+	$(LD) -r -o $@.tmp $(LPL_CONSOLE_OBJS)
+	objcopy --redefine-sym putchar=lpl_putchar --redefine-sym getchar=lpl_getchar \
+		--redefine-sym havekey=lpl_havekey --redefine-sym console_init=lpl_console_init \
+		--redefine-sym udelay=lpl_udelay --redefine-sym mdelay=lpl_mdelay \
+		--redefine-sym ndelay=lpl_ndelay \
+		$@.tmp $@
+
 # Copy libpayload.a and head.o into $(src)/lib where lpgcc et al expect them.
 copystuff: $(obj)/$(ARCHDIR-y)/head.S.o $(obj)/lib/libpayload.a
 	$(Q)cp $(obj)/$(ARCHDIR-y)/head.S.o $(src)/lib/$(ARCHDIR-y)/head.o




More information about the coreboot mailing list