5 ms·
I don't like running TempleOS on hardware or in a full fledged VM(Seems like overkill). I would like to make an alternate virtual machine to run TempleOs progra
by sagebird 7y ago
I don't like running TempleOS on hardware or in a full fledged VM(Seems like overkill). I would like to make an alternate virtual machine to run TempleOs programs on, in Javascript using a Canvas element for UI. I am unsure if there are constructs which TempleOS uses which are unrepresentable in a virtual machine built inside of a javascript virtual machines - like threads, interrupts, etc. I think events could be wired up as interrupts and there is probably a way to simulate threads in a single thread but I have no experience here. If anyone has any insight into what the challenges of such an approach would be, I would love to hear them.
- yjftsjthsd-h 7y agoPhilosophical objection: that is exactly the opposite of what TempleOS is about. Practical objection: By the time you've done that, you'd have written a complete IBM-PC-to-browser compatibility layer. ... This would be super cool if it worked, I'm just sceptical.
- garaetjjte 7y agox86 emulators in browser are available: https://copy.sh/v86/ https://copy.sh/v86/ https://bellard.org/jslinux/ https://bellard.org/jslinux/ These won't run TempleOS though, because it requires x86-64.
- yjftsjthsd-h 7y agoDidn't sound like OP wanted a VM; they wanted a reimplementation or compatibility layer (like wine or wsl).
- danmg 7y agoBochs is not terry approved.
- sagebird 7y agoRe: complete IBM-PC-to-browser- I am not sure about that. I think that the Holy C compiler only emits a small subset of all of the x86/64 Instruction set.
- pingucrimson 7y agoYou could try looking at what Fabrice Bellard (creator of QEMU and FFmpeg, among many other things) did for [JSLinux](https://bellard.org/jslinux/ https://bellard.org/jslinux/). Edit: Although, it's a low-level emulation, not the insanely high-level emulation that you seem to be looking for.
- MayeulC 7y agoThere is no reason why this couldn't be done, AFAIK. You can run QEMU in a web browser [0], although it could be interesting to see a webassembly port. It would be an interesting experience to scroll such an article with live, interactive VMs snapshoted at different stages instead of static images. [0]: https://bellard.org/jslinux/ https://bellard.org/jslinux/
- xena 7y agoI'd love to do that! Let's see what can be done :)
- xena 7y agoYou can't really experience the true TempleOS flavor without the hardware speaker beeping RNG-based hymns.
- majkinetor 7y agoIndeed. That algorithmic music is something else... each time I hear it I don't know what to say and I used to create experimental electronic music all the time...
- xena 7y agoA way to think about it is that music, to Terry, is quite literally the voice of God. Imagine what meaning things like this hymn Risen (the theme song of TempleOS) must have: https://www.youtube.com/watch?v=m3zCwrbOvEU https://www.youtube.com/watch?v=m3zCwrbOvEU
- stevekemp 7y agoIf you'd like to write a PC-emulator in Javascript I can only tell you good-look. It can be done, it has been done for example <https://www.pcjs.org/> https://www.pcjs.org/>, but it will require the kind of low-level PC hardware knowledge which takes a while to come together. Yes you'll need interrupts, but you'll need a hell of a lot more than that! If you're interested in learning about emulation then start with chip-8, or a similar simple system. Once you've done that you'll become much more aware of all the parts you're not aware of. But seriously this is a lot of work, rewarding work, commercially useful work, but a throwaway comment "Lets do this in javascript with <canvas>" is a significantly understated commen suggests to me you don't understand the scope of what you're proposing - not that this should stop you, it would be rewarding. It's just a fine line between pondering "What if ..?" and being insulting to Terry.