Subversion Repositories HelenOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 454 → Rev 455

/SPARTAN/trunk/clean.ia32
0,0 → 1,0
link clean
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/build.sparc64
0,0 → 1,0
link build.ia32
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/clean
1,3 → 1,10
#! /bin/sh
 
make clean
ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
if [ -z "$ARCH" ]; then
for ARCH in arch/* ; do
make clean "ARCH=`basename "$ARCH"`"
done
else
make clean "ARCH=$ARCH"
fi
/SPARTAN/trunk/clean.ia64
0,0 → 1,0
link clean
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/build.ppc32
0,0 → 1,0
link build.ia32
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/build.ia32
1,17 → 1,34
#! /bin/sh
 
COMPILER=""
function syntax {
echo "Syntax:"
echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>]"
echo
echo "<arch> ... amd64, *ia32, ia64, mips32, ppc32, sparc64"
echo "<compiler> ... native, *cross"
echo "<cpu> ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4"
echo
}
 
ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
if [ -z "$ARCH" ]; then
syntax
exit 1
fi
 
ARGS=""
while [ "$#" -gt 0 ]; do
case "$1" in
native)
COMPILER="$COMPILER NATIVE_COMPILER=yes"
-compiler)
ARGS="$ARGS COMPILER=$2"
shift
;;
strong)
COMPILER="$COMPILER STRONG_ORDERING=yes"
-cpu)
ARGS="$ARGS CPU=$2"
shift
;;
*)
echo "Supported arguments: native strong"
syntax
exit 1
;;
esac
18,6 → 35,4
shift
done
 
make all ARCH=ia32 $COMPILER
( cd uspace/libc && make all ARCH=ia32 $COMPILER )
( cd uspace && make all ARCH=ia32 $COMPILER )
make all "ARCH=$ARCH" $ARGS
/SPARTAN/trunk/build.ia64
0,0 → 1,0
link build.ia32
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/clean.sparc64
0,0 → 1,0
link clean
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/clean.ppc32
0,0 → 1,0
link clean
Property changes:
Added: svn:special
+*
\ No newline at end of property
/SPARTAN/trunk/arch/sparc64/_link.ld
File deleted
/SPARTAN/trunk/arch/sparc64/_link.ld.in
0,0 → 1,49
/** SPARC64 linker script
*
* It is ELF format, but its only section looks like this:
* kernel text
* kernel data
*
*/
 
#define __ASM__
 
OUTPUT_FORMAT("elf64-sparc")
ENTRY(kernel_image_start)
 
SECTIONS {
.image 0x4000: AT (0x4000) {
ktext_start = .;
*(K_TEXT_START)
*(.text);
ktext_end = .;
kdata_start = .;
*(K_DATA_START)
*(.rodata);
*(.rodata.*);
*(.data); /* initialized data */
*(.sdata);
*(.sdata2);
*(.sbss);
hardcoded_ktext_size = .;
LONG(ktext_end - ktext_start);
hardcoded_kdata_size = .;
LONG(kdata_end - kdata_start);
hardcoded_load_address = .;
QUAD(0x4000);
*(.bss); /* uninitialized static variables */
*(COMMON); /* global variables */
 
symbol_table = .;
*(symtab.*); /* Symbol table, must be LAST symbol!*/
 
kdata_end = .;
}
/DISCARD/ : {
*(.comment);
*(.note*);
}
 
}
/SPARTAN/trunk/arch/sparc64/boot/Makefile
1,30 → 1,19
BINUTILS_DIR=/usr/local/sparc64/bin
TARGET=sparc64-linux-gnu
.PHONY: build clean
 
.PHONY: nothing build
CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include
 
nothing:
 
build: boot.bin
cp boot.bin ../../../load.bin
 
CC=$(BINUTILS_DIR)/$(TARGET)-gcc
AS=$(BINUTILS_DIR)/$(TARGET)-as
LD=$(BINUTILS_DIR)/$(TARGET)-ld
 
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
LFLAGS=-no-check-sections -N -T _link.ld -s
 
boot.bin: boot.aout
boot.bin: boot.a.out
dd if=/dev/zero of=$@ bs=512 count=16
dd if=boot.aout of=$@ bs=512 seek=1 conv=notrunc
dd if=boot.a.out of=$@ bs=512 seek=1 conv=notrunc
 
boot.aout: boot.o
$(LD) $(LFLAGS) boot.o -o $@
boot.a.out: boot.o
$(LD) -no-check-sections -N -T _link.ld -s boot.o -o $@
 
