rust-osdev / rust-osdev/bootloader

How to know in which mode the kernel is booted?

Open
#203 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.7k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

As I've seen, the bootloader can boot in legacy BIOS ams UEFI modes. However, there is no way for the kernel to directly know in which mode it has been booted. This can be useful in different parts of the kernel (For example, during the initialisation of 8259 PIC as trying to enable PIC in UEFI mode double faults immediately).

One way I've seen is to iterate over the memory map and check if the regions are of type UnknownBios or UnknownUefi and take decisions. But this isn't an idiomatic way.

The best way would be to pass a flag in BootInfo struct called is_uefi which is true or false based on the mode the kernel is booted.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the BootInfo struct and the bootloader paths that distinguish legacy BIOS from UEFI. Determine how the boot mode could be represented for kernel use, including the 8259 PIC initialization case, and verify that the resulting information is available to the kernel without relying on memory-map types.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.