[Freemint-list] Generic power-off functionality

Jo Even Skarstein joska at online.no
Tue Jan 10 00:39:32 MSK 2017


On ma., 2017-01-09 at 19:40 +0100, Adam Klobukowski wrote:

> Write it as 0x151 Gemdos function handler.

First of all, this means yet another chain in the trap handler. One more
location to jump through, and one more location that can potentially be
messed up and crash the system.

I don't like hooking into the OS traps unless it's actually necessary.
It would have been different if there were a clean and proper way to
expand BIOS/XBIOS/GEMDOS.

Secondly, I'm *not* suggesting a new Shutdown(). Not at all. I'm
suggesting an interface to the small piece of code that does the actual
poweroff. I.e. the code that Shutdown() itself will call at the very
end. Shutdown() is identical across all hardware, it's only this
particular little piece of code that is hardware specific.

> Kernel module is the proper way to do this.

What would be the benefits over the cookie-method? Remember, the code
pointed to by the cookie will only be called once, and only when the
system has already been shut down. It's only purpose is to switch off
power.

The poweroff-routine could also require a magic number parameter, to
avoid accidental power-off if the code somehow was called by accident.

Jo Even




More information about the Freemint-list mailing list