Skip to content

Commit

Permalink
limine: Define and implement base revision 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed May 3, 2024
1 parent 51304b3 commit cd9efbf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions common/protos/limine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/limine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cd9efbf

Please sign in to comment.