Code Monkey home page Code Monkey logo

Comments (4)

ghaerr avatar ghaerr commented on August 18, 2024

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?

from emu86.

ghaerr avatar ghaerr commented on August 18, 2024

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!

from emu86.

mfld-fr avatar mfld-fr commented on August 18, 2024

Moved the temporary code to the right place in #24

from emu86.

mfld-fr avatar mfld-fr commented on August 18, 2024

Implementation completed in #24

from emu86.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.