diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 94f7334..ebd79a4 100644 --- a/meson.build +++ b/meson.build @@ -13,6 +13,12 @@ endif fs = import('fs') linker_script = fs.copyfile('util/linker.ld') +drive = custom_target(output: 'drive', + command: ['util/build_disk.sh', + meson.current_source_dir() / 'disk', + '@OUTPUT@', + '@PRIVATE_DIR@']) + files = [ 'src/asm/boot.asm', 'src/asm/long.asm', @@ -27,7 +33,8 @@ files = [ 'src/ahci.c', 'src/vga.c', 'src/fs/gpt.c', - linker_script + linker_script, + drive ] ld_args = [ @@ -49,9 +56,14 @@ iso = custom_target('iso', output: 'nrvn.iso', command: ['util/build_iso.sh', '@PRIVATE_DIR@', '@INPUT@', '@OUTPUT@']) +qemu = find_program('qemu') qemu_args = [ - '-cdrom', iso, '-m', get_option('ram'), + '-boot', 'd', + '-cdrom', iso, + '-drive', 'id=disk,format=raw,file=@0@,if=none'.format(drive.full_path()), + '-device', 'ahci,id=ahci', + '-device', 'ide-hd,drive=disk,bus=ahci.0' ] qemu_kvm = [] @@ -59,5 +71,5 @@ if get_option('kvm') qemu_kvm += '-enable-kvm' endif -run_target('run', command: [find_program('qemu'), qemu_args, qemu_kvm]) -run_target('run-gdb', command: [find_program('qemu'), qemu_args, '-s', '-S']) +run_target('run', command: [qemu, qemu_args, qemu_kvm]) +run_target('run-gdb', command: [qemu, qemu_args, '-s', '-S']) |