Javascript x86 emulator
Javascript x86 emulator
Last edited by bubach on Thu Jan 08, 2015 3:04 pm, edited 1 time in total.
Re: Javascritp x86 emulator
Edit: I deleted the comment as it was too negative and not helpful in the slightest.
Last edited by bwat on Mon Oct 21, 2013 6:35 am, edited 1 time in total.
Every universe of discourse has its logical structure --- S. K. Langer.
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: Javascritp x86 emulator
Just tested Kolibri OS through my android device.
Thanks for the Link but it's slower maybe cause it's online and programmed
in java script......
Thanks for the Link but it's slower maybe cause it's online and programmed
in java script......
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
(R3X Runtime VM)(CHIP8 Interpreter OS)
- DavidCooper
- Member
- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: Javascritp x86 emulator
Is it supposed to be able to handle 32-bit mode or is it limited to real mode?
Unimplemented: callf
Execution stopped
It puts up that message within a few seconds with MikeOS32 and my own OS.
MikeOS (16-bit version) worked, but even that had errors: I went into the hangman game and it wouldn't display the crucial part where the word is supposed to appear as you guess the right letters - it doesn't even show you how many letters there are in the word, but this normally works fine when run directly or in other emulators.
Some work to do then, but it's a great idea - makes it easy for ordinary people to try out an OS safely without having to download or install an emulator.
Does ayone know who wrote it?
[Edit: I see it's been done before though. http://forum.osdev.org/viewtopic.php?t=23612.]
Unimplemented: callf
Execution stopped
It puts up that message within a few seconds with MikeOS32 and my own OS.
MikeOS (16-bit version) worked, but even that had errors: I went into the hangman game and it wouldn't display the crucial part where the word is supposed to appear as you guess the right letters - it doesn't even show you how many letters there are in the word, but this normally works fine when run directly or in other emulators.
Some work to do then, but it's a great idea - makes it easy for ordinary people to try out an OS safely without having to download or install an emulator.
Does ayone know who wrote it?
[Edit: I see it's been done before though. http://forum.osdev.org/viewtopic.php?t=23612.]
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
Re: Javascritp x86 emulator
Worked fine with the (very) old version of BOS that I had up on my site, and that even does some wierd jumps back and forth from 16-32 bit IIRC. Pretty sweet, even with the obvious limitations.
- LieutenantHacker
- Member
- Posts: 69
- Joined: Sat May 04, 2013 2:24 pm
- Location: Canada
Re: Javascritp x86 emulator
Strange, may be my browser or my false attempt at using it, but it does not work at all for me.
The desire to hack, with the ethics to code.
I'm gonna build an 8-bit computer soon, with this as reference: http://www.instructables.com/id/How-to- ... -Computer/
I'm gonna build an 8-bit computer soon, with this as reference: http://www.instructables.com/id/How-to- ... -Computer/
Re: Javascritp x86 emulator
Did you try the FreeDOS image that is available? For my old BOS version eveything worked as expected, even going back from 32-bit mode to 16-bit, enter mode 0x13 and back into 32 bit. Maybe that's why I think it's sweet, because my old source runned as well as it did.
-
- Posts: 18
- Joined: Thu May 17, 2012 12:43 pm
- Location: in front of a computer
Re: Javascritp x86 emulator
An emulator written in an interpreted language? Not exactly efficient, but interesting nonetheless.
Re: Javascritp x86 emulator
Being more pedantic than usual I would like to point out that all of the symbols we programmers use are interpreted at some level, all languages used are interpreted, all microprocessors interpret their opcodes and in some cases even the operands are interpreted.metallevel wrote:An emulator written in an interpreted language?
Every universe of discourse has its logical structure --- S. K. Langer.
-
- Posts: 2
- Joined: Mon Oct 28, 2013 3:23 am
- Location: USA
- Contact:
Re: Javascritp x86 emulator
Try on my Andriod OS, get some issuse on old version, is it work for java os.
Re: Javascritp x86 emulator
Don't forget about JIT compilation. Btw, AFAIK, in V8 there's no interpeter mode - only compilation (two compilers are included: quick and optimizing).metallevel wrote:An emulator written in an interpreted language? Not exactly efficient, but interesting nonetheless.
-
- Posts: 18
- Joined: Thu May 17, 2012 12:43 pm
- Location: in front of a computer
Re: Javascritp x86 emulator
Yeah, but microprocessors do it in hardware. Some microprocessors are microcoded too, but that is slower than running on tailor made hardware.bwat wrote: Being more pedantic than usual I would like to point out that all of the symbols we programmers use are interpreted at some level, all languages used are interpreted, all microprocessors interpret their opcodes and in some cases even the operands are interpreted.
Is JIT compilation often used with JavaScript? I know Java uses it a lot, but I haven't heard of many cases of it being used with JavaScript.Nable wrote: Don't forget about JIT compilation. Btw, AFAIK, in V8 there's no interpeter mode - only compilation (two compilers are included: quick and optimizing).
EDIT: Looks like JIT and AOT compilation actually have become quite popular for JavaScript recently. But I still wouldn't regard such techniques as 'efficient' (except compared to simple interpretation), since time must still be taken to compile the program on the user's end.
Re: Javascritp x86 emulator
True - though the compilation only has to be done once, and compling C to asmjs (a subset of JavaScript designed to be easy to optimise) can be as little as a factor of 1.5x slower than native. Which, although noticable for an emulator, is not that significant for many tasks.
Re: Javascritp x86 emulator
You are, of course, right to point out the huge difference in instruction latency. The rule of thumb is 1 to 2 orders of magnitude increase in execution latency for a program for each level of interpretation. In the system I'm currently building the source interpreter is roughly 240 times slower than the bytecode interpreter. These days I'm no longer surprised when I find bytecode interpreted code to be good enough. Here's an old paper from a Smalltalk company talking about bytecode interpreters and some of their advantages (like code density - just to widen the scope from the rather narrow latency-is-top-priority viewpoint):metallevel wrote:Yeah, but microprocessors do it in hardware. Some microprocessors are microcoded too, but that is slower than running on tailor made hardware.bwat wrote: Being more pedantic than usual I would like to point out that all of the symbols we programmers use are interpreted at some level, all languages used are interpreted, all microprocessors interpret their opcodes and in some cases even the operands are interpreted.
http://www.object-arts.com/downloads/pa ... IsDead.PDF
Every time a compiled code routine is executed, the cost of compilation per compiled instruction executed is lowered and efficiency is increased. Again, it is a question of what is good enough. I worked on an AOT compiler project that was shut down because the JIT sister project turned out to be good enough even for applications that were deemed to be time critical and therefore in need of AOT compilation.Nable wrote: EDIT: Looks like JIT and AOT compilation actually have become quite popular for JavaScript recently. But I still wouldn't regard such techniques as 'efficient' (except compared to simple interpretation), since time must still be taken to compile the program on the user's end.
Ultimately, you never know until:
a) you get your hands on a specification, and
b) you do some measurements.
Until that time we're just working off technical prejudice and guesswork.
Every universe of discourse has its logical structure --- S. K. Langer.
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Javascritp x86 emulator
JIT compilers can be very efficient depending on what kind of code is being JIT compiled. Basic math operations and loops can often be trivially JIT compiled into machine code that runs at native speed.
Running code that performs bounds checking, dynamically looking up properties, evaluating code dynamically at runtime, etc. obviously is going to run much slower, as any JIT compiler is either going to have to generate a lot of extra code to run this code, or invoke it's own code.
The purpose of asm.js is to have Javascript code that falls into the former category (simple array buffers, loops, and math operations) and removes a lot of dynamic stuff. It intends to be used as the backend of compilers, such as Emscripten (the LLVM to Javascript compiler that enables you to run C++ code in your browser), that can easily be JIT compiled and run at near native speed.
But, why not go crazy?
Running code that performs bounds checking, dynamically looking up properties, evaluating code dynamically at runtime, etc. obviously is going to run much slower, as any JIT compiler is either going to have to generate a lot of extra code to run this code, or invoke it's own code.
The purpose of asm.js is to have Javascript code that falls into the former category (simple array buffers, loops, and math operations) and removes a lot of dynamic stuff. It intends to be used as the backend of compilers, such as Emscripten (the LLVM to Javascript compiler that enables you to run C++ code in your browser), that can easily be JIT compiled and run at near native speed.
But, why not go crazy?
My OS is Perception.