Kernel now works on rust

This commit is contained in:
Aaro Koivukangas
2026-03-22 12:50:25 +02:00
parent a6d305a2c0
commit 5eac60973a
3 changed files with 5 additions and 7 deletions
+3
View File
@@ -8,3 +8,6 @@ target = "target.json"
[target.'cfg(target_os = "none")']
runner = "bootimage runner"
[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-nostartfiles"]
+2 -2
View File
@@ -4,7 +4,7 @@
static HELLO: &[u8] = b"Hello World!";
#[unsafe(no_mangle)]
fn _start() -> ! {
pub extern "C" fn _start() -> ! {
let vga_buffer = 0xb8000 as *mut u8;
for (i, &byte) in HELLO.iter().enumerate() {
unsafe {
@@ -12,9 +12,9 @@ fn _start() -> ! {
*vga_buffer.offset(i as isize * 2 + 1) = 0xb;
}
}
loop {}
}
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
-5
View File
@@ -19,10 +19,5 @@
"has-rpath": false,
"no-default-libraries": true,
"position-independent-executables": false,
"pre-link-args": {
"ld.lld": [
"--script=./linker.ld"
]
},
"rustc-abi": "x86-softfloat"
}