diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 2f201b13ce..639366921f 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -62,7 +62,7 @@ $(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/mem.c -o $(obj)/mem.o $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/malloc.c -o $(obj)/malloc.o $(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/clog2.c -o $(obj)/clog2.o - $(Q)$(CC) $(INITCFLAGS) -c -I$(src) $(src)/statictree.c -o $(obj)/statictree.o + $(Q)$(CC) $(INITCFLAGS) -c -I$(src) $(obj)/statictree.c -o $(obj)/statictree.o $(Q)$(CC) $(INITCFLAGS) -c mainboard/$(MAINBOARDDIR)/mainboard.c -o $(obj)/mainboard.o # leave a .o with full symbols in it for debugging. diff --git a/console/vtxprintf.c b/console/vtxprintf.c index 9ffc1f21dc..6febaa0990 100644 --- a/console/vtxprintf.c +++ b/console/vtxprintf.c @@ -307,3 +307,23 @@ int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args return count; } +/* very gross simple thing that is non-reentrant. This should not matter though. */ +static unsigned char *ssp; +static void stxbyte(unsigned char byte) +{ + *ssp++ = byte; +} + +int sprintf(char *str, const char *format, ...) +{ + va_list args; + int i; + + ssp = (unsigned char *) str; + va_start(args, format); + i = vtxprintf(stxbyte, format, args); + va_end(args); + + return i; + +} diff --git a/mainboard/emulation/qemu-i386/Makefile b/mainboard/emulation/qemu-i386/Makefile index 9f712bff72..70d9767772 100644 --- a/mainboard/emulation/qemu-i386/Makefile +++ b/mainboard/emulation/qemu-i386/Makefile @@ -34,7 +34,7 @@ $(obj)/linuxbios.vpd: # this is going to be the init ram code: # -$(obj)/linuxbios.initram: $(obj)/stage0.init +$(obj)/linuxbios.initram: $(obj)/stage0.o $(Q)echo Building linuxbios.initram # # main @@ -49,7 +49,7 @@ $(obj)/linuxbios.initram: $(obj)/stage0.init #cd $(obj); $(Q)$(LD) -Ttext 0x00000000 -s --oformat binary initram.o console.o uart8250.o \ # serial.o vtxprintf.o -o $(obj)/linuxbios.initram - $(Q)$(LD) -R stage0.o -Ttext 0x80000 $(obj)/initram.o \ + $(Q)$(LD) -R $(obj)/stage0.o -Ttext 0x80000 $(obj)/initram.o \ -o $(obj)/linuxbios.initram.o $(Q)objcopy -O binary $(obj)/linuxbios.initram.o $(obj)/linuxbios.initram