:: commit cd9efbf8b6dff992cb76ed9279ada6629ae4570e

mintsuki <mintsuki@protonmail.com> — 2024-05-03 17:31

parents: 51304b359d

limine: Define and implement base revision 2

diff --git a/PROTOCOL.md b/PROTOCOL.md
index d3dbfc91..16a7d3b6 100644
--- a/PROTOCOL.md
+++ b/PROTOCOL.md
@@ -22,14 +22,14 @@ The calling convention matches the C ABI for the specific architecture
 
 ## Base protocol revisions
 
-The Limine boot protocol comes in several base revisions; so far only 2
-base revisions are specified: 0 and 1.
+The Limine boot protocol comes in several base revisions; so far, 3
+base revisions are specified: 0, 1, and 2.
 
 Base protocol revisions change certain behaviours of the Limine boot protocol
 outside any specific feature. The specifics are going to be described as
 needed throughout this specification.
 
-Base revision 0 is considered deprecated, and it is the default base revision
+Base revision 0 and 1 are considered deprecated. Base revision 0 is the default base revision
 a kernel is assumed to be requesting and complying to if no base revision tag
 is provided by the kernel, for backwards compatibility.
 
@@ -129,8 +129,12 @@ marker found.
     uint64_t limine_requests_end_marker[2] = { 0xadc0e0531bb10d03, 0x9572709f31764c62 };
 ```
 
-The requests delimiters are *a hint*. The bootloader can still search for
-requests and base revision tags outside the delimited area if it doesn't support the hint.
+For base revisions 0 and 1, the requests delimiters are *hints*. The bootloader can still search for
+requests and base revision tags outside the delimited area if it doesn't support the hints.
+
+Base revision 2's sole difference compared to base revision 1 is that support for
+request delimiters has to be provided and the delimiters must be honoured, if present,
+rather than them just being a hint.
 
 ## Limine Requests Section
 
diff --git a/common/protos/limine.c b/common/protos/limine.c
index b78088c8..1cbdea5e 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -383,12 +383,12 @@ noreturn void limine_load(char *config, char *cmdline) {
                 panic(true, "limine: Duplicated base revision tag");
             }
             base_revision = p[2];
-            // We only support up to revision 1
-            if (p[2] <= 1) {
+            // We only support up to revision 2
+            if (p[2] <= 2) {
                 // Set to 0 to mean "supported"
                 base_rev_p2_ptr = &p[2];
             } else {
-                base_revision = 1;
+                base_revision = 2;
             }
         }
     }
diff --git a/test/limine.c b/test/limine.c
index 9adaebee..187bfa87 100644
--- a/test/limine.c
+++ b/test/limine.c
@@ -7,7 +7,7 @@
 #include <flanterm/backends/fb.h>
 
 __attribute__((section(".limine_requests")))
-static volatile LIMINE_BASE_REVISION(1);
+static volatile LIMINE_BASE_REVISION(2);
 
 static void limine_main(void);
 
tab: 248 wrap: offon