Comments (3)
Yeah... This one is a bummer. Unfortunately, as far as I know (and I might very well be wrong here), the architecture doesn't give me a way to know that the guest is idle. If I were to get serious about this, i.e. build an emulator to run real applications, the 100% CPU issue would of course have to be solved, which means I would probably have to go for Intel or ARM. The reason I did LatticeMico32 was just because I wanted to know if I could and LM32 was the easiest target I could find. Also, I wanted a "dynamic recompilator" instead of just an interpreter.
from jslm32.
According to Wikipedia, the HLT instruction requires ring 0 access.
As I see it, that leaves us with two options:
- Find the place in the Linux kernel where the HLT instruction would be called and make the emulator wait e.g. 10 ms when the instruction pointer reaches that address.
- Modify the instruction set and use the instruction in Linux. The requires patching Linux, so I guess it's a bad idea. Though it's a bit less hackish in some aspects, especially if it could be done in a backward-compatible way.
from jslm32.
Closing this since it is unactionable (we can't know whether the guest is idle).
from jslm32.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jslm32.