Changeset 6bc4dbd in mainline


Ignore:
Timestamp:
2005-11-08T00:00:15Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5b65205
Parents:
849ba5cb
Message:

new build system upgrade
finished work for IA-32, IA-64, PPC-32, SPARC-64

Files:
7 added
14 edited
3 moved

Legend:

Unmodified
Added
Removed
  • Makefile

    r849ba5cb r6bc4dbd  
    4747#
    4848
     49DEFS = -DARCH=$(ARCH)
    4950CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/
    5051LFLAGS = -M
     52AFLAGS =
    5153
    5254## Setup kernel configuration
     
    129131
    130132clean:
     133        -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
    131134        find generic/src/ arch/$(ARCH)/src/ genarch/src/ -name '*.o' -exec rm \{\} \;
    132         -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
    133135        $(MAKE) -C arch/$(ARCH)/boot clean
    134136
     
    138140
    139141depend: config
    140         $(CC) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
     142        $(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend
    141143
    142144arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
    143         $(CC) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
     145        $(CC) $(DEFS) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
    144146
    145147generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
     
    156158
    157159boot: kernel.bin
    158         $(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`"
     160        $(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE="`cat kernel.bin | wc -c`" CC=$(CC) AS=$(AS) LD=$(LD)
    159161
    160162%.o: %.S
    161         $(CC) $(ASFLAGS) $(CFLAGS) -c $< -o $@
     163        $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -c $< -o $@
    162164
    163165%.o: %.s
    164         $(AS) $(ASFLAGS) $< -o $@
     166        $(AS) $(AFLAGS) $< -o $@
    165167
    166168%.o: %.c
    167         $(CC) $(CFLAGS) -c $< -o $@
     169        $(CC) $(DEFS) $(CFLAGS) -c $< -o $@
  • arch/amd64/Makefile.inc

    r849ba5cb r6bc4dbd  
    1 AMD64_TARGET=amd64-linux-gnu
    2 AMD64_CC_DIR=/usr/local/amd64/bin
    3 AMD64_BINUTILS_DIR=/usr/local/amd64/bin
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
    428
    5 CC=$(AMD64_CC_DIR)/$(AMD64_TARGET)-gcc
    6 AS=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-as
    7 LD=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-ld
    8 OBJDUMP=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-objdump
    9 OBJCOPY=$(AMD64_BINUTILS_DIR)/$(AMD64_TARGET)-objcopy
    10 BFD_NAME=elf64-x86-64
    11 BFD_ARCH=i386:x86-64
     29## Toolchain configuration
     30#
    1231
    13 DEFS=-DARCH=$(ARCH) -DFPU_LAZY
     32BFD_NAME = elf64-x86-64
     33BFD_ARCH = i386:x86-64
     34TARGET = amd64-linux-gnu
     35TOOLCHAIN_DIR = /usr/local/amd64/bin
    1436
    15 ifdef SMP
    16 DEFS+=-D$(SMP)
     37## Make some default assumptions
     38#
     39
     40ifndef CPU
     41        CPU = opteron
     42endif
     43CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone
     44
     45## Accepted CPUs
     46#
     47
     48ifeq ($(CPU),opteron)
     49        CFLAGS += -march=opteron
     50        DEFS += -DFENCES=p4
    1751endif
    1852
    19 ifdef HT
    20 DEFS+=-D$(HT)
     53## Own configuration directives
     54#
     55
     56CONFIG_ACPI = y
     57
     58## Accepted configuration directives
     59#
     60
     61ifeq ($(CONFIG_SMP),y)
     62        DEFS += -DSMP
     63endif
     64ifeq ($(CONFIG_HT),y)
     65        DEFS += -DHT
     66endif
     67ifeq ($(CONFIG_FPU_LAZY),y)
     68        DEFS += -DFPU_LAZY
    2169endif
    2270
     71ARCH_SOURCES = \
     72        arch/$(ARCH)/src/dummy.s \
     73        arch/$(ARCH)/src/fpu_context.c \
     74        arch/$(ARCH)/src/boot/boot.S \
     75        arch/$(ARCH)/src/boot/memmap.S \
     76        arch/$(ARCH)/src/pm.c \
     77        arch/$(ARCH)/src/context.S \
     78        arch/$(ARCH)/src/drivers/ega.c \
     79        arch/$(ARCH)/src/drivers/i8042.c \
     80        arch/$(ARCH)/src/drivers/i8254.c \
     81        arch/$(ARCH)/src/drivers/i8259.c \
     82        arch/$(ARCH)/src/delay.S \
     83        arch/$(ARCH)/src/amd64.c \
     84        arch/$(ARCH)/src/bios/bios.c \
     85        arch/$(ARCH)/src/interrupt.c \
     86        arch/$(ARCH)/src/mm/frame.c \
     87        arch/$(ARCH)/src/mm/page.c \
     88        arch/$(ARCH)/src/mm/tlb.c \
     89        arch/$(ARCH)/src/asm_utils.S \
     90        arch/$(ARCH)/src/fmath.c \
     91        arch/$(ARCH)/src/mm/memory_init.c \
     92        arch/$(ARCH)/src/cpu/cpu.c \
     93        arch/$(ARCH)/src/proc/scheduler.c \
     94        arch/$(ARCH)/src/userspace.c
    2395
    24 CFLAGS=$(DEFS) -nostdlib -fno-builtin -fno-unwind-tables -O3 -march=opteron -m64 -mcmodel=kernel -mno-red-zone
    25 LFLAGS=-M
    26 
    27 arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
    28         $(CC) $(CFLAGS) -C -E -x c $< | grep -v "^\#" > $@
    29 
    30 arch_sources = \
    31         generic/src/arch/dummy.s \
    32         generic/src/arch/fpu_context.c \
    33         generic/src/arch/boot/boot.S \
    34         generic/src/arch/boot/memmap.S \
    35         generic/src/arch/pm.c \
    36         generic/src/arch/context.S \
    37         generic/src/arch/drivers/ega.c \
    38         generic/src/arch/drivers/i8042.c \
    39         generic/src/arch/drivers/i8254.c \
    40         generic/src/arch/drivers/i8259.c \
    41         generic/src/arch/delay.S \
    42         generic/src/arch/amd64.c \
    43         generic/src/arch/bios/bios.c \
    44         generic/src/arch/interrupt.c \
    45         generic/src/arch/mm/frame.c \
    46         generic/src/arch/mm/page.c \
    47         generic/src/arch/mm/tlb.c \
    48         generic/src/arch/asm_utils.S \
    49         generic/src/arch/fmath.c \
    50         generic/src/arch/mm/memory_init.c \
    51         generic/src/arch/cpu/cpu.c \
    52         generic/src/arch/proc/scheduler.c \
    53         generic/src/arch/userspace.c
    54 
    55 ifdef SMP
    56 arch_sources += generic/src/arch/smp/ap.S \
    57                 generic/src/arch/smp/apic.c \
    58                 generic/src/arch/smp/ipi.c \
    59                 generic/src/arch/smp/mps.c \
    60                 generic/src/arch/smp/smp.c
     96ifeq ($(CONFIG_SMP),y)
     97        ARCH_SOURCES += \
     98                arch/$(ARCH)/src/smp/ap.S \
     99                arch/$(ARCH)/src/smp/apic.c \
     100                arch/$(ARCH)/src/smp/ipi.c \
     101                arch/$(ARCH)/src/smp/mps.c \
     102                arch/$(ARCH)/src/smp/smp.c
    61103endif
  • arch/ia32/Makefile.inc

    r849ba5cb r6bc4dbd  
    3535TOOLCHAIN_DIR = /usr/local/i686/bin
    3636
     37## Make some default assumptions
     38#
     39
     40ifndef CPU
     41        CPU = pentium4
     42endif
     43
    3744## Accepted CPUs
    3845#
    39 # Default CPU is Pentium 4
    40 #
    4146
    42 ifeq ($CPU,athlon-xp)
     47ifeq ($(CPU),athlon-xp)
    4348        CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
    4449        DEFS += -DFENCES=486
    4550        CONFIG_SMP = n
    4651        CONFIG_HT = n
    47 elseifeq ($CPU,athlon-mp)
     52endif
     53ifeq ($(CPU),athlon-mp)
    4854        CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
    4955        DEFS += -DFENCES=486
    50 elseifeq ($CPU,pentium3)
     56endif
     57ifeq ($(CPU),pentium3)
    5158        CFLAGS += -march=pentium3 -mmmx -msse -msse2
    5259        DEFS += -DFENCES=486
    53 else
     60endif
     61ifeq ($(CPU),pentium4)
    5462        CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
    5563        DEFS += -DFENCES=p4
  • arch/ia32/boot/Makefile

    r849ba5cb r6bc4dbd  
    77
    88boot.bin: boot.o
    9         ld -T boot.ld -entry _start_0x7c00 --oformat binary boot.o -o $@
     9        $(LD) -T boot.ld -entry _start_0x7c00 --oformat binary boot.o -o $@
    1010
    1111boot.o: boot.S
    12         gcc -E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s
    13         as boot.s -o $@
     12        $(CC) -E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s
     13        $(AS) boot.s -o $@
    1414        rm boot.s
    1515
  • arch/ia64/Makefile.inc

    r849ba5cb r6bc4dbd  
    1 IA-64_TARGET=ia64-pc-linux-gnu
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
    228
    3 IA-64_CC_DIR=/usr/local/ia64/bin
    4 IA-64_BINUTILS_DIR=/usr/local/ia64/bin
     29## Toolchain configuration
     30#
    531
    6 CC=$(IA-64_CC_DIR)/$(IA-64_TARGET)-gcc
    7 AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as
    8 LD=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-ld
    9 OBJDUMP=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-objdump
    10 OBJCOPY=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-objcopy
    11 BFD_NAME=elf64-little
    12 BFD_ARCH=ia64-elf64
     32BFD_NAME = elf64-little
     33BFD_ARCH = ia64-elf64
     34TARGET = ia64-pc-linux-gnu
     35TOOLCHAIN_DIR = /usr/local/ia64/bin
    1336
     37## Make some default assumptions
     38#
    1439
    15 ASFLAGS=-mconstant-gp
     40CFLAGS += -mconstant-gp -fno-unwind-tables
     41LFLAGS += -EL
     42AFLAGS += -mconstant-gp
    1643
    17 DEFS=-DARCH=$(ARCH)
    18 CFLAGS=$(DEFS) -mconstant-gp -nostdlib -fno-builtin -fno-unwind-tables -O3
    19 LFLAGS=-EL -M
    20 
    21 
    22 
    23 arch_sources= \
    24         generic/src/arch/start.S \
    25         generic/src/arch/asm.S \
    26         generic/src/arch/dummy.s \
    27         generic/src/arch/putchar.c \
    28         generic/src/arch/ia64.c \
    29         generic/src/arch/fpu_context.c \
    30         generic/src/arch/context.S \
    31         generic/src/arch/ski/ski.c \
    32         generic/src/arch/cpu/cpu.c \
    33         generic/src/arch/ivt.S \
    34         generic/src/arch/interrupt.c \
    35         generic/src/arch/interrupt_handler.c \
    36         generic/src/arch/fmath.c \
    37         generic/src/arch/mm/frame.c \
    38         generic/src/arch/drivers/it.c
     44ARCH_SOURCES = \
     45        arch/$(ARCH)/src/start.S \
     46        arch/$(ARCH)/src/asm.S \
     47        arch/$(ARCH)/src/dummy.s \
     48        arch/$(ARCH)/src/putchar.c \
     49        arch/$(ARCH)/src/ia64.c \
     50        arch/$(ARCH)/src/fpu_context.c \
     51        arch/$(ARCH)/src/context.S \
     52        arch/$(ARCH)/src/ski/ski.c \
     53        arch/$(ARCH)/src/cpu/cpu.c \
     54        arch/$(ARCH)/src/ivt.S \
     55        arch/$(ARCH)/src/interrupt.c \
     56        arch/$(ARCH)/src/interrupt_handler.c \
     57        arch/$(ARCH)/src/fmath.c \
     58        arch/$(ARCH)/src/mm/frame.c \
     59        arch/$(ARCH)/src/drivers/it.c
  • arch/ia64/_link.ld.in

    r849ba5cb r6bc4dbd  
    1 /*
    2  *  IA-64 linker script
     1/** IA-64 linker script
    32 *
    43 *  It is ELF format, but its only section looks like this:
     
    76 *
    87 */
     8
     9#define __ASM__
    910
    1011OUTPUT_FORMAT(elf64-ia64-little)
  • arch/ia64/boot/Makefile

    r849ba5cb r6bc4dbd  
    1 IA-64_BINUTILS_DIR=/usr/local/ia64/bin
    2 IA-64_TARGET=ia64-pc-linux-gnu
    3 
    4 .PHONY: nothing build
    5 
    6 nothing:
     1.PHONY: build clean
    72
    83build: boot.bin
    94        cp boot.bin ../../../load.bin
    105
    11 AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as
    12 LD=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-ld
     6boot.bin: boot.o
     7        $(LD) -EL -T _link.ld -n boot.o -o $@
    138
    14 ASFLAGS=-EL
    15 LFLAGS=-EL -T _link.ld -n
    16 
    17 boot.bin: boot.o
    18         $(LD) $(LFLAGS) boot.o -o $@
    19 
    20 boot.o:
     9boot.o: boot.s
    2110        $(AS) boot.s -o $@
    2211
    2312clean:
    24         -rm *.o *.bin
     13        -rm -f boot.o boot.bin ../../../load.bin
  • arch/mips32/Makefile.inc

    r849ba5cb r6bc4dbd  
    1 MIPS_TARGET=mipsel-linux-gnu
    2 MIPS_CC_DIR=/usr/local/mipsel/bin
    3 MIPS_BINUTILS_DIR=/usr/local/mipsel/bin
    4 
    5 CC=$(MIPS_CC_DIR)/$(MIPS_TARGET)-gcc
    6 AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
    7 LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
    8 OBJDUMP=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objdump
    9 OBJCOPY=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objcopy
    10 BFD_ARCH=mips
    11 
    12 DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
    13 CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2  -fno-zero-initialized-in-bss
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
     28
     29## Toolchain configuration
     30#
     31
     32BFD_NAME = elf32-i386
     33BFD_ARCH = mips
     34TARGET = mipsel-linux-gnu
     35TOOLCHAIN_DIR = /usr/local/mipsel/bin
     36
     37## Make some default assumptions
     38#
     39
     40ifndef CPU
     41        CPU = pentium4
     42endif
     43
     44## Accepted CPUs
     45#
     46
     47ifeq ($(CPU),athlon-xp)
     48        CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow
     49        DEFS += -DFENCES=486
     50        CONFIG_SMP = n
     51        CONFIG_HT = n
     52endif
     53ifeq ($(CPU),athlon-mp)
     54        CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow
     55        DEFS += -DFENCES=486
     56endif
     57ifeq ($(CPU),pentium3)
     58        CFLAGS += -march=pentium3 -mmmx -msse -msse2
     59        DEFS += -DFENCES=486
     60endif
     61ifeq ($(CPU),pentium4)
     62        CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3
     63        DEFS += -DFENCES=p4
     64endif
     65
     66## Own configuration directives
     67#
     68
     69CONFIG_ACPI = y
     70
     71## Accepted configuration directives
     72#
     73
     74ifeq ($(CONFIG_SMP),y)
     75        DEFS += -DSMP
     76endif
     77ifeq ($(CONFIG_HT),y)
     78        DEFS += -DHT
     79endif
     80ifeq ($(CONFIG_FPU_LAZY),y)
     81        DEFS += -DFPU_LAZY
     82endif
     83
     84ARCH_SOURCES = \
     85        arch/$(ARCH)/src/context.s \
     86        arch/$(ARCH)/src/debug/panic.s \
     87        arch/$(ARCH)/src/delay.s \
     88        arch/$(ARCH)/src/asm.S \
     89        arch/$(ARCH)/src/proc/scheduler.c \
     90        arch/$(ARCH)/src/bios/bios.c \
     91        arch/$(ARCH)/src/smp/ap.S \
     92        arch/$(ARCH)/src/smp/apic.c \
     93        arch/$(ARCH)/src/smp/mps.c \
     94        arch/$(ARCH)/src/smp/smp.c \
     95        arch/$(ARCH)/src/atomic.S \
     96        arch/$(ARCH)/src/smp/ipi.c \
     97        arch/$(ARCH)/src/ia32.c \
     98        arch/$(ARCH)/src/interrupt.c \
     99        arch/$(ARCH)/src/pm.c \
     100        arch/$(ARCH)/src/userspace.c \
     101        arch/$(ARCH)/src/cpu/cpu.c \
     102        arch/$(ARCH)/src/mm/frame.c \
     103        arch/$(ARCH)/src/mm/memory_init.c \
     104        arch/$(ARCH)/src/mm/page.c \
     105        arch/$(ARCH)/src/mm/tlb.c \
     106        arch/$(ARCH)/src/drivers/i8042.c \
     107        arch/$(ARCH)/src/drivers/i8254.c \
     108        arch/$(ARCH)/src/drivers/i8259.c \
     109        arch/$(ARCH)/src/drivers/ega.c \
     110        arch/$(ARCH)/src/boot/boot.S \
     111        arch/$(ARCH)/src/boot/memmap.S \
     112        arch/$(ARCH)/src/fpu_context.c\
     113        arch/$(ARCH)/src/fmath.c
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130DEFS= -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
     131CFLAGS=-mno-abicalls -G 0 -nostdlib -fno-builtin -O2  -fno-zero-initialized-in-bss
    14132LFLAGS=
    15 BFD_ARCH=mips
    16133
    17134# GCC 4.0.1 compiled for mipsEL has problems compiling in
  • arch/mips32/boot/Makefile

    r849ba5cb r6bc4dbd  
    1313LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
    1414
    15 ASFLAGS=-mips2 -I../../../generic/include
     15AFLAGS=-mips2 -I../../../generic/include
    1616LFLAGS=--oformat=binary -e start -T _link.ld
    1717
  • arch/ppc32/Makefile.inc

    r849ba5cb r6bc4dbd  
    1 PPC_TARGET=ppc-linux-gnu
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
    228
    3 PPC_CC_DIR=/usr/local/ppc/bin
    4 PPC_BINUTILS_DIR=/usr/local/ppc/bin
     29## Toolchain configuration
     30#
    531
    6 CC=$(PPC_CC_DIR)/$(PPC_TARGET)-gcc
    7 AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as
    8 LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld
    9 OBJDUMP=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-objdump
    10 OBJCOPY=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-objcopy
    11 BFD_NAME=elf32-powerpc
    12 BFD_ARCH=powerpc
     32BFD_NAME = elf32-powerpc
     33BFD_ARCH = powerpc
     34TARGET = ppc-linux-gnu
     35TOOLCHAIN_DIR = /usr/local/ppc/bin
    1336
    14 ASFLAGS=
     37## Make some default assumptions
     38#
    1539
    16 DEFS=-DARCH=$(ARCH)
    17 CFLAGS=$(DEFS) -nostdlib -fno-builtin -O2
    18 LFLAGS=-M -no-check-sections -N
     40LFLAGS += -no-check-sections -N
    1941
    20 arch_sources= \
    21         generic/src/arch/console.c \
    22         generic/src/arch/context.S \
    23         generic/src/arch/debug/panic.s \
    24         generic/src/arch/fpu_context.c \
    25         generic/src/arch/ppc32.c \
    26         generic/src/arch/dummy.s \
    27         generic/src/arch/start.S \
    28         generic/src/arch/asm.S \
    29         generic/src/arch/cpu/cpu.c \
    30         generic/src/arch/mm/frame.c \
    31         generic/src/arch/mm/memory_init.c \
    32         generic/src/arch/mm/page.c \
    33         generic/src/arch/fmath.c
     42## Own configuration directives
     43#
     44
     45CONFIG_OFW = y
     46
     47ARCH_SOURCES = \
     48        arch/$(ARCH)/src/console.c \
     49        arch/$(ARCH)/src/context.S \
     50        arch/$(ARCH)/src/debug/panic.s \
     51        arch/$(ARCH)/src/fpu_context.c \
     52        arch/$(ARCH)/src/ppc32.c \
     53        arch/$(ARCH)/src/dummy.s \
     54        arch/$(ARCH)/src/start.S \
     55        arch/$(ARCH)/src/asm.S \
     56        arch/$(ARCH)/src/cpu/cpu.c \
     57        arch/$(ARCH)/src/mm/frame.c \
     58        arch/$(ARCH)/src/mm/memory_init.c \
     59        arch/$(ARCH)/src/mm/page.c \
     60        arch/$(ARCH)/src/fmath.c
  • arch/ppc32/_link.ld.in

    r849ba5cb r6bc4dbd  
    1 /*
    2  *  PPC32 linker script
     1/** PPC32 linker script
    32 *
    43 *  It is ELF format, but its only section looks like this:
     
    87 */
    98
    10 OUTPUT_FORMAT(elf32-powerpc)
     9#define __ASM__
     10
     11OUTPUT_FORMAT("elf32-powerpc")
    1112ENTRY(kernel_image_start)
    1213
     
    3637
    3738                symbol_table = .;
    38                 *(symtab.*);            /* Symbol table, must be LAST symbol!*/
     39                *(symtab.*);            /* Symbol table, must be LAST symbol!*/
    3940
    4041                kdata_end = .;
  • arch/ppc32/boot/Makefile

    r849ba5cb r6bc4dbd  
    1 PPC_BINUTILS_DIR=/usr/local/ppc/bin
    2 PPC_TARGET=ppc-linux-gnu
     1.PHONY: build clean
    32
    4 .PHONY: nothing build
    5 
    6 nothing:
     3CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include
    74
    85build: boot.bin
    96        cp boot.bin ../../../load.bin
    107
    11 CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc
    12 AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as
    13 LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld
    14 
    15 CPPFLAGS=$(DEFS) -nostdinc -I../include
    16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
    17 LFLAGS=-no-check-sections -N -T _link.ld
    18 
    198boot.bin: boot.o main.o
    20         $(LD) $(LFLAGS) boot.o main.o -o $@
     9        $(LD) -no-check-sections -N -T _link.ld boot.o main.o -o $@
    2110
    2211boot.o: boot.S
     
    2716
    2817clean:
    29         -rm *.o *.bin
     18        -rm -f boot.o main.o boot.bin ../../../load.bin
  • arch/sparc64/Makefile.inc

    r849ba5cb r6bc4dbd  
    1 TARGET=sparc64-linux-gnu
     1#
     2# Copyright (C) 2005 Martin Decky
     3# All rights reserved.
     4#
     5# Redistribution and use in source and binary forms, with or without
     6# modification, are permitted provided that the following conditions
     7# are met:
     8#
     9# - Redistributions of source code must retain the above copyright
     10#   notice, this list of conditions and the following disclaimer.
     11# - Redistributions in binary form must reproduce the above copyright
     12#   notice, this list of conditions and the following disclaimer in the
     13#   documentation and/or other materials provided with the distribution.
     14# - The name of the author may not be used to endorse or promote products
     15#   derived from this software without specific prior written permission.
     16#
     17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27#
    228
    3 CC_DIR=/usr/local/sparc64/bin
    4 BINUTILS_DIR=/usr/local/sparc64/bin
     29## Toolchain configuration
     30#
    531
    6 CC=$(CC_DIR)/$(TARGET)-gcc
    7 AS=$(BINUTILS_DIR)/$(TARGET)-as
    8 LD=$(BINUTILS_DIR)/$(TARGET)-ld
    9 OBJDUMP=$(BINUTILS_DIR)/$(TARGET)-objdump
    10 OBJCOPY=$(BINUTILS_DIR)/$(TARGET)-objcopy
    11 BFD_NAME=elf64-sparc
    12 BFD_ARCH=sparc
     32BFD_NAME = elf64-sparc
     33BFD_ARCH = sparc
     34TARGET = sparc64-linux-gnu
     35TOOLCHAIN_DIR = /usr/local/sparc64/bin
    1336
    14 ASFLAGS=
     37## Make some default assumptions
     38#
    1539
    16 DEFS=-DARCH=$(ARCH)
    17 CFLAGS=$(DEFS) -nostdlib -fno-builtin -mcpu=ultrasparc -m64 -O2
    18 LFLAGS=-M -no-check-sections -N
     40CFLAGS += -mcpu=ultrasparc -m64
     41LFLAGS += -no-check-sections -N
    1942
    20 arch_sources= \
    21         generic/src/arch/asm.S \
    22         generic/src/arch/console.c \
    23         generic/src/arch/context.S \
    24         generic/src/arch/dummy.s \
    25         generic/src/arch/sparc64.c \
    26         generic/src/arch/start.S \
    27         generic/src/arch/mm/frame.c \
    28         generic/src/arch/mm/page.c
    29        
     43## Own configuration directives
     44#
    3045
     46CONFIG_OFW = y
     47
     48ARCH_SOURCES = \
     49        arch/$(ARCH)/src/dummy.s \
     50        arch/$(ARCH)/src/start.S
  • arch/sparc64/_link.ld.in

    r849ba5cb r6bc4dbd  
    1 /*
    2  *  SPARC64 linker script
     1/** SPARC64 linker script
    32 *
    43 *  It is ELF format, but its only section looks like this:
     
    87 */
    98
    10 OUTPUT_FORMAT(elf64-sparc)
     9#define __ASM__
     10
     11OUTPUT_FORMAT("elf64-sparc")
    1112ENTRY(kernel_image_start)
    1213
  • arch/sparc64/boot/Makefile

    r849ba5cb r6bc4dbd  
    1 BINUTILS_DIR=/usr/local/sparc64/bin
    2 TARGET=sparc64-linux-gnu
     1.PHONY: build clean
    32
    4 .PHONY: nothing build
    5 
    6 nothing:
     3CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include
    74
    85build: boot.bin
    96        cp boot.bin ../../../load.bin
    107
    11 CC=$(BINUTILS_DIR)/$(TARGET)-gcc
    12 AS=$(BINUTILS_DIR)/$(TARGET)-as
    13 LD=$(BINUTILS_DIR)/$(TARGET)-ld
     8boot.bin: boot.a.out
     9        dd if=/dev/zero of=$@ bs=512 count=16
     10        dd if=boot.a.out of=$@ bs=512 seek=1 conv=notrunc
    1411
    15 CPPFLAGS=$(DEFS) -nostdinc -I../include
    16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
    17 LFLAGS=-no-check-sections -N -T _link.ld -s
    18 
    19 boot.bin: boot.aout
    20         dd if=/dev/zero of=$@ bs=512 count=16
    21         dd if=boot.aout of=$@ bs=512 seek=1 conv=notrunc
    22 
    23 boot.aout: boot.o
    24         $(LD) $(LFLAGS) boot.o -o $@
     12boot.a.out: boot.o
     13        $(LD) -no-check-sections -N -T _link.ld -s boot.o -o $@
    2514
    2615boot.o: boot.S
     
    2817
    2918clean:
    30         -rm *.o *.bin *.aout
     19        -rm -f boot.o boot.a.out boot.bin ../../../load.bin
  • build.ia32

    r849ba5cb r6bc4dbd  
    11#! /bin/sh
    22
    3 COMPILER=""
     3function syntax {
     4        echo "Syntax:"
     5        echo " build.<arch> [-compiler <compiler>] [-cpu <cpu>]"
     6        echo
     7        echo "<arch>     ... amd64, *ia32, ia64, mips32, ppc32, sparc64"
     8        echo "<compiler> ... native, *cross"
     9        echo "<cpu>      ... for ia32: athlon-xp, athlon-mp, pentium3, *pentium4"
     10        echo
     11}
    412
     13ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
     14if [ -z "$ARCH" ]; then
     15        syntax
     16        exit 1
     17fi
     18
     19ARGS=""
    520while [ "$#" -gt 0 ]; do
    621        case "$1" in
    7                 native)
    8                         COMPILER="$COMPILER NATIVE_COMPILER=yes"
     22                -compiler)
     23                        ARGS="$ARGS COMPILER=$2"
     24                        shift
    925                        ;;
    10                 strong)
    11                         COMPILER="$COMPILER STRONG_ORDERING=yes"
     26                -cpu)
     27                        ARGS="$ARGS CPU=$2"
     28                        shift
    1229                        ;;
    1330                *)
    14                         echo "Supported arguments: native strong"
     31                        syntax
    1532                        exit 1
    1633                        ;;
     
    1936done
    2037
    21 make all ARCH=ia32 $COMPILER
    22 ( cd uspace/libc && make all ARCH=ia32 $COMPILER )
    23 ( cd uspace && make all ARCH=ia32 $COMPILER )
     38make all "ARCH=$ARCH" $ARGS
  • clean

    r849ba5cb r6bc4dbd  
    11#! /bin/sh
    22
    3 make clean
     3ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`"
     4if [ -z "$ARCH" ]; then
     5        for ARCH in arch/* ; do
     6                make clean "ARCH=`basename "$ARCH"`"
     7        done
     8else
     9        make clean "ARCH=$ARCH"
     10fi
Note: See TracChangeset for help on using the changeset viewer.