metal-cos/sys/SConscript

63 lines
1.3 KiB
Python
Raw Normal View History

2014-02-12 13:47:13 -08:00
import sys
Import('env')
kern_env = env.Clone()
src = [ ]
src_amd64 = [
# Multiboot requires multiboot.S to be the first file
"amd64/multiboot.S",
"amd64/mbentry.c",
# AMD64
2014-07-13 23:16:54 -07:00
"amd64/critical.c",
2014-07-13 13:36:43 -07:00
"amd64/debug.c",
2014-07-13 16:52:18 -07:00
"amd64/disasm.c",
"amd64/ioapic.c",
"amd64/irq.c",
"amd64/lapic.c",
2014-02-12 13:47:13 -08:00
"amd64/machine.c",
"amd64/pci.c",
"amd64/pmap.c",
"amd64/switch.S",
"amd64/thread.c",
"amd64/trap.c",
"amd64/trapentry.S",
"amd64/xmem.c",
# Devices
"dev/x86/debugcons.c",
2014-07-13 13:04:14 -07:00
"dev/x86/sercons.c",
"dev/x86/vgacons.c",
"dev/x86/ide.c",
2014-02-12 13:47:13 -08:00
]
src_common = [
2014-07-03 17:36:31 -07:00
"kern/debug.c",
"kern/disk.c",
2014-02-12 13:47:13 -08:00
"kern/libc.c",
"kern/palloc.c",
"kern/printf.c",
2014-07-10 15:55:32 -07:00
"kern/spinlock.c",
"kern/thread.c",
"dev/ahci.c",
"dev/console.c",
"dev/pci.c",
2014-02-12 13:47:13 -08:00
]
if (env["ARCH"] == "amd64"):
src.append(src_amd64)
src.append(src_common)
2014-07-18 13:37:46 -07:00
ldscript = "#sys/amd64/kernel.lds"
2014-02-12 13:47:13 -08:00
2014-07-18 13:37:46 -07:00
kern_env.Append(LINKFLAGS = ['-T', ldscript[1:], '-N', '-nostdlib'])
2014-02-12 13:47:13 -08:00
kern_env.Append(CPPFLAGS = ['-ffreestanding', '-fno-builtin', '-nostdinc',
2014-07-18 13:37:46 -07:00
'-mno-red-zone', '-mno-mmx', '-mno-sse',
'-mcmodel=large'])
2014-02-12 13:47:13 -08:00
# '-target', 'amd64-orion-eabi'
2014-07-21 23:43:01 -07:00
kern_env.Append(CPPPATH = ['#build/include'])
2014-02-12 13:47:13 -08:00
2014-07-18 13:37:46 -07:00
kernel = kern_env.Program("castor", src)
Depends(kernel, ldscript)
2014-02-12 13:47:13 -08:00