Author: blueswirl Date: 2009-01-06 18:18:46 +0100 (Tue, 06 Jan 2009) New Revision: 357
Added: openbios-devel/config/examples/cross-x86_config.xml openbios-devel/config/examples/cross-x86_rules.xml Modified: openbios-devel/arch/x86/build.xml openbios-devel/arch/x86/entry.S openbios-devel/config/examples/x86_config.xml openbios-devel/config/examples/x86_rules.xml openbios-devel/include/x86/io.h Log: Fix x86 build
Modified: openbios-devel/arch/x86/build.xml =================================================================== --- openbios-devel/arch/x86/build.xml 2009-01-05 20:30:39 UTC (rev 356) +++ openbios-devel/arch/x86/build.xml 2009-01-06 17:18:46 UTC (rev 357) @@ -20,41 +20,48 @@ <object source="xbox/console.c" condition="XBOX"/> <object source="xbox/methods.c" condition="XBOX"/> </library> - + + <executable name="target/arch/x86/entry.o" target="target"> + <rule><![CDATA[ arch/x86/entry.S + $(CC) $$EXTRACFLAGS $(AS_FLAGS) $(CFLAGS) $(INCLUDES) -c -o $@ $^]]></rule> + </executable> + <executable name="openbios.multiboot" target="target" condition="IMAGE_ELF_MULTIBOOT"> <rule> - $(LD) -N -T arch/x86/ldscript -o $@.nostrip $^ \ - $(shell $(CC) -print-libgcc-file-name) + $(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(NM) $@.nostrip | sort > $(ODIR)/openbios-multiboot.syms cp $@.nostrip $@ $(STRIP) $@ </rule> - <object source="entry.S"/> + <external-object source="target/arch/x86/entry.o"/> <object source="multiboot.c"/> <external-object source="libx86.a"/> <external-object source="libbootstrap.a"/> + <external-object source="libdrivers.a"/> + <!-- Needs to be after drivers to avoid missing symbols --> <external-object source="libmodules.a"/> - <external-object source="libdrivers.a"/> <external-object source="liblibc.a"/> <external-object source="libfs.a"/> + <external-object source="libgcc.a"/> </executable>
<executable name="openbios-plain.elf" target="target" condition="IMAGE_ELF"> <rule> - $(LD) -N -T arch/x86/ldscript -o $@.nostrip $^ \ - $(shell $(CC) -print-libgcc-file-name) + $(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(NM) $@.nostrip | sort > $(ODIR)/openbios-plain.syms cp $@.nostrip $@ $(STRIP) $@ </rule> - <object source="entry.S"/> + <external-object source="target/arch/x86/entry.o"/> <object source="plainboot.c"/> <external-object source="libx86.a"/> <external-object source="libbootstrap.a"/> + <external-object source="libdrivers.a"/> + <!-- Needs to be after drivers to avoid missing symbols --> <external-object source="libmodules.a"/> - <external-object source="libdrivers.a"/> <external-object source="liblibc.a"/> <external-object source="libfs.a"/> + <external-object source="libgcc.a"/> </executable>
<!-- HACK ALERT --> @@ -80,20 +87,20 @@
<executable name="openbios-builtin.elf" target="target" condition="IMAGE_ELF_EMBEDDED"> <rule> - $(LD) -N -T arch/x86/ldscript -o $@.nostrip $^ \ - $(shell $(CC) -print-libgcc-file-name) + $(LD) --warn-common -N -T arch/x86/ldscript -o $@.nostrip $^ $(NM) $@.nostrip | sort > $(ODIR)/openbios-builtin.syms cp $@.nostrip $@ - $(STRIP) $@ - </rule> - <object source="entry.S"/> + $(STRIP) $@</rule> + <external-object source="target/arch/x86/entry.o"/> <external-object source="target/arch/x86/builtin.o"/> <external-object source="libx86.a"/> <external-object source="libbootstrap.a"/> + <external-object source="libdrivers.a"/> + <!-- Needs to be after drivers to avoid missing symbols --> <external-object source="libmodules.a"/> - <external-object source="libdrivers.a"/> <external-object source="liblibc.a"/> <external-object source="libfs.a"/> + <external-object source="libgcc.a"/> </executable>
</build>
Modified: openbios-devel/arch/x86/entry.S =================================================================== --- openbios-devel/arch/x86/entry.S 2009-01-05 20:30:39 UTC (rev 356) +++ openbios-devel/arch/x86/entry.S 2009-01-06 17:18:46 UTC (rev 357) @@ -252,6 +252,12 @@ pushl $19 /* vector */ jmp int_hand
+__divide_error: + pushl $0 /* error code */ + pushl $20 /* vector */ + jmp int_hand + .global __divide_error + int_hand: /* At this point on the stack there is: * 0(%esp) vector
Added: openbios-devel/config/examples/cross-x86_config.xml =================================================================== --- openbios-devel/config/examples/cross-x86_config.xml (rev 0) +++ openbios-devel/config/examples/cross-x86_config.xml 2009-01-06 17:18:46 UTC (rev 357) @@ -0,0 +1,75 @@ +<?xml version="1.0"?> +<config> + + <!-- generic --> + <option name="CONFIG_X86" type="boolean" value="true"/> + <option name="CONFIG_LITTLE_ENDIAN" type="boolean" value="true"/> + <option name="CONFIG_XBOX" type="boolean" value="false"/> + + <!-- kernel binaries (AMD64) --> + <option name="CONFIG_IMAGE_ELF" type="boolean" value="true"/> + <option name="CONFIG_IMAGE_ELF_EMBEDDED" type="boolean" value="true"/> + <option name="CONFIG_IMAGE_ELF_MULTIBOOT" type="boolean" value="true"/> + + <!-- Build hosted UNIX Binary --> + <option name="CONFIG_HOST_UNIX" type="boolean" value="false"/> + <option name="CONFIG_UNIX_QT" type="boolean" value="false"/> + <option name="CONFIG_PLUGINS" type="boolean" value="false"/> + + <!-- Kernel Debugging --> + <option name="CONFIG_DEBUG" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_BOOT" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_DSTACK" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_RSTACK" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_DICTIONARY" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_INTERNAL" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_INTERPRETER" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_CONSOLE" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_CONSOLE_SERIAL" type="boolean" value="true"/> + <option name="CONFIG_SERIAL_PORT" type="boolean" value="true"/> + <option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/> + <option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/> + + + <!-- Module Configuration --> + <option name="CONFIG_CMDLINE" type="boolean" value="true"/> + <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/> + <option name="CONFIG_FONT_8X8" type="boolean" value="true"/> + <option name="CONFIG_FONT_8X16" type="boolean" value="false"/> + + <!-- Filesystem Configuration --> + <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/> + <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/> + <option name="CONFIG_PC_PARTS" type="boolean" value="true"/> + <option name="CONFIG_FS" type="boolean" value="true"/> + <option name="CONFIG_HFS" type="boolean" value="false"/> + <option name="CONFIG_HFSP" type="boolean" value="false"/> + <option name="CONFIG_GRUBFS" type="boolean" value="true"/> + <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="true"/> + <option name="CONFIG_FSYS_FAT" type="boolean" value="false"/> + <option name="CONFIG_FSYS_JFS" type="boolean" value="false"/> + <option name="CONFIG_FSYS_MINIX" type="boolean" value="false"/> + <option name="CONFIG_FSYS_REISERFS" type="boolean" value="true"/> + <option name="CONFIG_FSYS_XFS" type="boolean" value="false"/> + <option name="CONFIG_FSYS_UFS" type="boolean" value="true"/> + <option name="CONFIG_FSYS_ISO9660" type="boolean" value="true"/> + <option name="CONFIG_FSYS_FFS" type="boolean" value="false"/> + <option name="CONFIG_FSYS_VSTAFS" type="boolean" value="false"/> + <option name="CONFIG_FSYS_NTFS" type="boolean" value="false"/> + <option name="CONFIG_FSYS_AFFS" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_FS" type="boolean" value="false"/> + + <!-- Miscellaneous --> + <option name="CONFIG_LINUXBIOS" type="boolean" value="true"/> + + <!-- Drivers --> + <option name="CONFIG_DRIVER_PCI" type="boolean" value="true"/> + <option name="CONFIG_DEBUG_PCI" type="boolean" value="false"/> + <option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/> + <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/> + <option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/> + <option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/> + <option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="false"/> + <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/> + +</config>
Added: openbios-devel/config/examples/cross-x86_rules.xml =================================================================== --- openbios-devel/config/examples/cross-x86_rules.xml (rev 0) +++ openbios-devel/config/examples/cross-x86_rules.xml 2009-01-06 17:18:46 UTC (rev 357) @@ -0,0 +1,79 @@ +<rules> + +<pre><![CDATA[ +# +# Autogenerated OpenBIOS Makefile +# (C) 2004-2005 by the OpenBIOS team +# + +ARCH := x86 +ODIR := obj-$(ARCH) +HOSTCC := gcc +HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) +HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include + +#TARGET=i386-elf- +TARGET= +CC := $(TARGET)gcc +AS := $(TARGET)as +AR := $(TARGET)ar +LD := $(TARGET)ld +NM := $(TARGET)nm +STRIP := $(TARGET)strip +RANLIB := $(TARGET)ranlib + +ifeq ($(shell uname), Linux) + LIBDL_LDFLAGS=-ldl +endif + +CFLAGS := -m32 -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin +INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include + +# +# pre rules +# + +all: versions dictionaries host-libraries target-libraries host-executables target-executables + +VERSION := "1.0RC1" + +versions: $(ODIR)/forth/version.fs + +$(ODIR)/forth/version.fs: + @test -d $(dir $@) || $(INSTALL) -d $(dir $@) + @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \ + ( echo ": builddate \" $$DATE\" ; " ; \ + echo ": version \" $(VERSION)\" ; " ; ) \ + > $(dir $@)/version.fs + +]]></pre> + + <!-- host compiler build rules --> + +<rule target="host" entity="executable"> + $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ +</rule> + +<rule target="host" entity="object"> + $(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^ +</rule> + +<rule target="host" entity="library"> + $(AR) cru $@ $^; $(RANLIB) $@ +</rule> + + <!-- target/cross compiler build rules --> + +<rule target="target" entity="executable"> + $(CC) $(CFLAGS) -o $@ $^ +</rule> + +<rule target="target" entity="object"> + $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^ +</rule> + +<rule target="target" entity="library"> + $(AR) cru $@ $^; $(RANLIB) $@ +</rule> + +</rules>
Modified: openbios-devel/config/examples/x86_config.xml =================================================================== --- openbios-devel/config/examples/x86_config.xml 2009-01-05 20:30:39 UTC (rev 356) +++ openbios-devel/config/examples/x86_config.xml 2009-01-06 17:18:46 UTC (rev 357) @@ -34,8 +34,9 @@ <!-- Module Configuration --> <option name="CONFIG_CMDLINE" type="boolean" value="true"/> <option name="CONFIG_DEBLOCKER" type="boolean" value="true"/> + <option name="CONFIG_FONT_8X8" type="boolean" value="true"/> + <option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
- <!-- Filesystem Configuration --> <option name="CONFIG_DISK_LABEL" type="boolean" value="true"/> <option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/> @@ -67,6 +68,7 @@ <option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/> <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/> <option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/> + <option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/> <option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="false"/> <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
Modified: openbios-devel/config/examples/x86_rules.xml =================================================================== --- openbios-devel/config/examples/x86_rules.xml 2009-01-05 20:30:39 UTC (rev 356) +++ openbios-devel/config/examples/x86_rules.xml 2009-01-06 17:18:46 UTC (rev 357) @@ -9,10 +9,10 @@ ARCH := x86 ODIR := obj-$(ARCH) HOSTCC := gcc -HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) -Wno-unused +HOSTCFLAGS := -O2 -g -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS) HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
-CC := gcc -m32 +CC := gcc AR := ar NM := nm STRIP := strip @@ -23,7 +23,7 @@ LIBDL_LDFLAGS=-ldl endif
-CFLAGS := -Os -Wall -W -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2 +CFLAGS := -m32 -Os -Wall -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
#
Modified: openbios-devel/include/x86/io.h =================================================================== --- openbios-devel/include/x86/io.h 2009-01-05 20:30:39 UTC (rev 356) +++ openbios-devel/include/x86/io.h 2009-01-06 17:18:46 UTC (rev 357) @@ -1,6 +1,8 @@ #ifndef _ASM_IO_H #define _ASM_IO_H
+#include "asm/types.h" + extern unsigned long virt_offset;
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - virt_offset))