Files
rosetta/arch/x86_64/command/run-kernel.py
T
wash 1ec33767ab 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.
2026-07-19 13:34:32 +01:00

31 lines
804 B
Python

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