multiboot 0.1.0

Library to access multiboot structures.
docs.rs failed to build multiboot-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: multiboot-0.8.0

Multiboot Build Status Crates.io

This is a multiboot (v1) library written in rust to be used in kernel level code. The code depends only on libcore.

How-to use

/// Translate a physical memory address into a kernel addressable location.
pub fn paddr_to_kernel_vaddr(p: PAddr) -> VAddr {
    (p + KERNEL_BASE) as VAddr
}

/// mboot_ptr is the initial pointer to the multiboot structure
/// provided in %ebx on start-up.
pub fn use_multiboot(mboot_ptr: PAddr) {
    // Create a new instance of the Multiboot struct
    let multiboot = Multiboot::new(mboot_ptr, paddr_to_kernel_vaddr);

    // Find all available memory regions:
    let cb = | base, size, mtype | { 
        println!("Found new memory region: {:x} -- {:x}", base, base+size); 
    };
    multiboot.find_memory(cb);

    // Find all multiboot provided modules:
    let mod_cb = | name, start, end | {
        log!("Found module {}: {:x} - {:x}", name, start, end);
    }
    multiboot.find_modules(mod_cb);
}

Functionality is still not complete and Patches are welcome!

Documentation