God, Love, News, Event, Entertainment, Amebo,..... All about Bringing out the best in you...
Show HN: I built a RISC-V emulator that runs DOOM https://ift.tt/m8Z7Ojs
Show HN: I built a RISC-V emulator that runs DOOM Hi HN, I built a RISC-V emulator that implements the RV32IM instruction set and a minimal syscall interface to run DOOM. A few weeks ago, I got my first output with a simple hello world assembly program. Since then I have been working tirelessly to get DOOM to run. I needed to figure out how to run C programs first, and came across newlib, which allows the underlying environment to implement the syscall stubs one by one until the programs run. I have also added ELF loading, but currently only a single `PT_LOAD` segment is supported. To port DOOM, I used doomgeneric, which was quite convenient to get working once the required stubs were in place. DOOM renders to a fixed area in memory (0x705FDD = VRAM_START): 0x7FFFFF +-------------------------------------+
| |
| QUEUE_SIZE (32 bytes) |
| |
0x7FFFDF +-------------------------------------+ <-- QUEUE_START
0x7FFFDE | QUEUE_READ_IDX |
0x7FFFDD | QUEUE_WRITE_IDX |
+-------------------------------------+
| |
| |
| VRAM (1,024,000 bytes) |
| |
| |
0x705FDD +-------------------------------------+ <-- STACK_START
| Stack |
| | |
| v |
| |
| ^ |
| | |
| Program data + Heap |
| |
0x000000 +-------------------------------------+
I made a small linker script so that the entry point of a C program is at _start and virtual address is always 0. That kept the ELF loader code simple. Inputs are written to the queue by rvcore which are then intercepted by DOOM running inside it. Demo link: https://www.youtube.com/watch?v=f5uygzEmdLw https://github.com/lalitshankarch/rvcore May 3, 2026 at 01:57AM
Subscribe to:
Post Comments (Atom)
Show HN: I built my site as a Windows 95 experience (2025) https://ift.tt/FUjN6AW
Show HN: I built my site as a Windows 95 experience (2025) Have fun with the disk defragmenter. https://wes.dev/ May 3, 2026 at 02:30AM
-
submitted by /u/Dull_Tonight [link] [comments] source https://www.reddit.com/r/worldnews/comments/pehy48/housing_secretary_robert_je...
-
Show HN: A Spotify player in the terminal with full feature parity https://ift.tt/oZgrl1Q July 18, 2024 at 02:57AM
-
Show HN: Wallpapper Splitter for Many Desktop I've build an simple tool to split your wallpapers across multiple desktops. Now you can u...
No comments:
Post a Comment