boot.o: boot.S
$(CC) $(CFLAGS) -c boot.S -o $@
 
clean:
-rm *.o *.bin *.aout
-rm -f boot.o boot.a.out boot.bin ../../../load.bin
/SPARTAN/trunk/arch/sparc64/Makefile.inc
1,30 → 1,50
TARGET=sparc64-linux-gnu
#
# Copyright (C) 2005 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
CC_DIR=/usr/local/sparc64/bin
BINUTILS_DIR=/usr/local/sparc64/bin
## Toolchain configuration
#
 
CC=$(CC_DIR)/$(TARGET)-gcc
AS=$(BINUTILS_DIR)/$(TARGET)-as
LD=$(BINUTILS_DIR)/$(TARGET)-ld
OBJDUMP=$(BINUTILS_DIR)/$(TARGET)-objdump
OBJCOPY=$(BINUTILS_DIR)/$(TARGET)-objcopy
BFD_NAME=elf64-sparc
BFD_ARCH=sparc
BFD_NAME = elf64-sparc
BFD_ARCH = sparc
TARGET = sparc64-linux-gnu
TOOLCHAIN_DIR = /usr/local/sparc64/bin
 
ASFLAGS=
## Make some default assumptions
#
 
DEFS=-DARCH=$(ARCH)
CFLAGS=$(DEFS) -nostdlib -fno-builtin -mcpu=ultrasparc -m64 -O2
LFLAGS=-M -no-check-sections -N
CFLAGS += -mcpu=ultrasparc -m64
LFLAGS += -no-check-sections -N
 
arch_sources= \
generic/src/arch/asm.S \
generic/src/arch/console.c \
generic/src/arch/context.S \
generic/src/arch/dummy.s \
generic/src/arch/sparc64.c \
generic/src/arch/start.S \
generic/src/arch/mm/frame.c \
generic/src/arch/mm/page.c
## Own configuration directives
#
 
CONFIG_OFW = y
 
ARCH_SOURCES = \
arch/$(ARCH)/src/dummy.s \
arch/$(ARCH)/src/start.S
/SPARTAN/trunk/arch/ia64/_link.ld
File deleted
/SPARTAN/trunk/arch/ia64/_link.ld.in
0,0 → 1,43
/** IA-64 linker script
*
* It is ELF format, but its only section looks like this:
* kernel text
* kernel data
*
*/
 
#define __ASM__
 
OUTPUT_FORMAT(elf64-ia64-little)
ENTRY(kernel_image_start)
 
SECTIONS {
.image 0x0000000000001000: AT (0x0000000000001000) {
ktext_start = .;
*(K_TEXT_START);
*(.text)
ktext_end = .;
kdata_start = .;
*(K_DATA_START)
*(.rodata .rodata.*)
*(.opd)
*(.data)
*(.got .got.*)
*(.sdata)
*(.sbss)
*(.scommon)
*(.bss)
*(COMMON);
 
symbol_table = .;
*(symtab.*); /* Symbol table, must be LAST symbol!*/
 
kdata_end = .;
}
 
_hardcoded_ktext_size = ktext_end - ktext_start;
_hardcoded_kdata_size = kdata_end - kdata_start;
_hardcoded_load_address = 0x0000000000001000;
 
}
/SPARTAN/trunk/arch/ia64/boot/Makefile
1,24 → 1,13
IA-64_BINUTILS_DIR=/usr/local/ia64/bin
IA-64_TARGET=ia64-pc-linux-gnu
.PHONY: build clean
 
.PHONY: nothing build
 
nothing:
 
build: boot.bin
cp boot.bin ../../../load.bin
 
AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as
LD=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-ld
 
ASFLAGS=-EL
LFLAGS=-EL -T _link.ld -n
 
boot.bin: boot.o
$(LD) $(LFLAGS) boot.o -o $@
$(LD) -EL -T _link.ld -n boot.o -o $@
 
boot.o:
boot.o: boot.s
$(AS) boot.s -o $@
 
clean:
-rm *.o *.bin
-rm -f boot.o boot.bin ../../../load.bin
/SPARTAN/trunk/arch/ia64/Makefile.inc
1,38 → 1,59
IA-64_TARGET=ia64-pc-linux-gnu
#
# Copyright (C) 2005 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
IA-64_CC_DIR=/usr/local/ia64/bin
IA-64_BINUTILS_DIR=/usr/local/ia64/bin
## Toolchain configuration
#
 
