-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlib.rs
65 lines (51 loc) · 1.3 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#![feature(compiler_builtins_lib)]
#![feature(lang_items)]
#![no_std]
extern crate compiler_builtins;
extern crate rlibc;
#[no_mangle]
pub extern fn rust_main() {
// ATTENTION: we have a very small stack and no guard page
let hello = b"Hello World!";
let color_byte = 0x1f; // white foreground, blue background
let mut hello_colored = [color_byte; 24];
for (i, char_byte) in hello.into_iter().enumerate() {
hello_colored[i*2] = *char_byte;
}
// write `Hello World!` to the center of the VGA text buffer
let buffer_ptr = (0xb8000 + 1988) as *mut _;
unsafe { *buffer_ptr = hello_colored };
loop{}
}
#[lang = "eh_personality"] extern fn eh_personality() {}
#[lang = "panic_fmt"] #[no_mangle] pub extern fn panic_fmt() -> ! {loop{}}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn _Unwind_Resume() -> ! {
loop {}
}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn __divsf3() -> ! {
loop {}
}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn __divdf3() -> ! {
loop {}
}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn __mulsf3() -> ! {
loop {}
}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn __muldf3() -> ! {
loop {}
}
#[allow(non_snake_case)]
#[no_mangle]
pub extern "C" fn __floatundisf() -> ! {
loop {}
}