limine: Add cmdline request
diff --git a/common/limine.h b/common/limine.h
index 99b44835..38a53415 100644
--- a/common/limine.h
+++ b/common/limine.h
@@ -26,6 +26,21 @@ struct limine_boot_info_request {
LIMINE_PTR(struct limine_boot_info_response *) response;
};
+// Command line
+
+#define LIMINE_CMDLINE_REQUEST { LIMINE_COMMON_MAGIC, 0x859894000fc0b7d3, 0xaab4ab57e5c3e348 }
+
+struct limine_cmdline_response {
+ uint64_t flags;
+ LIMINE_PTR(char *) cmdline;
+};
+
+struct limine_cmdline_request {
+ uint64_t id[4];
+ uint64_t flags;
+ LIMINE_PTR(struct limine_cmdline_response *) response;
+};
+
// Framebuffer
#define LIMINE_FRAMEBUFFER_REQUEST { LIMINE_COMMON_MAGIC, 0xcbfe81d7dd2d1977, 0x063150319ebc9b71 }
diff --git a/common/protos/limine.c b/common/protos/limine.c
index 020e998f..eadb6fe1 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -214,6 +214,21 @@ FEAT_START
boot_info_request->response = reported_addr(boot_info_response);
FEAT_END
+ // Command line
+FEAT_START
+ struct limine_cmdline_request *cmdline_request = get_request(LIMINE_CMDLINE_REQUEST);
+ if (cmdline_request == NULL) {
+ break; // next feature
+ }
+
+ struct limine_cmdline_response *cmdline_response =
+ ext_mem_alloc(sizeof(struct limine_cmdline_response));
+
+ cmdline_response->cmdline = reported_addr(cmdline);
+
+ cmdline_request->response = reported_addr(cmdline_response);
+FEAT_END
+
// Framebuffer feature
FEAT_START
term_deinit();
diff --git a/test/limine.c b/test/limine.c
index c1377def..78ac704f 100644
--- a/test/limine.c
+++ b/test/limine.c
@@ -19,6 +19,12 @@ static struct limine_entry_point_request entry_point_request = {
.entry = limine_main
};
+__attribute__((used))
+static struct limine_cmdline_request cmdline_request = {
+ .id = LIMINE_CMDLINE_REQUEST,
+ .flags = 0, .response = NULL
+};
+
__attribute__((used))
static struct limine_boot_info_request boot_info_request = {
.id = LIMINE_BOOT_INFO_REQUEST,
@@ -70,6 +76,15 @@ FEAT_START
e9_printf("Bootloader name: %s", boot_info_response->loader);
FEAT_END
+FEAT_START
+ if (cmdline_request.response == NULL) {
+ e9_printf("Command line not passed");
+ break;
+ }
+ struct limine_cmdline_response *cmdline_response = cmdline_request.response;
+ e9_printf("Command line: %s", cmdline_response->cmdline);
+FEAT_END
+
FEAT_START
if (memmap_request.response == NULL) {
e9_printf("Memory map not passed");
