News for hackers. Stuff that matters.
Re:Show HN: My x86 emulator written in JavaScript by JoshTriplett on Thursday October 17, 2013 @06:31PM (#6568608)
There are two sensible approaches: interpretation or dynamic translation.

If you want to write one as a learning experience for how the platform you're emulating works and how an emulator could work in principle, you probably want to write an interpreter: find out how the platform boots, build something to start reading and interpreting instructions, start adding emulated hardware devices, and you'll get an increasingly functional interpreter.

For a start, you could ignore emulation of devices, and just write a CPU core that interprets instructions.

If you want to learn how modern (but still non-hardware-assisted) emulation works, read about how qemu's dynamic code translator and other JIT compilers work, and build a CPU emulator based on that.

There are no comments on this comment yet.