This is a multiboot (v1) library written entirely in rust. The code depends only on libcore.
```rust extern crate multiboot;
use multiboot::information::{MemoryManagement, Multiboot, PAddr}; use core::{slice, mem};
struct Mem;
impl MemoryManagement for Mem { unsafe fn paddrtoslice(&self, addr: PAddr, size: usize) -> Option<&'static [u8]> { let ptr = mem::transmute(addr); Some(slice::fromrawparts(ptr, size)) }
// If you only want to read fields, you can simply return `None`.
unsafe fn allocate(&mut self, _length: usize) -> Option<(PAddr, &mut [u8])> {
None
}
unsafe fn deallocate(&mut self, addr: PAddr) {
if addr != 0 {
unimplemented!()
}
}
}
static mut MEM: Mem = Mem;
/// mbootptr is the initial pointer to the multiboot structure
/// provided in %ebx on start-up.
pub fn usemultiboot(mbootptr: PAddr) -> Option
Functionality is still not complete and patches are welcome!