:: commit 2ecd4a801606c85f8ee23edded0e082226b3886a

mintsuki <mintsuki@protonmail.com> — 2020-03-31 08:48

parents: 6578b55c9f

Make stivale actually pass the command line to the kernel

diff --git a/src/main.c b/src/main.c
index f1f1ef5a..f84a048a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -95,7 +95,7 @@ void main(int boot_drive) {
     echfs_open(&f, drive, part, path);
 
     if (!strcmp(proto, "stivale")) {
-        stivale_load(&f);
+        stivale_load(&f, cmdline);
     } else if (!strcmp(proto, "qword")) {
         echfs_read(&f, (void *)0x100000, 0, f.dir_entry.size);
         // Boot the kernel.
diff --git a/src/protos/stivale.c b/src/protos/stivale.c
index 7cd91c65..ac8768cc 100644
--- a/src/protos/stivale.c
+++ b/src/protos/stivale.c
@@ -40,7 +40,7 @@ struct stivale_struct {
 
 struct stivale_struct stivale_struct = {0};
 
-void stivale_load(struct echfs_file_handle *fd) {
+void stivale_load(struct echfs_file_handle *fd, char *cmdline) {
     uint64_t entry_point;
 
     struct stivale_header stivale_hdr;
@@ -117,6 +117,8 @@ void stivale_load(struct echfs_file_handle *fd) {
     stivale_struct.rsdp = (uint64_t)(size_t)get_rsdp();
     print("stivale: RSDP at %X\n", stivale_struct.rsdp);
 
+    stivale_struct.cmdline = (uint64_t)(size_t)cmdline;
+
     stivale_struct.framebuffer_width  = stivale_hdr.framebuffer_width;
     stivale_struct.framebuffer_height = stivale_hdr.framebuffer_height;
     stivale_struct.framebuffer_bpp    = stivale_hdr.framebuffer_bpp;
diff --git a/src/protos/stivale.h b/src/protos/stivale.h
index 5587a98e..2f471945 100644
--- a/src/protos/stivale.h
+++ b/src/protos/stivale.h
@@ -3,6 +3,6 @@
 
 #include <fs/echfs.h>
 
-void stivale_load(struct echfs_file_handle *fd);
+void stivale_load(struct echfs_file_handle *fd, char *cmdline);
 
 #endif
diff --git a/test/qloader2.cfg b/test/qloader2.cfg
index 5d2854fc..9afddf1b 100644
--- a/test/qloader2.cfg
+++ b/test/qloader2.cfg
@@ -1,4 +1,4 @@
-TIMEOUT=0
+TIMEOUT=3
 
 KERNEL_PARTITION=0
 KERNEL_PATH=test.elf
tab: 248 wrap: offon