2014-02-12 21:47:13 +00: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
|
|
|
|
"amd64/trap.c",
|
|
|
|
"amd64/trapentry.S",
|
|
|
|
"amd64/machine.c",
|
2014-06-30 22:52:35 +00:00
|
|
|
"amd64/pci.c",
|
|
|
|
"amd64/pmap.c",
|
2014-02-12 21:47:13 +00:00
|
|
|
"amd64/lapic.c",
|
|
|
|
"amd64/ioapic.c",
|
2014-07-10 21:01:15 +00:00
|
|
|
"amd64/irq.c",
|
2014-07-02 21:06:00 +00:00
|
|
|
"dev/x86/debugcons.c",
|
2014-07-06 01:46:59 +00:00
|
|
|
"dev/x86/vgacons.c",
|
|
|
|
"dev/x86/ide.c",
|
2014-02-12 21:47:13 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
src_common = [
|
2014-07-04 00:36:31 +00:00
|
|
|
"kern/debug.c",
|
2014-02-12 21:47:13 +00:00
|
|
|
"kern/libc.c",
|
|
|
|
"kern/palloc.c",
|
|
|
|
"kern/printf.c",
|
2014-07-02 21:06:00 +00:00
|
|
|
"dev/ahci.c",
|
|
|
|
"dev/console.c",
|
|
|
|
"dev/pci.c",
|
2014-02-12 21:47:13 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if (env["ARCH"] == "amd64"):
|
|
|
|
src.append(src_amd64)
|
|
|
|
src.append(src_common)
|
|
|
|
|
|
|
|
kern_env.Append(LINKFLAGS = ['-N', '-nostdlib'])
|
|
|
|
kern_env.Append(CPPFLAGS = ['-ffreestanding', '-fno-builtin', '-nostdinc',
|
|
|
|
'-mno-red-zone', '-mcmodel=kernel'])
|
|
|
|
# '-target', 'amd64-orion-eabi'
|
|
|
|
kern_env.Append(CPPPATH = ['#include', '#sys/include'])
|
|
|
|
|
|
|
|
kern_env.Program("castor", src)
|
|
|
|
|