Page 2 of 2

Re: any BIOS standard(s) for calling to SMM ?

Posted: Sat Oct 18, 2014 4:23 am
by Octocontrabass
Czernobyl wrote:Using privilege levels or HW task switching would be similar, only much worse :=)
Spilling variables adds Θ(n) overhead. Using a ring 0 supervisor that can only be triggered by your "interrupt the calculation" button adds Θ(1) overhead.

I feel like you might have misunderstood something. :|

Re: any BIOS standard(s) for calling to SMM ?

Posted: Sat Oct 18, 2014 5:29 am
by Czernobyl
Combuster wrote: Do you also have an experiment showing that empty SMI interrupt handlers are faster than than protected mode interrupts?
- Of course not (it's the contrary). Also totally immaterial to both examples I've presented.

The maths program runs for days with interrupts disabled, but for an SMI at the explicit press of a button (or hot key) if and when we want to examine the size of intermediary results (the nature of the iterative process is such that it is impredictable how long it will run, or even if it will ever stop!). The time the SMI and RSM take together, compared to protected mode interrupt and return (with privilege level switch), is inconsequential here. OF course in this example the SMI handler is not a mere RSM, or else it would be useless. Instead it starts a small interactive display of the values we want to monitor, and allows us to RSM or stop the calulation altogether cleanly.

The other example, a helper for a ROM flashing program, is where I mentioned substituting a dummy RSM for a SMI handler - as a "quick and dirty" trick which /will/ work on many desktop mobos (although it does not /have/ to be as simple as that; the proper way is for the substitute handler to check for the cause of the SMI and chain to the BIOS if it is not caused by Flashrom trying to access the flash hardware). Anyway... in this example, the (ab)use of SMM is fundamental and unavoidable : SMI is triggered by the chipset !
On another note, it's also rather amusing that you're trying to do very lengthy calculations, on old x86 machines, and then hack those machines for speed boosts...
All in all, it sounds like this whole SMM thing is a challenge to yourself, and you're after said challenge rather than the goal of the actual computation.
Anything wrong ? I have had many interests in life, not limited to math or programming. Now I'm retired, and cheap too, enjoying the luxury of free time and taking very diverse challenges. Just /not/ trying to write an OS at the moment, sorry ! I /did/ write way-way-back what we did not call (and was not) an OS, but a protected mode monitor or supervisor for (then cutting edge) i80286...