Compare commits
2 commits
6a6068c8b6
...
f654aeb038
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f654aeb038 | ||
|
|
73795f8944 |
2 changed files with 32 additions and 6 deletions
3
Makefile
3
Makefile
|
|
@ -78,8 +78,7 @@ qemu: kern/kernel.elf
|
|||
@$(QEMU) -machine virt -bios none -nographic -m 128M -smp 4 -kernel $<
|
||||
|
||||
clean:
|
||||
rm -f *.o *.elf *.d lib/*.o lib/*.d
|
||||
find . -type f -name '*.[od]' -exec rm -f {} +
|
||||
find . -type f -name '*.[od(elf)]' -exec rm -f {} +
|
||||
|
||||
format:
|
||||
find . -type f -name '*.[ch]' -exec clang-format -i {} +
|
||||
|
|
|
|||
35
README.md
35
README.md
|
|
@ -7,7 +7,34 @@ For a quick reference on RISC-V assembly:
|
|||
|
||||
Some low-level string format routines borrowed from [mini-printf](https://github.com/mludvig/mini-printf)
|
||||
|
||||
Toolchains:
|
||||
### Directory outline
|
||||
|
||||
The planned directory outline is as follows:
|
||||
```
|
||||
root
|
||||
├── kern # General kernel sources
|
||||
│ ├── libkern # Kernel specific library routines
|
||||
│ ├── memory # Memory related code (kalloc, buddy and friends)
|
||||
│ └── arch # Architecture specific functionality
|
||||
├── libc # Userspace C library
|
||||
└── user # Userspace programs
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
||||
```sh
|
||||
make get_toolchain # Dont worry, is will land locally inside project directory
|
||||
make -j$(nproc)
|
||||
make qemu
|
||||
```
|
||||
|
||||
The project can be cleaned with:
|
||||
```sh
|
||||
make clean # Wipes .o, .d, .elf
|
||||
make distclean # Wipes the above, but also removes toolchain
|
||||
```
|
||||
|
||||
### Toolchains:
|
||||
- https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack
|
||||
- https://github.com/xpack-dev-tools/qemu-riscv-xpack/
|
||||
|
||||
|
|
@ -17,6 +44,8 @@ Toolchains:
|
|||
> term trap, largely because it was the term used by the PDP11/40 and therefore is the
|
||||
> conventional Unix term.
|
||||
|
||||
### Notes/Misc
|
||||
|
||||
| Register | Name | Privilege Level | Description |
|
||||
|-------------|----------------------------|------------------|-----------------------------------------------------------------------------|
|
||||
| `mstatus` | Machine Status Register | Machine | Holds global interrupt enable, previous privilege mode, etc. |
|
||||
|
|
@ -35,9 +64,7 @@ Toolchains:
|
|||
| `mip` | Machine Interrupt Pending | Machine | Indicates pending interrupts. |
|
||||
| `mie` | Machine Interrupt Enable | Machine | Controls which interrupts are enabled. |
|
||||
|
||||
# Notes
|
||||
|
||||
## Libc Implementations
|
||||
### Libc Implementations
|
||||
|
||||
[uClibc](https://uclibc.org/)
|
||||
[musl libc](https://musl.libc.org/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue