[build] Move to python build scripts per module

This change moves Bonnibel from a separate project into the jsix tree,
and alters the project configuration to be jsix-specific. (I stopped
using bonnibel for any other projects, so it's far easier to make it a
custom generator for jsix.) The build system now also uses actual python
code in `*.module` files to configure modules instead of TOML files.
Target configs (boot, kernel-mode, user-mode) now moved to separate TOML
files under `configs/` and can inherit from one another.
This commit is contained in:
Justin C. Miller
2021-08-26 01:47:58 -07:00
parent e19177d3ed
commit f79fe2e056
42 changed files with 1242 additions and 595 deletions

59
src/kernel/kernel.module Normal file
View File

@@ -0,0 +1,59 @@
# vim: ft=python
kernel = module("kernel",
kind = "exe",
default = True,
output = "jsix.elf",
targets = [ "kernel" ],
deps = [ "kutil", "cpu" ],
includes = [ "." ],
sources = [
"apic.cpp",
"ap_startup.s",
"boot.s",
"clock.cpp",
"console.cpp",
"cpprt.cpp",
"cpu.cpp",
"debug.cpp",
"debug.s",
"device_manager.cpp",
"frame_allocator.cpp",
"gdt.cpp",
"gdtidt.s",
"hpet.cpp",
"idt.cpp",
"interrupts.cpp",
"interrupts.s",
"io.cpp",
"log.cpp",
"main.cpp",
"memory_bootstrap.cpp",
"msr.cpp",
"objects/channel.cpp",
"objects/endpoint.cpp",
"objects/kobject.cpp",
"objects/thread.cpp",
"objects/process.cpp",
"objects/system.cpp",
"objects/vm_area.cpp",
"page_table.cpp",
"page_tree.cpp",
"pci.cpp",
"scheduler.cpp",
"serial.cpp",
"syscall.cpp",
"syscall.s",
"syscalls/channel.cpp",
"syscalls/endpoint.cpp",
"syscalls/object.cpp",
"syscalls/process.cpp",
"syscalls/system.cpp",
"syscalls/thread.cpp",
"syscalls/vm_area.cpp",
"task.s",
"tss.cpp",
"vm_space.cpp",
])
kernel.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/kernel.ld"]

View File

@@ -1,57 +0,0 @@
name = "kernel"
kind = "exe"
output = "jsix.elf"
targets = ["kernel"]
deps = ["kutil", "cpu"]
includes = ["src/kernel"]
sources = [
"apic.cpp",
"ap_startup.s",
"boot.s",
"clock.cpp",
"console.cpp",
"cpprt.cpp",
"cpu.cpp",
"debug.cpp",
"debug.s",
"device_manager.cpp",
"frame_allocator.cpp",
"gdt.cpp",
"gdtidt.s",
"hpet.cpp",
"idt.cpp",
"interrupts.cpp",
"interrupts.s",
"io.cpp",
"log.cpp",
"main.cpp",
"memory_bootstrap.cpp",
"msr.cpp",
"objects/channel.cpp",
"objects/endpoint.cpp",
"objects/kobject.cpp",
"objects/thread.cpp",
"objects/process.cpp",
"objects/system.cpp",
"objects/vm_area.cpp",
"page_table.cpp",
"page_tree.cpp",
"pci.cpp",
"scheduler.cpp",
"serial.cpp",
"syscall.cpp",
"syscall.s",
"syscalls/channel.cpp",
"syscalls/endpoint.cpp",
"syscalls/object.cpp",
"syscalls/process.cpp",
"syscalls/system.cpp",
"syscalls/thread.cpp",
"syscalls/vm_area.cpp",
"task.s",
"tss.cpp",
"vm_space.cpp",
]
[variables]
ldflags = ["${ldflags}", "-T", "${source_root}/src/kernel/kernel.ld"]

View File

@@ -1,16 +0,0 @@
name = "panic.serial"
kind = "exe"
output = "panic.serial.elf"
targets = ["kernel"]
deps = ["kutil", "elf"]
includes = ["src/kernel/panic.serial", "src/kernel"]
sources = [
"display.cpp",
"entry.s",
"main.cpp",
"serial.cpp",
"symbol_table.cpp",
]
[variables]
ldflags = ["${ldflags}", "-T", "${source_root}/src/kernel/panic.serial/panic.serial.ld"]

View File

@@ -0,0 +1,16 @@
# vim: ft=python
panic = module("panic.serial",
kind = "exe",
output = "panic.serial.elf",
targets = [ "kernel" ],
deps = [ "kutil", "elf", "kernel" ],
sources = [
"display.cpp",
"entry.s",
"main.cpp",
"serial.cpp",
"symbol_table.cpp",
])
panic.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/panic.serial/panic.serial.ld"]