CC=$(IA-64_CC_DIR)/$(IA-64_TARGET)-gcc
AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as
LD=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-ld
OBJDUMP=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-objdump
OBJCOPY=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-objcopy
BFD_NAME=elf64-little
BFD_ARCH=ia64-elf64
BFD_NAME = elf64-little
BFD_ARCH = ia64-elf64
TARGET = ia64-pc-linux-gnu
TOOLCHAIN_DIR = /usr/local/ia64/bin
 
## Make some default assumptions
#
 
ASFLAGS=-mconstant-gp
CFLAGS += -mconstant-gp -fno-unwind-tables
LFLAGS += -EL
AFLAGS += -mconstant-gp
 
DEFS=-DARCH=$(ARCH)
CFLAGS=$(DEFS) -mconstant-gp -nostdlib -fno-builtin -fno-unwind-tables -O3
LFLAGS=-EL -M
 
 
 
arch_sources= \
generic/src/arch/start.S \
generic/src/arch/asm.S \
generic/src/arch/dummy.s \
generic/src/arch/putchar.c \
generic/src/arch/ia64.c \
generic/src/arch/fpu_context.c \
generic/src/arch/context.S \
generic/src/arch/ski/ski.c \
generic/src/arch/cpu/cpu.c \
generic/src/arch/ivt.S \
generic/src/arch/interrupt.c \
generic/src/arch/interrupt_handler.c \
generic/src/arch/fmath.c \
generic/src/arch/mm/frame.c \
generic/src/arch/drivers/it.c
ARCH_SOURCES = \
arch/$(ARCH)/src/start.S \
arch/$(ARCH)/src/asm.S \
arch/$(ARCH)/src/dummy.s \
arch/$(ARCH)/src/putchar.c \
arch/$(ARCH)/src/ia64.c \
arch/$(ARCH)/src/fpu_context.c \
arch/$(ARCH)/src/context.S \
arch/$(ARCH)/src/ski/ski.c \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/ivt.S \
arch/$(ARCH)/src/interrupt.c \
arch/$(ARCH)/src/interrupt_handler.c \
arch/$(ARCH)/src/fmath.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/drivers/it.c
/SPARTAN/trunk/arch/ppc32/_link.ld
File deleted
/SPARTAN/trunk/arch/ppc32/_link.ld.in
0,0 → 1,43
/** PPC32 linker script
*
* It is ELF format, but its only section looks like this:
* kernel text
* kernel data
*
*/
 
#define __ASM__
 
OUTPUT_FORMAT("elf32-powerpc")
ENTRY(kernel_image_start)
 
SECTIONS {
.image 0x80000000: AT (0x80000000) {
ktext_start = .;
*(K_TEXT_START)
*(.text);
ktext_end = .;
kdata_start = .;
*(K_DATA_START)
*(.rodata);
*(.rodata.*);
*(.data); /* initialized data */
*(.sdata);
*(.sdata2);
*(.sbss);
hardcoded_ktext_size = .;
LONG(ktext_end - ktext_start);
hardcoded_kdata_size = .;
LONG(kdata_end - kdata_start);
hardcoded_load_address = .;
LONG(0x80000000);
*(.bss); /* uninitialized static variables */
*(COMMON); /* global variables */
 
symbol_table = .;
*(symtab.*); /* Symbol table, must be LAST symbol!*/
 
kdata_end = .;
}
}
/SPARTAN/trunk/arch/ppc32/boot/Makefile
1,23 → 1,12
PPC_BINUTILS_DIR=/usr/local/ppc/bin
PPC_TARGET=ppc-linux-gnu
.PHONY: build clean
 
.PHONY: nothing build
CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include
 
nothing:
 
build: boot.bin
cp boot.bin ../../../load.bin
 
CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc
AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as
LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld
 
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
LFLAGS=-no-check-sections -N -T _link.ld
 
boot.bin: boot.o main.o
$(LD) $(LFLAGS) boot.o main.o -o $@
$(LD) -no-check-sections -N -T _link.ld boot.o main.o -o $@
 
boot.o: boot.S
$(CC) $(CFLAGS) -c boot.S -o $@
26,4 → 15,4
$(CC) $(CFLAGS) -c main.c -o $@
 
clean:
-rm *.o *.bin
-rm -f boot.o main.o boot.bin ../../../load.bin
/SPARTAN/trunk/arch/ppc32/Makefile.inc
1,33 → 1,60
PPC_TARGET=ppc-linux-gnu
#
# Copyright (C) 2005 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
PPC_CC_DIR=/usr/local/ppc/bin
PPC_BINUTILS_DIR=/usr/local/ppc/bin
## Toolchain configuration
#
 
