Compare commits

...

3 Commits

Author SHA1 Message Date
Greg Shuflin
e8c4847b12 Initial code 2025-01-10 11:53:02 -08:00
Greg Shuflin
7e4cedcdc0 kernel.ld 2025-01-10 03:52:42 -08:00
Greg Shuflin
80a5815731 Thousand line OS initial commit 2025-01-10 03:47:52 -08:00
6 changed files with 69 additions and 0 deletions

7
thousand-line-os/Cargo.lock generated Normal file
View 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"

View File

@@ -0,0 +1,6 @@
[package]
name = "thousand-line-os"
version = "0.1.0"
edition = "2021"
[dependencies]

View 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
View 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

View 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 = .;
}

View File

@@ -0,0 +1,14 @@
#![no_std]
#![no_main]
#[no_mangle]
pub extern "C" fn _start() -> ! {
init()
}
fn init() -> ! {
loop {
}
}