from . import hal src.c += ( "exceptions/interrupts.c", "exceptions/isrdef.c", "exceptions/intrhnds.S", ) src.c += ( "boot/mb_parser.c", "boot/kpt_setup.c", "boot/boot_helper.c", ) src.c += ( "mm/fault.c", "mm/tlb.c", "mm/pmm.c", "mm/gdt.c", "mm/vmutils.c" ) src.c += ( "klib/fast_crc.c", "klib/fast_str.c", "exec/exec.c", "hart.c", "arch.c", "gdbstub.c", "trace.c", "hart.c", "failsafe.S", "syscall_lut.S" ) match config.arch: case "x86_64": src.c += ( "hart64.c", "syscall64.S", "exceptions/interrupt64.S", "boot/x86_64/boot64.S", "boot/x86_64/init64.c", "boot/x86_64/prologue64.S", "boot/x86_64/kremap64.c", "exec/elf64.c" ) case "i386": src.c += ( "hart32.c", "syscall32.S", "exceptions/interrupt32.S", "boot/i386/boot32.S", "boot/i386/init32.c", "boot/i386/prologue32.S", "boot/i386/kremap32.c", "exec/elf32.c" ) src.h += "includes" if config.arch == "x86_64": flag.cc += ( "-m64", "-fno-unwind-tables", "-fno-asynchronous-unwind-tables", "-mcmodel=large" ) flag.ld += "-m64" else: flag.cc += "-m32" flag.ld += "-m32" if not config.x86_enable_sse_feature: flag.cc += "-mno-sse"