Quantum
d5d92555ae
Just ecall wrapper for now TODO: Build system changes are lazy and need to be figured out TODO: Looks like kernel.cpp was indented with tabs, fix
52 lines
1 KiB
Meson
52 lines
1 KiB
Meson
objcopy = find_program('riscv64-linux-gnu-objcopy')
|
|
mkimage = find_program('mkimage')
|
|
|
|
arch_sources += [
|
|
|
|
]
|
|
|
|
elf = executable(
|
|
'kernel.elf',
|
|
arch_sources,
|
|
include_directories: includes,
|
|
link_args: [
|
|
'-Wl,-T,' + meson.current_source_dir() + '/platform.ld',
|
|
'-static'
|
|
],
|
|
link_depends: files('platform.ld'),
|
|
install: true,
|
|
install_dir: meson.build_root()
|
|
)
|
|
|
|
bin = custom_target(
|
|
'kernel.bin',
|
|
command: [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
input: elf,
|
|
output: 'kernel.bin'
|
|
)
|
|
|
|
uboot_img = custom_target(
|
|
'kernel.uboot',
|
|
command: [
|
|
mkimage,
|
|
'-d', '@INPUT@',
|
|
'-A', 'riscv',
|
|
'-O', 'u-boot',
|
|
'-a', '0x45000000',
|
|
'-e', '0x45000000',
|
|
'-C', 'none',
|
|
'@OUTPUT@'
|
|
],
|
|
input: bin,
|
|
output: 'kernel.uboot',
|
|
install: true,
|
|
install_dir: meson.build_root()
|
|
)
|
|
|
|
run_target('uart',
|
|
command: [
|
|
find_program(meson.source_root() + '/tools/uboot_upload'),
|
|
elf
|
|
]
|
|
)
|
|
|