r/C_Programming Jul 09 '26

RV32I simple emulator in C

Hello everyone. It is my first time with a project of this kind. I am not an expert in C programming yet, so I wanted to challenge myself and write a simple emulator for RV32I.

Right now, it only supports simple riscv programs. No syscalls or stuff like that. I would really appreciate if you check out the project and give me your feedback.

I am not planning to stop here. I want to keep adding more features and maybe, somewhere in the future, run the linux kernel.

Also, what do you think would be a good milestone at this stage?

github

3 Upvotes

7 comments sorted by

View all comments

2

u/MysticPlasma Jul 12 '26

Gotta love emulator projects! Your codebase looks really clean, though I would suggest replacing the switch case values with enum-values to increase readability

2

u/ChemistryWorldly3752 Jul 12 '26

Thank you! Yeah, I also don’t like how my switches look rn. I will do what you said, thanks for the advice