kanishk25249-sudo/riscv-from-scratch ? reverse-engineered prompt
Reverse engineered prompt
Build me a RISC V from scratch learning project in Python that shows the whole path from C code all the way to running on a simple machine.
I want a small but real toolchain with a two pass assembler, a RISC V simulator that can run the generated binaries, a bare metal kernel that boots in QEMU, handles UART output, memory management, timer interrupts, and simple preemptive multitasking, plus a tiny C compiler with a handwritten lexer, parser, AST, and code generator for basic features like integers, variables, arithmetic, if else, while loops, and return statements.
Please make the pieces connect cleanly so I can go from C source to assembly to binary to either the simulator or the kernel. Keep everything self contained with no external libraries if possible, and include enough examples or test programs to show that the whole pipeline works end to end. If you need to, look up current RISC V and QEMU details online before filling in any missing pieces.
Are you gonna build this?
make sure you review the code using coderabbit