移除标准库

ch1
zhangxinyu 2 years ago
parent 39850ac250
commit 1cde165bb8

@ -1,5 +1,5 @@
[package] [package]
name = "ch1" name = "os"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

@ -0,0 +1,20 @@
TARGET := riscv64gc-unknown-none-elf
KERNEL_START := 0x80200000
MODE := release
build:
cargo build --$(MODE) --target=$(TARGET)
run:build
qemu-system-riscv64 \
-machine virt \
-nographic \
-bios ../bootloader/rustsbi-qemu.bin \
-device loader,file=target/$(TARGET)/$(MODE)/os.bin,addr=$(KERNEL_START)
clean:
rm -rf ./target

@ -0,0 +1 @@
pub mod panic;

@ -0,0 +1,8 @@
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}

@ -1,3 +1,9 @@
fn main() { #![no_std]
println!("Hello, world!"); #![no_main]
}
mod lang_items;
// fn main() {
//
// // println!("Hello, world!");
// }

Loading…
Cancel
Save