:: commit 573b3308e103c56ed0ff53b7218d9604f277fefa

mintsuki <mintsuki@protonmail.com> — 2020-03-27 02:45

parents: 1cbd6fb2e9

Add KERNEL_DRIVE default value

diff --git a/src/main.c b/src/main.c
index de75c338..90557776 100644
--- a/src/main.c
+++ b/src/main.c
@@ -62,8 +62,12 @@ void main(int boot_drive) {
 
     if (config_loaded) {
         char buf[32];
-        config_get_value(buf, 32, (void*)0x100000, "KERNEL_DRIVE");
-        drive = (int)strtoui(buf);
+        if (!config_get_value(buf, 32, (void*)0x100000, "KERNEL_DRIVE")) {
+            print("KERNEL_DRIVE not specified, using boot drive (%x)", boot_drive);
+            drive = boot_drive;
+        } else {
+            drive = (int)strtoui(buf);
+        }
         config_get_value(buf, 32, (void*)0x100000, "KERNEL_PARTITION");
         part = (int)strtoui(buf);
         config_get_value(path, 128, (void*)0x100000, "KERNEL_PATH");
diff --git a/test/qloader2.cfg b/test/qloader2.cfg
index 2544fc20..8becf100 100644
--- a/test/qloader2.cfg
+++ b/test/qloader2.cfg
@@ -1,4 +1,3 @@
-KERNEL_DRIVE=128
 KERNEL_PARTITION=0
 KERNEL_PATH=test.elf
 KERNEL_PROTO=stivale
tab: 248 wrap: offon