CC=$(PPC_CC_DIR)/$(PPC_TARGET)-gcc
AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as
LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld
OBJDUMP=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-objdump
OBJCOPY=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-objcopy
BFD_NAME=elf32-powerpc
BFD_ARCH=powerpc
BFD_NAME = elf32-powerpc
BFD_ARCH = powerpc
TARGET = ppc-linux-gnu
TOOLCHAIN_DIR = /usr/local/ppc/bin
 
ASFLAGS=
## Make some default assumptions
#
 
DEFS=-DARCH=$(ARCH)
CFLAGS=$(DEFS) -nostdlib -fno-builtin -O2
LFLAGS=-M -no-check-sections -N
LFLAGS += -no-check-sections -N
 
arch_sources= \
generic/src/arch/console.c \
generic/src/arch/context.S \
generic/src/arch/debug/panic.s \
generic/src/arch/fpu_context.c \
generic/src/arch/ppc32.c \
generic/src/arch/dummy.s \
generic/src/arch/start.S \
generic/src/arch/asm.S \
generic/src/arch/cpu/cpu.c \
generic/src/arch/mm/frame.c \
generic/src/arch/mm/memory_init.c \
generic/src/arch/mm/page.c \
generic/src/arch/fmath.c
## Own configuration directives
#
 
CONFIG_OFW = y
 
ARCH_SOURCES = \
arch/$(ARCH)/src/console.c \
arch/$(ARCH)/src/context.S \
arch/$(ARCH)/src/debug/panic.s \
arch/$(ARCH)/src/fpu_context.c \
arch/$(ARCH)/src/ppc32.c \
arch/$(ARCH)/src/dummy.s \
arch/$(ARCH)/src/start.S \
arch/$(ARCH)/src/asm.S \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/memory_init.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/fmath.c
/SPARTAN/trunk/arch/amd64/Makefile.inc
1,61 → 1,103
AMD64_TARGET=amd64-linux-gnu
AMD64_CC_DIR=/usr/local/amd64/bin
AMD64_BINUTILS_DIR=/usr/local/amd64/bin
#
# Copyright (C) 2005 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
CC=$(AMD64_CC_DIR)/$(AMD64_TARGET)-gcc
AS=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-as
LD=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-ld
OBJDUMP=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-objdump
OBJCOPY=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-objcopy
BFD_NAME=elf64-x86-64
BFD_ARCH=i386:x86-64
## Toolchain configuration
#
 
DEFS=-DARCH=$(ARCH) -DFPU_LAZY
BFD_NAME = elf64-x86-64
BFD_ARCH = i386:x86-64
TARGET = amd64-linux-gnu
TOOLCHAIN_DIR = /usr/local/amd64/bin
 
ifdef SMP
DEFS+=-D$(SMP)
## Make some default assumptions
#
 
ifndef CPU
CPU = opteron
endif
CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone
 
ifdef HT
DEFS+=-D$(HT)
## Accepted CPUs
#
 
ifeq ($(CPU),opteron)
CFLAGS += -march=opteron
DEFS += -DFENCES=p4
endif
 
## Own configuration directives
#
 
CFLAGS=$(DEFS) -nostdlib -fno-builtin -fno-unwind-tables -O3 -march=opteron -m64 -mcmodel=kernel -mno-red-zone
LFLAGS=-M
CONFIG_ACPI = y
 
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
$(CC) $(CFLAGS) -C -E -x c $< | grep -v "^\#" > $@
## Accepted configuration directives
#
 
arch_sources = \
generic/src/arch/dummy.s \
generic/src/arch/fpu_context.c \
generic/src/arch/boot/boot.S \
generic/src/arch/boot/memmap.S \
generic/src/arch/pm.c \
generic/src/arch/context.S \
generic/src/arch/drivers/ega.c \
generic/src/arch/drivers/i8042.c \
generic/src/arch/drivers/i8254.c \
generic/src/arch/drivers/i8259.c \
generic/src/arch/delay.S \
generic/src/arch/amd64.c \
generic/src/arch/bios/bios.c \
generic/src/arch/interrupt.c \
generic/src/arch/mm/frame.c \
generic/src/arch/mm/page.c \
generic/src/arch/mm/tlb.c \
generic/src/arch/asm_utils.S \
generic/src/arch/fmath.c \
generic/src/arch/mm/memory_init.c \
generic/src/arch/cpu/cpu.c \
generic/src/arch/proc/scheduler.c \
generic/src/arch/userspace.c
ifeq ($(CONFIG_SMP),y)
DEFS += -DSMP
endif
ifeq ($(CONFIG_HT),y)
DEFS += -DHT
endif
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DFPU_LAZY
endif
 
