summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c6cb39e..f942513 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,15 +6,22 @@ use core::panic::PanicInfo;
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
// 'k'
- loop{unsafe {core::arch::asm!(
- "out dx, al", in("al") 0x6Bu8
- )}}
+ print("kernel\n");
+ loop {}
+}
+
+fn print(s: &str) {
+ let mut bytes = s.bytes();
+ while let Some(b) = bytes.next() {
+ unsafe {core::arch::asm!(
+ "out dx, al"
+ , in("al") b
+ )};
+ };
}
#[panic_handler]
fn panic(_: &PanicInfo) -> ! {
- // 'p'
- loop{unsafe {core::arch::asm!(
- "out dx, al", in("al") 0x70u8
- )}}
+ print("panicked");
+ loop {}
}