Commit graph

11 commits

Author SHA1 Message Date
b08ac4817c
OpenSBI: Added base extension
General notes:

For now im just going to leave all the responses as SbiRet but once I
decide how I want to handle returning errors I would like to return more
useful values.

In the cpp file I define a enum class "ExtensionId" with only one
member. For now the thought is that its descriptive and is consistent
with how the legacy extension is written. I'll also do the same thing
with FunctionId in the legacy extension after this commit for
consistency.
2022-01-23 22:40:21 -05:00
4d85da9674
OpenSBI: Fixed ecall return
Helps to actually return the right values...

Ecall was returning the passed arguments a0 and a1 instead of the actual
return values from the registers(r_a0 and r_a1)

Shit explanation just read the diff, its one line
2022-01-23 22:32:19 -05:00
c24628ab2a
Formatting
It would be nice if I would stay consistent with namespace formatting

Maybe I should use a real linter or something...
2022-01-23 20:27:14 -05:00
464a61102e
OpenSBI memes
Added legacy extension

Fixed typing memes by just define a sbiword_t typedef

Renamed sbiret_t to SbiRet, I think i'll only use _t for typedefs

Added ecall() variant that takes no additional arguments

Moved opensbi includes to includes/opensbi/...

kernel.cpp uses the legacy extensions instead of raw ecalls

All legacy extension calls are marked as deprecated
2022-01-23 20:15:53 -05:00
ea60891ef5
Renamed call -> ecall
Removed old sbi call funcions in kernel.cpp
2022-01-23 15:35:18 -05:00
c4e91606de
Fixed qemu build
Forgot to add the include directories
2022-01-09 17:15:15 -05:00
94fbea02ca
Kernel: tabs -> spaces 2022-01-05 02:50:14 -05:00
d5d92555ae
Drivers: Started OpenSBI driver
Just ecall wrapper for now

TODO: Build system changes are lazy and need to be figured out

TODO: Looks like kernel.cpp was indented with tabs, fix
2022-01-05 02:47:30 -05:00
7336f9e6d6
QEMU: Fix load address
0x81000000 -> 0x80100000
2022-01-04 02:08:31 -05:00
b35d58df1f
Build System: More better
Split code into generic, arch, and platform

Made QEMU its own platform

Added shitty uart upload script for lichee board until I can get fel to
actually upload uboot payloads without hanging

TODO: Move platform selection out of build script

TODO: Move arch specific stuff from kernel to arch

TODO: Common linker script for arch instead of having a copy in each
platform
2022-01-04 01:50:46 -05:00
e50fb2de2c
Initial Commit
Mostly stolen from https://github.com/avdgrinten/riscv-toy-os

Changed load address to 0x45000000 so it would run on real hardware

Played around with GPIO and the watchdog
2022-01-03 19:11:49 -05:00