limine: Add support for base protocol revisions
This commit is contained in:
parent
ee9405b04d
commit
01e9ba6755
@ -342,6 +342,25 @@ noreturn void limine_load(char *config, char *cmdline) {
|
||||
|
||||
kaslr = kaslr && is_reloc;
|
||||
|
||||
// Determine base revision
|
||||
LIMINE_BASE_REVISION_1
|
||||
int base_revision = 0;
|
||||
for (size_t i = 0; i < ALIGN_DOWN(image_size_before_bss, 8); i += 8) {
|
||||
void *p = (void *)(uintptr_t)physical_base + i;
|
||||
int new_revision = 0;
|
||||
|
||||
if (memcmp(p, (void *)&limine_base_revision_1, 16) == 0) {
|
||||
new_revision = 1;
|
||||
}
|
||||
|
||||
if (new_revision != 0) {
|
||||
if (base_revision != 0) {
|
||||
panic(true, "limine: Duplicated base revision tag");
|
||||
}
|
||||
base_revision = new_revision;
|
||||
}
|
||||
}
|
||||
|
||||
// Load requests
|
||||
if (elf64_load_section(kernel, &requests, ".limine_reqs", 0, slide)) {
|
||||
for (size_t i = 0; ; i++) {
|
||||
|
3
limine.h
3
limine.h
@ -44,6 +44,9 @@ extern "C" {
|
||||
# define LIMINE_DEPRECATED_IGNORE_END
|
||||
#endif
|
||||
|
||||
#define LIMINE_BASE_REVISION_1 \
|
||||
volatile uint64_t limine_base_revision_1[2] = { 0xf9562b2d5c95a6c8, 0x6a7b384944536bdc };
|
||||
|
||||
#define LIMINE_COMMON_MAGIC 0xc7b1dd30df4c8b88, 0x0a82e883a194f07b
|
||||
|
||||
struct limine_uuid {
|
||||
|
Loading…
Reference in New Issue
Block a user