meta: replace cmake mono-build system with a custom build co-ordinator

every system component now has its own self-contained build system, and a
seed file describing the component and its build system and dependencies.

a new tool, meadow, collects and uses these seed files to build the
components into a full system. meadow also manages the target system root
and a host prefix where toolchain tools are installed to.

the build system has also been updated to use a new $ARCH-rosetta-gcc
compiler, and the patches files necessary to build it have been
added to toolchain/cross-compiler.
This commit is contained in:
2026-07-19 13:34:32 +01:00
parent 59034be9e6
commit 1ec33767ab
104 changed files with 7111 additions and 257 deletions
+5
View File
@@ -0,0 +1,5 @@
[command]
name = 'debug'
description = 'Run the system under a debugger'
# vim: ft=toml
+12
View File
@@ -0,0 +1,12 @@
[command]
name = 'run-kernel'
description = 'Run the kernel image directly under QEMU'
[dependency]
commands = [ 'qemu-system-x86_64' ]
seeds = [ 'magenta', 'bsp' ]
[exec]
args = [ 'src:run-kernel.py']
# vim: ft=toml
+30
View File
@@ -0,0 +1,30 @@
import os
import shutil
import subprocess
sysroot = os.environ['MEADOW_SYSROOT']
native_root = os.environ['MEADOW_NATIVE_ROOT']
tmp = os.environ['MEADOW_TEMP']
bsp = os.path.join(sysroot, 'boot', 'rosetta-system.bsp')
kernel_exe = os.path.join(sysroot, 'boot', 'magenta_kernel')
kernel_exe_elf32 = os.path.join(tmp, 'magenta_kernel.elf32')
e64patch = os.path.join(native_root, 'bin', 'e64patch')
shutil.copyfile(kernel_exe, kernel_exe_elf32)
subprocess.run([ e64patch, kernel_exe_elf32 ])
qemu_args = [
'qemu-system-x86_64',
'-m', '128M',
'-cpu', 'qemu64,+rdrand',
'-kernel', kernel_exe_elf32,
'-initrd', bsp,
'-serial', 'stdio',
'--append', 'kernel.early-console=ttyS0'
]
try:
subprocess.run(qemu_args)
except KeyboardInterrupt:
pass