Lurker News

Comments (190) 70 threads

Earlier comments
api1 reply#
I know this sounds like crazy pants, but I would actually use this in the real world if it were a NodeJS module.

Not for anything compute-intensive or serious, but for creating very secure very isolated VMs to run web apps or other services in an insecure environment. It could also be a great way to take a LAMP stack app and rapidly deploy it in certain cases.
Again not for high performance, but for... I can think of a few things personally and I'm sure others can too.
(Though honestly performance wouldn't be that bad...)
Then add the ability to go back and forth between client and server, and virtual networking, and you might have a commercial "virtual DOS LAN with nodes in a browser as a service" startup. What for? Supporting legacy DOS crap: point of sale systems, etc. "Run your legacy DOS stuff in your browser with persistence in the cloud." You'd be surprised how much legacy DOS crap is out there.

g31 reply#
The project is made with both browser and nodejs support in mind. There are still some issues to resolve, but I will definitely release a node version this year.
dancecodes1 reply#
its HTML5 and SSE?
dancecodes#
Yes its HTML5. Saw header ...
dbancajas7 replies#
I want to write an emulator as a learning experience. Any tips how should I start?
JoshTriplett#
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.

dave84#
I'm not the OP but check out the book: "The Elements of Computing Systems: Building a Modern Computer from First Principles" It's quite comprehensive, not exactly about writing an emulator, but it should give you what you need.
revelation#
You want to write an emulator, but you probably don't want to write one for x86. A nice architecture would be 8 bit AVR microprocessors, for example.
vinhboy1 reply#
I really like your tutorial. I been trying to learn assembly and your tutorial is really helping me put the big picture together. I hope you continue to work on making it better.
awy#
I have a heap on my plate right now but will hope to do part 2 before the end of the year. Glad you enjoyed it.
n1ghtmare_#
I'd like to think of myself as an experienced programmer, but I still loved your tutorial ! Brilliant ! Keep up the good work.
s-macke1 reply#
g3: Probably you have seen my emulator. http://s-macke.github.io/jor1k/ It does more or less the same, but emulates a different CPU.

Your emulator is impressive and especially fast. I think it took a long time for you to optimize it. I tried to start TinyCore, but it stops after decompressing the kernel. So still some work to do ;)

s-macke2 replies#
I saw the source and I have some tips for you: Avoid the UInt32 Arrays and the >>> operator. They could be transformed by the JIT compiler into doubles and slow everything down. This does not happen with the Int32 Arrays and the >> operator. There is a plug-in called JIT-Inspector which give you this information. Unfortunately it does no longer work in Firefox 24. Firefox 22 was the last working version. Additionally worker threads gave me an incredible speed boost in Firefox. The whole GUI stuff is then separated. Especially the costly canvas update.
kevingadd1 reply#
Do you have any documentation to support the stuff about UInt32? The old Firefox JIT had some limitations like this but I'm not aware of anything like that in the current one (which has been shipping for multiple versions). Is it a v8 limitation similar to the 31-bit 'small integer' limitation?
s-macke3 replies#
Indeed at the moment I have nothing to support it. Half a year ago I had dozens of examples. Now it is more or less experience. In v8 I had two weeks ago some strange deoptimizations behavior in my code. It was almost gone after I exchanged two >>> operations. So in my experience it is still better to avoid such cases. No one knows really how the JIT compiler are working. What makes it worse. The behavior is changing every 6 weeks. And don't forget: Out there is more than Firefox and Chrome ;)

Continue this thread — 3 replies

g31 reply#
Hi s-macke. I've read the source code of your emulator before, good job.

I'm aware of the problem with big integers. I'll look into this more closely, thanks for your help.
Regarding workers: I need some restructuring to get this working. I'll also need to figure out the fastest way to exchange the canvas buffer between the worker and the browser.

s-macke#
I did the copying by a for loop copying In32 Arrays which is an acceptable solution. It slows down the worker thread by 1-2% by using 10fps and a screen size of 640x400x32. I think the reason why I didn't used more advanced ArrayBuffer functions to do this was the IE. Probably this has changed. The color transformations and so on can be done in the master GUI-thread.
bcoates1 reply#
Anyone know what format the floppies are expecting? It won't accept a DOS 6.22 install disk from MSDN, maybe it doesn't like DMF?

Also, swapping disks during the install might be an issue, I don't see a button...

g31 reply#
It expects one of the standard formats (720k, 1440k or 2880k). I'll add switching disks some time in the future.
WalterBright#
It rejected my 360Kb images :-(

Load more comments