juls0730

main.rs

Jun 22nd, 2023
1,156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.41 KB | None | 0 0
  1. #![no_std]
  2. #![no_main]
  3.  
  4. mod drivers;
  5. mod libs;
  6.  
  7. use core::panic::PanicInfo;
  8. use drivers::{serial, vga};
  9.  
  10. #[no_mangle]
  11. pub extern "C" fn _start() -> ! {
  12.     serial::init_serial();
  13.  
  14.     let message = b"Hello world\n";
  15.  
  16.     for (_i, &byte) in message.iter().enumerate() {
  17.         serial::write_serial(byte);
  18.     }
  19.  
  20.     vga::init_vga();
  21.  
  22.     loop {}
  23. }
  24.  
  25.  
  26. #[panic_handler]
  27. fn panic (_info: &PanicInfo) -> ! {
  28.     loop {}
  29. }
Advertisement
Add Comment
Please, Sign In to add comment