Skip to main content

Crate proka_bootloader

Crate proka_bootloader 

Source
Expand description

§Proka Bootloader - The bootloader of ProkaOS

Rust Nightly License: GPLv3 GitHub Stars GitHub Issues GitHub Pull Requests Documentation

Copyright (C) 2026 RainSTR Studio. Licensed under GNU GPLv3.


§Introduction

This crate provides the struct, enums about the proka bootloader, including the boot information, memory map, and so on.

§Example

Here’s an example to use this crate:

#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(self::test_runner)]
#![reexport_test_harness_main = "test_main"]
 
use proka_bootloader::BootInfo;
use core::panic::PanicInfo;
 
// Panic handler
#[panic_handler]
pub fn panic(_: &PanicInfo) -> ! {
    loop {}
}
 
#[unsafe(no_mangle)]
#[unsafe(link_section = ".text")]
pub extern "C" fn kernel_main() -> ! {
    let info = proka_bootloader::get_bootinfo();
    let framebuffer = info.framebuffer();

    // Draw a straight line...
    unsafe {
        let ptr = framebuffer.address() as *mut u8;     
        for i in 0..500 {   
            let offset = framebuffer.pitch() * i + i * framebuffer.bpp();
            ptr.add(offset as usize).cast::<u32>().write(0x00FFFFFF);
        }
    }
    loop {}
}
 
// Test runner
#[cfg(test)]
fn test_runner(tests: &[&'static dyn Fn()]) {
    for test in tests {
        test();
    }
}

§LICENSE

This crate is under license GPL-v3, and you must follow its rules.

See LICENSE file for more details.

§MSRV

This crate’s MSRV is 1.85.0 stable.

Modules§

header
The definition of proka-kernel header.
memory
The generic memory module, which provides memory info to kernel, so that kernel can know the memory structure easily.
output
The output module, which provides framebuffer info and its utilities.

Structs§

BootInfo
This struct is the boot information struct, which provides the basic information, memory map, and so on.

Enums§

BootMode
This is the boot mode, only support 2 modes, which are legacy(BIOS) and UEFI.

Functions§

get_bootinfo
Get the bootinfo.