4 #![warn(clippy::arithmetic)]
7 use core::ops::{Add, Mul};
8 use core::panic::PanicInfo;
10 static HELLO: &[u8] = b"Hello Stage2!";
13 fn panic(_info: &PanicInfo) -> ! {
18 pub extern "C" fn _start() -> ! {
19 let vga_buffer = 0xb8000 as *mut u8;
25 *vga_buffer.offset((i as isize).mul(2)) = 0x00;
26 *vga_buffer.offset((i as isize).mul(2).add(1)) = 0x07;
30 // Print welcome message
31 for (i, &byte) in HELLO.iter().enumerate() {
33 *vga_buffer.offset((i as isize).mul(2)) = byte;
34 *vga_buffer.offset((i as isize).mul(2).add(1)) = 0x07;