ifdef SMP
arch_sources += generic/src/arch/smp/ap.S \
generic/src/arch/smp/apic.c \
generic/src/arch/smp/ipi.c \
generic/src/arch/smp/mps.c \
generic/src/arch/smp/smp.c
ARCH_SOURCES = \
arch/$(ARCH)/src/dummy.s \
arch/$(ARCH)/src/fpu_context.c \
arch/$(ARCH)/src/boot/boot.S \
arch/$(ARCH)/src/boot/memmap.S \
arch/$(ARCH)/src/pm.c \
arch/$(ARCH)/src/context.S \
arch/$(ARCH)/src/drivers/ega.c \
arch/$(ARCH)/src/drivers/i8042.c \
arch/$(ARCH)/src/drivers/i8254.c \
arch/$(ARCH)/src/drivers/i8259.c \
arch/$(ARCH)/src/delay.S \
arch/$(ARCH)/src/amd64.c \
arch/$(ARCH)/src/bios/bios.c \
arch/$(ARCH)/src/interrupt.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/mm/tlb.c \
arch/$(ARCH)/src/asm_utils.S \
arch/$(ARCH)/src/fmath.c \
arch/$(ARCH)/src/mm/memory_init.c \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/proc/scheduler.c \
arch/$(ARCH)/src/userspace.c
 
ifeq ($(CONFIG_SMP),y)
ARCH_SOURCES += \
arch/$(ARCH)/src/smp/ap.S \
arch/$(ARCH)/src/smp/apic.c \
arch/$(ARCH)/src/smp/ipi.c \
arch/$(ARCH)/src/smp/mps.c \
arch/$(ARCH)/src/smp/smp.c
endif
/SPARTAN/trunk/arch/mips32/boot/Makefile
12,7 → 12,7
CC=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-gcc
LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
 
ASFLAGS=-mips2 -I../../../generic/include
AFLAGS=-mips2 -I../../../generic/include
LFLAGS=--oformat=binary -e start -T _link.ld
 
.S.o:
/SPARTAN/trunk/arch/mips32/Makefile.inc
1,18 → 1,135
MIPS_TARGET=mipsel-linux-gnu
MIPS_CC_DIR=/usr/local/mipsel/bin
MIPS_BINUTILS_DIR=/usr/local/mipsel/bin
#
# Copyright (C) 2005 Martin Decky
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
CC=$(MIPS_CC_DIR)/$(MIPS_TARGET)-gcc
AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
OBJDUMP=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objdump
OBJCOPY=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objcopy
BFD_ARCH=mips
## Toolchain configuration
#
 
DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2 -fno-zero-initialized-in-bss
BFD_NAME = elf32-i386
BFD_ARCH = mips
TARGET = mipsel-linux-gnu
TOOLCHAIN_DIR = /usr/local/mipsel/bin
 
## Make some default assumptions
#
 
ifndef CPU
CPU = pentium4
endif
 
## Accepted CPUs
#
 
ifeq ($(CPU),athlon-xp)
CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
DEFS += -DFENCES=486
CONFIG_SMP = n
CONFIG_HT = n
endif
ifeq ($(CPU),athlon-mp)
CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
DEFS += -DFENCES=486
endif
ifeq ($(CPU),pentium3)
CFLAGS += -march=pentium3 -mmmx -msse -msse2
DEFS += -DFENCES=486
endif
ifeq ($(CPU),pentium4)
CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
DEFS += -DFENCES=p4
endif
 
## Own configuration directives
#
 
CONFIG_ACPI = y
 
## Accepted configuration directives
#
 
ifeq ($(CONFIG_SMP),y)
DEFS += -DSMP
endif
ifeq ($(CONFIG_HT),y)
DEFS += -DHT
endif
ifeq ($(CONFIG_FPU_LAZY),y)
DEFS += -DFPU_LAZY
endif
 
