Add BIOS/UEFI flag to stivale spec

This commit is contained in:
mintsuki 2020-05-15 05:47:38 +02:00
parent ed8e7b962b
commit ef122f652d
3 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,9 @@ struct stivale_struct {
uint64_t module_count; // Count of modules that stivale loaded according to config
uint64_t modules; // Pointer to the first entry in the linked list of modules (described below)
uint64_t epoch; // UNIX epoch at boot, read from system RTC
uint64_t flags; // Flags
// bit 0: 1 if booted with BIOS, 0 if booted with UEFI
// All other bits undefined.
} __attribute__((packed));
```

Binary file not shown.

View File

@ -43,11 +43,14 @@ struct stivale_struct {
uint64_t module_count;
uint64_t modules;
uint64_t epoch;
uint64_t flags; // bit 0: 1 if booted with BIOS, 0 if booted with UEFI
} __attribute__((packed));
struct stivale_struct stivale_struct = {0};
void stivale_load(char *cmdline, int boot_drive) {
stivale_struct.flags &= (1 << 0); // set bit 0 since we are BIOS and not UEFI
int kernel_drive; {
char buf[32];
if (!config_get_value(buf, 0, 32, "KERNEL_DRIVE")) {