[unfinished] Add Multiboot 2 crate and load Multiboot structure

Conflicts:
	Cargo.toml
	src/lib.rs

Conflicts:
	Cargo.toml
This commit is contained in:
Philipp Oppermann
2015-08-17 16:02:06 +02:00
parent 6713e55073
commit 7391a7a9eb
2 changed files with 7 additions and 0 deletions

View File

@@ -8,3 +8,6 @@ crate-type = ["staticlib"]
[dependencies] [dependencies]
rlibc = "*" rlibc = "*"
[dependencies.multiboot2]
path = "../multiboot2"

View File

@@ -17,6 +17,7 @@
#![no_std] #![no_std]
extern crate rlibc; extern crate rlibc;
extern crate multiboot2;
use core::fmt::Write; use core::fmt::Write;
@@ -28,6 +29,9 @@ pub extern fn rust_main(multiboot_address: usize) {
// ATTENTION: we have a very small stack and no guard page // ATTENTION: we have a very small stack and no guard page
use vga_buffer::{Writer, Color}; use vga_buffer::{Writer, Color};
let multiboot = unsafe{multiboot2::load(multiboot_address)};
vga_buffer::clear_screen(); vga_buffer::clear_screen();
let mut writer = Writer::new(Color::Blue, Color::LightGreen); let mut writer = Writer::new(Color::Blue, Color::LightGreen);
writer.write_byte(b'H'); writer.write_byte(b'H');