Neptune kernel
Find a file
2025-06-26 10:07:31 +02:00
lib Formatting: string.c 2025-06-26 10:07:31 +02:00
.clang-format Clang format alignment 2025-06-26 05:55:59 +02:00
.clangd clangd: .clangd file that seems to make clangd behave 2025-06-26 04:04:34 +02:00
.gitignore Minimal viable kernel 2025-06-26 02:43:43 +02:00
config.h Move some config options from start into config.h 2025-06-26 05:56:41 +02:00
entry.S Removing debug prints from entry routine. After stacks are set up correctly, this is better handled in C. 2025-06-26 04:25:37 +02:00
kernel.ld Moved: link.ld -> kernel.ld 2025-06-26 05:24:09 +02:00
Makefile Add uart and panic to kernel dependency list 2025-06-26 06:22:59 +02:00
README.md Some vocabulary in readme 2025-06-26 06:26:25 +02:00
riscv.h Fix nasty bug related to spinlock panic when lock is already held, because the tread pointer was never set on a per-hart basis. 2025-06-26 06:24:01 +02:00
start.c Fix nasty bug related to spinlock panic when lock is already held, because the tread pointer was never set on a per-hart basis. 2025-06-26 06:24:01 +02:00
types.h Some shorthand typedef used around the kernel 2025-06-26 04:19:49 +02:00

Neptune Kernel

For a quick reference on RISC-V assembly:

Toolchains:


Register Name Privilege Level Description
mstatus Machine Status Register Machine Holds global interrupt enable, previous privilege mode, etc.
mtvec Machine Trap-Vector Base Machine Holds the base address of the trap handler (exception/interrupt entry).
mepc Machine Exception PC Machine Stores the program counter at the time of the last trap.
mcause Machine Cause Register Machine Indicates the cause of the last trap (interrupt or exception).
satp Supervisor Address Translation and Protection Supervisor Controls page table base address and mode (e.g., Sv39, Sv48).
sstatus Supervisor Status Register Supervisor Like mstatus, but accessible from supervisor mode.
stvec Supervisor Trap-Vector Base Supervisor Like mtvec, but for supervisor mode traps.
sepc Supervisor Exception PC Supervisor Like mepc, but for supervisor mode.
scause Supervisor Cause Register Supervisor Like mcause, but for supervisor mode traps.
sscratch Supervisor Scratch Supervisor Can be used to store temporary state across traps in supervisor mode.
mscratch Machine Scratch Machine Like sscratch, but in machine mode.
mcycle Machine Cycle Counter Machine Counts the number of cycles executed.
mtime Machine Timer Register Machine (via memory-mapped) Used for timing and scheduling (not a CSR, but a memory-mapped register).
mip Machine Interrupt Pending Machine Indicates pending interrupts.
mie Machine Interrupt Enable Machine Controls which interrupts are enabled.