Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt work #2

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
675abfe
uart, rename
BuJo Dec 10, 2023
b7d454e
uart, only flush stdout on special characters
BuJo Dec 10, 2023
dd72c75
Add virtio block device
BuJo Dec 20, 2023
ee70a96
Implement clint/plic to not hinder progress
BuJo Dec 21, 2023
dbc8495
virtio, implement more features for setting up probing
BuJo Dec 21, 2023
240d797
virtio, linux needs multiple queues
BuJo Dec 21, 2023
4987f34
virtio, use bus to read descriptor table
BuJo Dec 21, 2023
55f69ff
virtio, refactor block device into own module
BuJo Dec 21, 2023
b9e028f
dts, make linux device tree simpler
BuJo Jan 3, 2024
b52d434
clint, implement clock source
BuJo Jan 3, 2024
9b55f56
plic, implement basic interrupt bit handling
BuJo Jan 3, 2024
a55d36e
rtc, fixup adress base
BuJo Jan 3, 2024
5053591
virtio, fixup logging
BuJo Jan 3, 2024
84a71d8
Reformat
BuJo Jan 3, 2024
954eb66
virtio, better logging for available descriptors
BuJo Jan 3, 2024
46052f3
clint, make it possible to get clint msip as well as mip for interrupts
BuJo Jan 3, 2024
6c4a4fd
virtio, more logging for queue notification
BuJo Jan 3, 2024
d5016ca
virtio, detect where to read from
BuJo Jan 3, 2024
09a99e7
virtio, add documentation
BuJo Jan 4, 2024
aa10ccb
virtio, handle different descriptor types
BuJo Jan 4, 2024
c4f1ebb
interrupts, refactor into own file
BuJo Jan 4, 2024
74365d9
Merge branch 'virtio'
BuJo Jan 4, 2024
3db1b96
Add crossbeam in preparation of interrupts
BuJo Jan 4, 2024
46eeec2
Remove non-dynamic bus for simplicity
BuJo Jan 4, 2024
30b40cb
Appease clippy
BuJo Jan 4, 2024
6e1f40d
uart, add logging for control register writes
BuJo Jan 5, 2024
c4e1f67
plic, dynamically allocate contexts/sources
BuJo Jan 5, 2024
de80790
Allow wider lines
BuJo Jan 5, 2024
6f13b01
ram, make size configurable
BuJo Jan 8, 2024
0e32ede
linux, use ram for zero-page
BuJo Jan 8, 2024
c528e7a
linux, re-add earlycon to see messages earlier
BuJo Jan 8, 2024
28bd771
virtio, actually use interrupt to notify completion
BuJo Jan 8, 2024
b697820
hart, implement stubs for floating-point loads/stores
BuJo Jan 8, 2024
60fdecd
emu, drop to debugger on specific errors
BuJo Jan 8, 2024
57ac592
WIP: Interrupt work for haiku
BuJo Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_width = 119
attr_fn_like_width = 110
140 changes: 140 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cargo-features = ["profile-rustflags"]

[package]
name = "rriscv"
version = "0.1.0"
Expand All @@ -15,8 +13,9 @@ env_logger = "0.10.1"
log = "0.4.20"
signal-hook = "0.3.17"
term = "0.7.0"
log4rs = { version = "1.2.0", default-features = false, features = ["console_appender", "file_appender", "pattern_encoder"] }
log4rs = { version = "1.2.0" }
config = "0.13.4"
crossbeam = { version = "0.8.3", features = ["crossbeam-channel"] }

[profile.dev]
opt-level = 0
Expand All @@ -30,5 +29,5 @@ opt-level = 3
lto = "fat"
opt-level = "z"
codegen-units = 1
rustflags = ["-C", "target-cpu=native"]
#rustflags = ["-C", "target-cpu=native"]
#panic = "abort"
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ flowchart LR
| DTB | Device Tree Blob |
| HTIF | Deprecated Host Device |
| FESVR | RISC-V Frontend Server |
| CLINT | Core Local Interruptor |
| PLIC | Platform-Level Interrupt Controller |
| AMO | Atomic Memory Operation |

Expand Down Expand Up @@ -121,6 +122,7 @@ limitations under the License.
* [Demystifying the RISC-V Linux software stack](https://www.european-processor-initiative.eu/wp-content/uploads/2022/06/[email protected])
* [6.S081: Interrupts](https://pdos.csail.mit.edu/6.828/2021/slides/6s081-lec-interrupts.pdf)
* [RISC-V Bytes: Introduction to Instruction Formats](https://danielmangum.com/posts/risc-v-bytes-intro-instruction-formats/)
* [RISC-V System, Booting, And Interrupts](https://marz.utk.edu/my-courses/cosc562/riscv/)

### Device Trees

Expand All @@ -134,3 +136,10 @@ limitations under the License.
* [RISCOF](https://riscof.readthedocs.io/en/latest/installation.html)
* [HTIF](https://github.com/riscv-software-src/riscv-isa-sim/issues/364)
* [Spike](https://chipyard.readthedocs.io/en/latest/Software/Spike.html)

### virtio

* [virtio 1.3](https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html)
* [virtio ring - how data travels](https://www.redhat.com/en/blog/virtqueues-and-virtio-ring-how-data-travels)
* [riscv-emu](https://github.com/sysprog21/riscv-emu/blob/master/virtio.c)
* [Implementing a virtio-blk driver in my own operating system](https://brennan.io/2020/03/22/sos-block-device/)
Binary file modified data/linux.dtb
Binary file not shown.
Loading
Loading