ARCH_SOURCES = \
arch/$(ARCH)/src/context.s \
arch/$(ARCH)/src/debug/panic.s \
arch/$(ARCH)/src/delay.s \
arch/$(ARCH)/src/asm.S \
arch/$(ARCH)/src/proc/scheduler.c \
arch/$(ARCH)/src/bios/bios.c \
arch/$(ARCH)/src/smp/ap.S \
arch/$(ARCH)/src/smp/apic.c \
arch/$(ARCH)/src/smp/mps.c \
arch/$(ARCH)/src/smp/smp.c \
arch/$(ARCH)/src/atomic.S \
arch/$(ARCH)/src/smp/ipi.c \
arch/$(ARCH)/src/ia32.c \
arch/$(ARCH)/src/interrupt.c \
arch/$(ARCH)/src/pm.c \
arch/$(ARCH)/src/userspace.c \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/mm/frame.c \
arch/$(ARCH)/src/mm/memory_init.c \
arch/$(ARCH)/src/mm/page.c \
arch/$(ARCH)/src/mm/tlb.c \
arch/$(ARCH)/src/drivers/i8042.c \
arch/$(ARCH)/src/drivers/i8254.c \
arch/$(ARCH)/src/drivers/i8259.c \
arch/$(ARCH)/src/drivers/ega.c \
arch/$(ARCH)/src/boot/boot.S \
arch/$(ARCH)/src/boot/memmap.S \
arch/$(ARCH)/src/fpu_context.c\
arch/$(ARCH)/src/fmath.c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
DEFS= -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
CFLAGS=-mno-abicalls -G 0 -nostdlib -fno-builtin -O2 -fno-zero-initialized-in-bss
LFLAGS=
BFD_ARCH=mips
 
# GCC 4.0.1 compiled for mipsEL has problems compiling in
# BigEndian mode with the swl/swr/lwl/lwr instructions.
/SPARTAN/trunk/arch/ia32/boot/Makefile
6,11 → 6,11
dd if=/dev/zero of=../../../image.bin bs=1 seek=1474559 count=1
 
boot.bin: boot.o
ld -T boot.ld -entry _start_0x7c00 --oformat binary boot.o -o $@
$(LD) -T boot.ld -entry _start_0x7c00 --oformat binary boot.o -o $@
 
boot.o: boot.S
gcc -E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s
as boot.s -o $@
$(CC) -E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s
$(AS) boot.s -o $@
rm boot.s
 
clean:
/SPARTAN/trunk/arch/ia32/Makefile.inc
34,23 → 34,31
TARGET = i686-pc-linux-gnu
TOOLCHAIN_DIR = /usr/local/i686/bin
 
## Make some default assumptions
#
 
ifndef CPU
CPU = pentium4
endif
 
## Accepted CPUs
#
# Default CPU is Pentium 4
#
 
ifeq ($CPU,athlon-xp)
ifeq ($(CPU),athlon-xp)
CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
DEFS += -DFENCES=486
CONFIG_SMP = n
CONFIG_HT = n
elseifeq ($CPU,athlon-mp)
endif
ifeq ($(CPU),athlon-mp)
CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
DEFS += -DFENCES=486
elseifeq ($CPU,pentium3)
endif
ifeq ($(CPU),pentium3)
CFLAGS += -march=pentium3 -mmmx -msse -msse2
DEFS += -DFENCES=486
else
endif
ifeq ($(CPU),pentium4)
CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
DEFS += -DFENCES=p4
endif
/SPARTAN/trunk/Makefile
46,8 → 46,10
## Common compiler flags
#
 
DEFS = -DARCH=$(ARCH)
CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/
LFLAGS = -M
AFLAGS =
 
## Setup kernel configuration
#
128,8 → 130,8
-include Makefile.depend
 
clean:
-rm -f kernel.bin kernel.map kernel.map.pre kernel.objdump generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
find generic/src/ arch/$(ARCH)/src/ genarch/src/ -name '*.o' -exec rm \{\} \;
-rm -f kernel.bin kernel.map kernel.map.pre kernel.objdump generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld
$(MAKE) -C arch/$(ARCH)/boot clean
 
config:
137,10 → 139,10
ln -sfn ../../genarch/include/ generic/include/genarch
 
depend: config
$(CC) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
 
arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
$(CC) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
$(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
 
generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile generic/src/debug/empty_map.o
155,13 → 157,13
$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) generic/src/debug/real_map.o -o $@ -Map kernel.map
 
boot: kernel.bin
$(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`"
$(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`" CC=$(CC) AS=$(AS) LD=$(LD)
 
%.o: %.S
$(CC) $(ASFLAGS) $(CFLAGS) -c $< -o $@
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -c $< -o $@
 
%.o: %.s
$(AS) $(ASFLAGS) $< -o $@
$(AS) $(AFLAGS) $< -o $@
 
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@