summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-06-06 15:58:58 +0200
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-06-06 15:58:58 +0200
commit21fbb5720e4be2887b2faab5728e69c92fbb1a5b (patch)
tree80a24f9be6cbab17385a655051cd0d311a1777a5 /meson.build
parentddb15c409290ac5473ee36d5dc621a92f161cdfb (diff)
ustar disk
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build20
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'])