add rust kernel stub
This commit is contained in:
20
src/lib.rs
Normal file
20
src/lib.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
// 'k'
|
||||
loop{unsafe {core::arch::asm!(
|
||||
"out dx, al", in("al") 0x6Bu8
|
||||
)}}
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_: &PanicInfo) -> ! {
|
||||
// 'p'
|
||||
loop{unsafe {core::arch::asm!(
|
||||
"out dx, al", in("al") 0x70u8
|
||||
)}}
|
||||
}
|
||||
8
src/linker.ld
Normal file
8
src/linker.ld
Normal file
@@ -0,0 +1,8 @@
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00010000;
|
||||
.text : {
|
||||
*(.text._start)
|
||||
*(.text*)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user