-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emulator/JS communication - stdin, stdout, stderr? #21
Comments
You can send raw scan codes to the keyboard controller using The screen buffer is just an array of characters. The operating system itself manages the cursor position, scrolling, etc. to simulate a terminal, but the (emulated) hardware treats it as a linear array of characters. There's no way to capture writes to VGA RAM, although you could certainly add a hook somewhere in This is an full system emulator -- it emulates the hardware of a standard PC. Unfortunately, it has no concept of stdin, stdout, or stderr because they're abstractions created by the operating system. You're probably looking for application virtualization, which emulates an operating system (letting you take control of these abstractions) instead of hardware. In the long run, it's probably better to invest in one of those (or write your own) than to try to work around these limitations. If you do want to use this emulator, you have a few options, in order of feasibility:
Sorry if this wasn't the answer you were expecting, but hope this helps, regardless. |
Hi @nepx thanks for your reply. As I got into some of the examples after submitting this issue, what you state above makes sense. One of the bottlenecks I'm seeing is the filesystem emulation. If my image includes a static binary, will that generally perform better than something that has to read libraries from the filesystem? |
The emulator has no concept of files -- it's all sectors loaded from a disk. If I had to guess, the extra overhead of loading all those dynamic libraries would slow things down -- but on the other hand, if the operating system has these shared libraries in memory already, it'll just pull that data from the disk cache. Disk reads are by far the slowest part of the whole emulator, since network latency is typically orders of magnitudes slower than anything else in the emulator. When in doubt, profile! You might find that one is decidedly faster than the other, or there's no real difference between the two. |
Hi there,
Awesome project!
Is there a way for JS to interact with the emulator via stdin, stdout, or stderr?
I'd like to write to stdin and read stdout via JS.
Thanks!
Mike
The text was updated successfully, but these errors were encountered: