I'm looking for a way to reset the graphics adapter to textmode after it has been set to some sort of graphical mode by the kernel on bootup, and possibly used by an X server.
Is there any code to do this in the Kernel or the X Server?
I figure there must have been such code, because before the introduciton of KMS, the X server used to set the VGA adapter back to text mode when switching to a linux console (e.g. Ctrl+Alt+F1)
I also figure that this is highly adapter-specific. My graphics adapter is controlled by i915.
I've been looking at places in the X source code where I assumed the code would reside, but have been unable to find anything.
So the precise thing I am asking of you would be, in this priority,
- A kernel interface that allows returning to textmode
- An existing utility
- An ugly hack that might involve directly writing to the kernel memory or invoking the VGA bios to do the initialization
- Hints at where (version-wise, repository-wise and sourcefile-wise) in the pre-KMS X or kernel sources I might find such code
I have found a utility called
restoretextmode, but all it did was crash my VGA adapter. It appears to come from ancient times, and not to be designed to handle these kinds of situations at all (but I might be in error).
For those of you who are curious why I require this functionality, it is related to running all kinds of low-level utilities such as
memtest86 or a boot loader directly via
kexec. These utilities require the graphics adapter to be in textmode.