Changeset 6bc4dbd in mainline
- Timestamp:
- 2005-11-08T00:00:15Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5b65205
- Parents:
- 849ba5cb
- Files:
-
- 7 added
- 14 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r849ba5cb r6bc4dbd 47 47 # 48 48 49 DEFS = -DARCH=$(ARCH) 49 50 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -Igeneric/include/ 50 51 LFLAGS = -M 52 AFLAGS = 51 53 52 54 ## Setup kernel configuration … … 129 131 130 132 clean: 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 131 134 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.ld133 135 $(MAKE) -C arch/$(ARCH)/boot clean 134 136 … … 138 140 139 141 depend: config 140 $(CC) $( CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend142 $(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 141 143 142 144 arch/$(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 "^\#" > $@ 144 146 145 147 generic/src/debug/real_map.bin: depend arch/$(ARCH)/_link.ld $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) … … 156 158 157 159 boot: 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) 159 161 160 162 %.o: %.S 161 $(CC) $( ASFLAGS) $(CFLAGS) -c $< -o $@163 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -c $< -o $@ 162 164 163 165 %.o: %.s 164 $(AS) $(A SFLAGS) $< -o $@166 $(AS) $(AFLAGS) $< -o $@ 165 167 166 168 %.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 # 4 28 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 # 12 31 13 DEFS=-DARCH=$(ARCH) -DFPU_LAZY 32 BFD_NAME = elf64-x86-64 33 BFD_ARCH = i386:x86-64 34 TARGET = amd64-linux-gnu 35 TOOLCHAIN_DIR = /usr/local/amd64/bin 14 36 15 ifdef SMP 16 DEFS+=-D$(SMP) 37 ## Make some default assumptions 38 # 39 40 ifndef CPU 41 CPU = opteron 42 endif 43 CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone 44 45 ## Accepted CPUs 46 # 47 48 ifeq ($(CPU),opteron) 49 CFLAGS += -march=opteron 50 DEFS += -DFENCES=p4 17 51 endif 18 52 19 ifdef HT 20 DEFS+=-D$(HT) 53 ## Own configuration directives 54 # 55 56 CONFIG_ACPI = y 57 58 ## Accepted configuration directives 59 # 60 61 ifeq ($(CONFIG_SMP),y) 62 DEFS += -DSMP 63 endif 64 ifeq ($(CONFIG_HT),y) 65 DEFS += -DHT 66 endif 67 ifeq ($(CONFIG_FPU_LAZY),y) 68 DEFS += -DFPU_LAZY 21 69 endif 22 70 71 ARCH_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 23 95 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 96 ifeq ($(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 61 103 endif -
arch/ia32/Makefile.inc
r849ba5cb r6bc4dbd 35 35 TOOLCHAIN_DIR = /usr/local/i686/bin 36 36 37 ## Make some default assumptions 38 # 39 40 ifndef CPU 41 CPU = pentium4 42 endif 43 37 44 ## Accepted CPUs 38 45 # 39 # Default CPU is Pentium 440 #41 46 42 ifeq ($ CPU,athlon-xp)47 ifeq ($(CPU),athlon-xp) 43 48 CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow 44 49 DEFS += -DFENCES=486 45 50 CONFIG_SMP = n 46 51 CONFIG_HT = n 47 elseifeq ($CPU,athlon-mp) 52 endif 53 ifeq ($(CPU),athlon-mp) 48 54 CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow 49 55 DEFS += -DFENCES=486 50 elseifeq ($CPU,pentium3) 56 endif 57 ifeq ($(CPU),pentium3) 51 58 CFLAGS += -march=pentium3 -mmmx -msse -msse2 52 59 DEFS += -DFENCES=486 53 else 60 endif 61 ifeq ($(CPU),pentium4) 54 62 CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3 55 63 DEFS += -DFENCES=p4 -
arch/ia32/boot/Makefile
r849ba5cb r6bc4dbd 7 7 8 8 boot.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 $@ 10 10 11 11 boot.o: boot.S 12 gcc-E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s13 asboot.s -o $@12 $(CC) -E -DKERNEL_SIZE=$(KERNEL_SIZE) boot.S > boot.s 13 $(AS) boot.s -o $@ 14 14 rm boot.s 15 15 -
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 # 2 28 3 IA-64_CC_DIR=/usr/local/ia64/bin4 IA-64_BINUTILS_DIR=/usr/local/ia64/bin 29 ## Toolchain configuration 30 # 5 31 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 32 BFD_NAME = elf64-little 33 BFD_ARCH = ia64-elf64 34 TARGET = ia64-pc-linux-gnu 35 TOOLCHAIN_DIR = /usr/local/ia64/bin 13 36 37 ## Make some default assumptions 38 # 14 39 15 ASFLAGS=-mconstant-gp 40 CFLAGS += -mconstant-gp -fno-unwind-tables 41 LFLAGS += -EL 42 AFLAGS += -mconstant-gp 16 43 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 44 ARCH_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 3 2 * 4 3 * It is ELF format, but its only section looks like this: … … 7 6 * 8 7 */ 8 9 #define __ASM__ 9 10 10 11 OUTPUT_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 7 2 8 3 build: boot.bin 9 4 cp boot.bin ../../../load.bin 10 5 11 AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as 12 LD=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-ld 6 boot.bin: boot.o 7 $(LD) -EL -T _link.ld -n boot.o -o $@ 13 8 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: 9 boot.o: boot.s 21 10 $(AS) boot.s -o $@ 22 11 23 12 clean: 24 -rm *.o *.bin13 -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 32 BFD_NAME = elf32-i386 33 BFD_ARCH = mips 34 TARGET = mipsel-linux-gnu 35 TOOLCHAIN_DIR = /usr/local/mipsel/bin 36 37 ## Make some default assumptions 38 # 39 40 ifndef CPU 41 CPU = pentium4 42 endif 43 44 ## Accepted CPUs 45 # 46 47 ifeq ($(CPU),athlon-xp) 48 CFLAGS += -march=athlon-xp -mmmx -msse -m3dnow 49 DEFS += -DFENCES=486 50 CONFIG_SMP = n 51 CONFIG_HT = n 52 endif 53 ifeq ($(CPU),athlon-mp) 54 CFLAGS += -march=athlon-mp -mmmx -msse -m3dnow 55 DEFS += -DFENCES=486 56 endif 57 ifeq ($(CPU),pentium3) 58 CFLAGS += -march=pentium3 -mmmx -msse -msse2 59 DEFS += -DFENCES=486 60 endif 61 ifeq ($(CPU),pentium4) 62 CFLAGS += -march=pentium4 -mfpmath=sse -mmmx -msse -msse2 -msse3 63 DEFS += -DFENCES=p4 64 endif 65 66 ## Own configuration directives 67 # 68 69 CONFIG_ACPI = y 70 71 ## Accepted configuration directives 72 # 73 74 ifeq ($(CONFIG_SMP),y) 75 DEFS += -DSMP 76 endif 77 ifeq ($(CONFIG_HT),y) 78 DEFS += -DHT 79 endif 80 ifeq ($(CONFIG_FPU_LAZY),y) 81 DEFS += -DFPU_LAZY 82 endif 83 84 ARCH_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 130 DEFS= -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} 131 CFLAGS=-mno-abicalls -G 0 -nostdlib -fno-builtin -O2 -fno-zero-initialized-in-bss 14 132 LFLAGS= 15 BFD_ARCH=mips16 133 17 134 # GCC 4.0.1 compiled for mipsEL has problems compiling in -
arch/mips32/boot/Makefile
r849ba5cb r6bc4dbd 13 13 LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld 14 14 15 A SFLAGS=-mips2 -I../../../generic/include15 AFLAGS=-mips2 -I../../../generic/include 16 16 LFLAGS=--oformat=binary -e start -T _link.ld 17 17 -
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 # 2 28 3 PPC_CC_DIR=/usr/local/ppc/bin4 PPC_BINUTILS_DIR=/usr/local/ppc/bin 29 ## Toolchain configuration 30 # 5 31 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 32 BFD_NAME = elf32-powerpc 33 BFD_ARCH = powerpc 34 TARGET = ppc-linux-gnu 35 TOOLCHAIN_DIR = /usr/local/ppc/bin 13 36 14 ASFLAGS= 37 ## Make some default assumptions 38 # 15 39 16 DEFS=-DARCH=$(ARCH) 17 CFLAGS=$(DEFS) -nostdlib -fno-builtin -O2 18 LFLAGS=-M -no-check-sections -N 40 LFLAGS += -no-check-sections -N 19 41 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 45 CONFIG_OFW = y 46 47 ARCH_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 3 2 * 4 3 * It is ELF format, but its only section looks like this: … … 8 7 */ 9 8 10 OUTPUT_FORMAT(elf32-powerpc) 9 #define __ASM__ 10 11 OUTPUT_FORMAT("elf32-powerpc") 11 12 ENTRY(kernel_image_start) 12 13 … … 36 37 37 38 symbol_table = .; 38 39 *(symtab.*); /* Symbol table, must be LAST symbol!*/ 39 40 40 41 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 3 2 4 .PHONY: nothing build 5 6 nothing: 3 CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include 7 4 8 5 build: boot.bin 9 6 cp boot.bin ../../../load.bin 10 7 11 CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc12 AS=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-as13 LD=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-ld14 15 CPPFLAGS=$(DEFS) -nostdinc -I../include16 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O217 LFLAGS=-no-check-sections -N -T _link.ld18 19 8 boot.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 $@ 21 10 22 11 boot.o: boot.S … … 27 16 28 17 clean: 29 -rm *.o *.bin18 -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 # 2 28 3 CC_DIR=/usr/local/sparc64/bin4 BINUTILS_DIR=/usr/local/sparc64/bin 29 ## Toolchain configuration 30 # 5 31 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 32 BFD_NAME = elf64-sparc 33 BFD_ARCH = sparc 34 TARGET = sparc64-linux-gnu 35 TOOLCHAIN_DIR = /usr/local/sparc64/bin 13 36 14 ASFLAGS= 37 ## Make some default assumptions 38 # 15 39 16 DEFS=-DARCH=$(ARCH) 17 CFLAGS=$(DEFS) -nostdlib -fno-builtin -mcpu=ultrasparc -m64 -O2 18 LFLAGS=-M -no-check-sections -N 40 CFLAGS += -mcpu=ultrasparc -m64 41 LFLAGS += -no-check-sections -N 19 42 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 # 30 45 46 CONFIG_OFW = y 47 48 ARCH_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 3 2 * 4 3 * It is ELF format, but its only section looks like this: … … 8 7 */ 9 8 10 OUTPUT_FORMAT(elf64-sparc) 9 #define __ASM__ 10 11 OUTPUT_FORMAT("elf64-sparc") 11 12 ENTRY(kernel_image_start) 12 13 -
arch/sparc64/boot/Makefile
r849ba5cb r6bc4dbd 1 BINUTILS_DIR=/usr/local/sparc64/bin 2 TARGET=sparc64-linux-gnu 1 .PHONY: build clean 3 2 4 .PHONY: nothing build 5 6 nothing: 3 CFLAGS = -nostdinc -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -I../include 7 4 8 5 build: boot.bin 9 6 cp boot.bin ../../../load.bin 10 7 11 CC=$(BINUTILS_DIR)/$(TARGET)-gcc 12 AS=$(BINUTILS_DIR)/$(TARGET)-as 13 LD=$(BINUTILS_DIR)/$(TARGET)-ld 8 boot.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 14 11 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 $@ 12 boot.a.out: boot.o 13 $(LD) -no-check-sections -N -T _link.ld -s boot.o -o $@ 25 14 26 15 boot.o: boot.S … … 28 17 29 18 clean: 30 -rm *.o *.bin *.aout19 -rm -f boot.o boot.a.out boot.bin ../../../load.bin -
build.ia32
r849ba5cb r6bc4dbd 1 1 #! /bin/sh 2 2 3 COMPILER="" 3 function 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 } 4 12 13 ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`" 14 if [ -z "$ARCH" ]; then 15 syntax 16 exit 1 17 fi 18 19 ARGS="" 5 20 while [ "$#" -gt 0 ]; do 6 21 case "$1" in 7 native) 8 COMPILER="$COMPILER NATIVE_COMPILER=yes" 22 -compiler) 23 ARGS="$ARGS COMPILER=$2" 24 shift 9 25 ;; 10 strong) 11 COMPILER="$COMPILER STRONG_ORDERING=yes" 26 -cpu) 27 ARGS="$ARGS CPU=$2" 28 shift 12 29 ;; 13 30 *) 14 echo "Supported arguments: native strong"31 syntax 15 32 exit 1 16 33 ;; … … 19 36 done 20 37 21 make all ARCH=ia32 $COMPILER 22 ( cd uspace/libc && make all ARCH=ia32 $COMPILER ) 23 ( cd uspace && make all ARCH=ia32 $COMPILER ) 38 make all "ARCH=$ARCH" $ARGS -
clean
r849ba5cb r6bc4dbd 1 1 #! /bin/sh 2 2 3 make clean 3 ARCH="`basename "$0" | awk -F. '{ if (NF > 1) print \$NF }'`" 4 if [ -z "$ARCH" ]; then 5 for ARCH in arch/* ; do 6 make clean "ARCH=`basename "$ARCH"`" 7 done 8 else 9 make clean "ARCH=$ARCH" 10 fi
Note:
See TracChangeset
for help on using the changeset viewer.