-
Notifications
You must be signed in to change notification settings - Fork 6
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
Dummy timer for ELKS #16
Comments
Yes, this will be needed. To be precise, the BIOS console driver, as well as the intended replacement for Advantech, the headless console driver, both setup a scheduler timer that calls a callback function every 8 jiffies. This callback function polls the BIOS and if input is ready, inserts a character into a TTY character queue that also wakes up any waiting processes. I mention this because my thoughts are for the Advantech that it could use a modified headless driver that initializes the hardware serial port (no BIOS), then uses only a real hardware interrupt to process incoming characters, instead of the scheduling callback function. No BIOS polling required, and the system can wait in the HLT instruction. This entire scenario could be emulated with EMU86. Of course, a timer is still required for ELKS, for two reasons: to update jiffies, and for implementing scheduler timer callbacks, of which select() is dependent on for accurate timeouts. Because of this, I recommend the implementation of a timer that attempts to emulate wall time, which would be suspended when active execution is stopped (at the emulator prompt). This would allow select() to function more accurately (until the HLT instruction). This could be implemented in a very basic way by having the timer count down by an amount linear to the number of CPU instructions emulated, say, 4 cycles per byte of code accessed. Is this how you are implementing the Advantech hw timer emulator? |
Hello @mfld-fr, I have not yet updated the EMU86 commit in ELKS tools/Makefile to use the enhancements added several weeks ago, because the out-of-the-box EMU86 won't run ELKS without the INT 8 simulated on HLT. Would you be open to a temporary PR that added INT 8 back in, for the purpose of having an EMU86 commit that would coincide with the ELKS v0.4.0 release? I think it would be nice to have an EMU86 commit that worked with ELKS, if for no other reason a reference point. This could be removed after a real dummy timer is coded. I plan to release ELKS v0.4.0 very soon. Thank you! |
Moved the temporary code to the right place in #24 |
Implementation completed in #24 |
After #14 merge, as the INT8 will no more be called on each HLT instruction, implement a dummy timer to keep the ELKS timeouts working, otherwise it would block in the BIOS console driver.
The text was updated successfully, but these errors were encountered: