Boot framework rework (#45)
[lunaix-os.git] / lunaix-os / arch / x86 / LBuild
1 use("hal")
2
3 sources([
4     "exceptions/interrupts.c",
5     "exceptions/isrdef.c",
6     "exceptions/intr_routines.c",
7     "exceptions/isrm.c",
8     "exceptions/intrhnds.S",
9 ])
10
11 sources([
12     "boot/mb_parser.c",
13     "boot/kpt_setup.c",
14     "boot/boot_helper.c",
15     "boot/bootmem.c"
16 ])
17
18 sources([
19     "mm/fault.c",
20     "mm/tlb.c",
21     "mm/pmm.c",
22     "mm/gdt.c",
23     "mm/vmutils.c"
24 ])
25
26 sources([
27     "klib/fast_crc.c",
28     "klib/fast_str.c",
29     "exec/exec.c",
30     "hart.c",
31     "arch.c",
32     "gdbstub.c",
33     "trace.c",
34     "hart.c",
35     "failsafe.S"
36 ])
37
38 sources({
39     config("arch"): {
40         "x86_64": [
41             "hart64.c",
42             "syscall64.S",
43             "exceptions/interrupt64.S",
44             "boot/x86_64/boot64.S",
45             "boot/x86_64/init64.c",
46             "boot/x86_64/prologue64.S",
47             "boot/x86_64/kremap64.c",
48             "exec/elf64.c"
49         ],
50         "i386": [
51             "hart32.c",
52             "syscall32.S",
53             "exceptions/interrupt32.S",
54             "boot/i386/boot32.S",
55             "boot/i386/init32.c",
56             "boot/i386/prologue32.S",
57             "boot/i386/kremap32.c",
58             "exec/elf32.c"
59         ]
60     }
61 })
62
63 headers([
64     "includes"
65 ])
66
67
68 if config("arch") == "x86_64":
69     compile_opts([
70         "-m64", 
71         "-fno-unwind-tables", 
72         "-fno-asynchronous-unwind-tables",
73         "-mcmodel=large"
74     ])
75     linking_opts([
76         "-m64",
77     ])
78 else:
79     compile_opts("-m32")
80     linking_opts("-m32")
81
82 if not config("x86_enable_sse_feature"):
83     compile_opts("-mno-sse")