Compare commits
3 Commits
3ef8cbbf8c
...
e8c4847b12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8c4847b12 | ||
|
|
7e4cedcdc0 | ||
|
|
80a5815731 |
7
thousand-line-os/Cargo.lock
generated
Normal file
7
thousand-line-os/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thousand-line-os"
|
||||||
|
version = "0.1.0"
|
||||||
6
thousand-line-os/Cargo.toml
Normal file
6
thousand-line-os/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "thousand-line-os"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
3
thousand-line-os/README.md
Normal file
3
thousand-line-os/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Thousand Line OS
|
||||||
|
|
||||||
|
Aspirational. Following https://operating-system-in-1000-lines.vercel.app/en/
|
||||||
11
thousand-line-os/justfile
Normal file
11
thousand-line-os/justfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
_default:
|
||||||
|
@just --list
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
run:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
QEMU=qemu-system-riscv32
|
||||||
|
# Start QEMU
|
||||||
|
$QEMU -machine virt -bios default -nographic -serial mon:stdio --no-reboot
|
||||||
28
thousand-line-os/kernel.ld
Normal file
28
thousand-line-os/kernel.ld
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
ENTRY(boot)
|
||||||
|
|
||||||
|
SECTIONS {
|
||||||
|
. = 0x80200000;
|
||||||
|
|
||||||
|
.text :{
|
||||||
|
KEEP(*(.text.boot));
|
||||||
|
*(.text .text.*);
|
||||||
|
}
|
||||||
|
|
||||||
|
.rodata : ALIGN(4) {
|
||||||
|
*(.rodata .rodata.*);
|
||||||
|
}
|
||||||
|
|
||||||
|
.data : ALIGN(4) {
|
||||||
|
*(.data .data.*);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bss : ALIGN(4) {
|
||||||
|
__bss = .;
|
||||||
|
*(.bss .bss.* .sbss .sbss.*);
|
||||||
|
__bss_end = .;
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
. += 128 * 1024; /* 128KB */
|
||||||
|
__stack_top = .;
|
||||||
|
}
|
||||||
14
thousand-line-os/src/lib.rs
Normal file
14
thousand-line-os/src/lib.rs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn _start() -> ! {
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn init() -> ! {
|
||||||
|
loop {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user