-
Notifications
You must be signed in to change notification settings - Fork 115
Enhance docker image #606
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
Merged
Merged
Enhance docker image #606
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,40 @@ The usage and limitations of Doom and Quake demo are listed in [docs/demo.md](do | |
### Docker image | ||
The image containing all the necessary tools for development and testing can be executed by `docker run -it sysprog21/rv32emu:latest`. It works for both x86-64 and aarch64 (e.g., Apple's M1 chip) machines. | ||
|
||
To keep the Docker image minimal, executables and prebuilt images are not embedded. Follow the steps below to fetch the required artifacts. | ||
|
||
##### User-Mode | ||
Fetch and extract the latest prebuilt user-mode ELF artifacts: | ||
```shell | ||
$ wget $(wget -qO- 'https://api.github.com/repos/sysprog21/rv32emu-prebuilt/releases?per_page=100' \ | ||
| grep browser_download_url | grep ELF | head -n 1 | cut -d '"' -f4) | ||
|
||
$ tar -xzvf rv32emu-prebuilt.tar.gz | ||
``` | ||
To run `rv32emu-user`, consider the following examples: | ||
```shell | ||
# Run a local ELF program | ||
build/rv32emu-user build/hello.elf | ||
|
||
# Run a prebuilt user-mode program (e.g., pi) | ||
build/rv32emu-user rv32emu-prebuilt/riscv32/pi | ||
``` | ||
|
||
##### System-Mode | ||
Fetch and extract the latest prebuilt system-mode Linux image artifacts: | ||
```shell | ||
$ wget $(wget -qO- 'https://api.github.com/repos/sysprog21/rv32emu-prebuilt/releases?per_page=100' \ | ||
| grep browser_download_url | grep Linux-Image | head -n 1 | cut -d '"' -f4) | ||
|
||
$ tar -xzvf rv32emu-linux-image-prebuilt.tar.gz | ||
``` | ||
To run `rv32emu-system`, use the following: | ||
```shell | ||
$ build/rv32emu-system \ | ||
-k rv32emu-linux-image-prebuilt/linux-image/Image \ | ||
-i rv32emu-linux-image-prebuilt/linux-image/rootfs.cpio | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we renamed rv_histogram, could we also update the README's Docker section to document how to run the histogram tool in addition to the user/system mode emulators? |
||
### Customization | ||
`rv32emu` is configurable, and you can override the below variable(s) to fit your expectations: | ||
* `ENABLE_RV32E`: RV32E Base Integer Instruction Set | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which parts of this change rely on Alpine 3.21 and wouldn't work on 3.19?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 37c9838 mentioned that the end of support for Alpine Linux v3.19.x is on 1 Nov 2025, so I upgraded it to 3.21.