5 ms·
Emulating Linux MIPS in Perl – Part 1: ELF loader
- TickleSteve 11y agoAm I reading this correctly?? Emulating a whole processor to run a shell script on Windows.... Seriously?? Strikes me that someone didn't research the options correctly or just wants an excuse to play...
- joosters 11y agoWhat's wrong with writing an emulator just for the fun of it?
- Ultimatt 11y agoPlaying aka learning in this profession. Some still care to work towards being able to contribute to the "options" that are in play. This is how those developers and new options are born.
- seba_dos1 11y agoAm I reading this correctly?? Complaining about hackers being hackers on a site called Hacker News... Seriously??
- _ak 11y agohttp://www.catb.org/jargon/html/H/hack-value.html http://www.catb.org/jargon/html/H/hack-value.html
- andrewchambers 11y agoA tiny mips emulator I wrote which can boot a linux kernel: https://github.com/andrewchambers/cmips https://github.com/andrewchambers/cmips
- joosters 11y agoThis series of posts is amazingly well-written, it explains the steps involved really well IMO, thoughtfully ordering the code snippets to make understanding each step simple. As a perl user, I'm also highly biased as it's nice to see a perl article on HN once in a while :)
- userbinator 11y agoThe next step along this path would be to run Perl inside this VM, and then run the emulator in it... MIPS is certainly one of the simplest instruction sets. A while ago I decided to write one too, for fun, after having done ones for a few other CPUs (Z80, 6502, 8086), and MIPS was by far the simplest, almost to the point of being boring. Getting the branch delay slots right (see http://www.pagetable.com/?p=313 http://www.pagetable.com/?p=313 for some details) was the hardest part.
- sklogic 11y agoIf you like challenge, MIPS can be exceptionally hard and complicated if you want to implement an OoO superscalar core.
- TheLoneWolfling 11y agoW.r.t. branch delay slots. An interesting idea: instead of fixing a number of branch delay slots (or none), what about splitting branches? That is - you have a branch_commit instruction, and anything between the branch and the branch_commit is treated as (a) branch delay slot(s), with the processor either filling in pipeline bubbles or stalling the branch as necessary. If you want to get fancy about it you can start doing matched branch / commit pairs (like nesting brackets), or potentially even start dealing with general matching. Although the decreased instruction density may kill the benefits.
- chriswarbo 11y agoI came across the phrase "XY problem" the other day http://www.perlmonks.org/?node=XY+Problem http://www.perlmonks.org/?node=XY+Problem > You want to do X, and you think Y is the best way of doing so. Instead of asking about X, you ask about Y. If we allow "ask" to include asking oneself, then this seems like a great example :)
- kazinator 11y agoIronic; I put together a MIPS based Linux distro about eight years ago, and Perl was one of the items that wouldn't cross-compile to it. How you get Perl on MIPS is by compiling on a MIPS machine, or in an emulated chroot environment (QEMU on x86, say). Now Perl can maybe supply that environment.
- l1n 11y agoSpeaking of MIPS, has anyone had success emulating IRIX?