You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
968 B

8 years ago
  1. #![feature(asm)]
  2. #![feature(unique)]
  3. #![feature(const_fn)]
  4. #![feature(lang_items)]
  5. #![no_std]
  6. #[macro_use]
  7. extern crate log;
  8. extern crate rlibc;
  9. extern crate spin;
  10. extern crate volatile;
  11. mod arch;
  12. #[macro_use]
  13. mod macros;
  14. mod misc;
  15. mod logger;
  16. use arch::x86_64::device::vga_console;
  17. #[no_mangle]
  18. pub extern fn kernel_main() {
  19. //////////// !!! WARNING !!! ////////////
  20. // THE STACK IS LARGER NOW, BUT //
  21. // WE STILL HAVE NO GUARD PAGE //
  22. /////////////////////////////////////////
  23. vga_console::WRITER.lock().clear_screen();
  24. println!("--- Sparkle v{} booting! ---", ::misc::VERSION);
  25. logger::init().expect("Logger failed to launch!");
  26. loop {}
  27. }
  28. #[lang = "eh_personality"]
  29. #[no_mangle]
  30. pub extern fn eh_personality() {}
  31. #[lang = "panic_fmt"]
  32. #[no_mangle]
  33. pub extern fn panic_fmt() -> ! {loop{}}
  34. #[allow(non_snake_case)]
  35. #[no_mangle]
  36. pub extern "C" fn _Unwind_Resume() -> ! {
  37. // we should hlt here
  38. loop {}
  39. }