use long mode, x86_64-unknown-none works now

This commit is contained in:
andromeda
2026-03-04 22:45:35 +01:00
parent 1b6f76488d
commit 094e8c288a
6 changed files with 211 additions and 133 deletions

View File

@@ -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 {}
}