]> git.lizzy.rs Git - loadnothing.git/blob - stage2/src/main.rs
dcab9938129155ba5003ce45bacafe22bdc504fd
[loadnothing.git] / stage2 / src / main.rs
1 #![no_std]
2 #![no_main]
3
4 use core::panic::PanicInfo;
5
6 static HELLO: &[u8] = b"Hello Stage2!";
7
8 #[panic_handler]
9 fn panic(_info: &PanicInfo) -> ! {
10     loop {}
11 }
12
13 #[no_mangle]
14 pub extern "C" fn _start() -> ! {
15     let vga_buffer = 0xb8000 as *mut u8;
16
17     for (i, &byte) in HELLO.iter().enumerate() {
18         unsafe {
19             *vga_buffer.offset(i as isize * 2) = byte;
20             *vga_buffer.offset(i as isize * 2 + 1) = 0x07;
21         }
22     }
23
24     loop {}
25 }