Re: Hardware state saving & X

Patrick Mochel
2003-10-15T16:32:18Z

> Well, each application should do
>
> * save state
> * reinitialize everything
>
> when it is switched to, and
>
> * shutdown everything
> * restore state
>
> when it is being switched from. That includes random game, and that
> includes X.

Whatever, that's fine.

> > Well, it depends on what X (and in general userspace) needs to know on a
> > power-state transition. Alan, how does/will X behave differently for each
> > power state that we can enter?
>
> Different scripts should run on apm -s (BIOS saves most of hw state)
> and S3 (we have to save most of hw state).

The fact that different behavior exists is completely obvious (refer to
the question and documentation). The question was *how* it was different
from a userpsace perspective. I.e. what exactly is saved, and what isn't.

Under APM, the BIOS handles the state transition, but it does not know
each device initimately, so the OS still has to handle some of the device
state.

Video devices have an int10 call to save/restore state, which is what the
APM BIOS uses. Alan, would it suffice to call that from the kernel, in
either vm86 mode or real mode to handle all the saving/restoring. If we
were able to call that, what more would you have to do?

Pat