Forums » Linux

Quick one for the devs if they have time.

May 20, 2003 asphyxia link
Hey, posted this on StarFreeze's board but im guessing the devs must come across this a lot when debugging code etc. I'll copy + paste the origional message in.

<quote>
X went down... hard.... and now my text console is stuck in some corrupt half textmode half graphicy state that i can't make head nor tail of, let alone get out of. The machine itself is working perfectly, i can still ssh in, i can fire up another X session remotely etc etc but i just cant get my beloved text screen back and im reluctant to reboot because, well, that just aint linux is it!

Anyone have any ideas on doing some sort of console reset?
</quote>

This usually happens when VD dies (which is rare btw) and i get back to x without any kb or mouse control (even rarer), system seems hung and the only way to get some control back is to kill X over ssh which returns me to the console (which works).. just cant see anything =)

I've tried the 'reset' util, starting up and quitting another x session etc etc, cant get anything to return the console to standard 80x25(? think) txt mode.

any ideas would be appreciated, i dont like rebooting at all...

asphy
May 20, 2003 maac_ link
This happens when X dies badly (kill it with ALT-SYSREQ-K and you'll see) and the VGA registers are not restored. The problem is, since VGA's now have many more modes than the old 320x200 et al, they need specific drivers to work in this extended modes (since the new registers follow no standard). X has it's drivers, but console is initialized by BIOS, when X exits the driver restores the register set to return to text mode, but if X dies and the exit procedure can't take place...
I usually reboot to recover from such a crash.
If you don't want to reboot, you could try with SVGALIB.
Also, you could try using the vesafb console, so the kernel will use the VESA BIOS to switch modes.
And the last but not least, you could try to make a program to recover (this little utility http://www.stud.uni-hamburg.de/users/lennart/projects/atitvout/atitvout-0.4.tar.gz makes real mode INT10 calls under linux, so you could use it as a starting point)
Good luck!
May 20, 2003 asphyxia link
yeah, was thinking something like that. Svgalib didn't work unfortunately....

im not a fan of the vesafb console, but it may be an option.

that proggy you chatted about though sounds good. its been a while since i've yanked the int10 chain, i miss low level gfx coding ;-)

asphy
May 20, 2003 asphyxia link
heh, cor its amazing what you remember

mov al, 13h
int 10h;

or perhaps i dont remember that well, its been a long time!
May 20, 2003 maac_ link
It would be better:

xor ax,ax
mov al,03h #80x25 color, 13h is old good 320x200
int 10h

:-)

or using VESA BIOS

mov ax,4f02h
mov bx,03h
int 10h

handy the Ralf Brown's interrupt list :-D
May 21, 2003 asphyxia link
heh yeah, i did a lot of coding in 13h... that was a simple fun gfx mode where everything made sense....

asphy
May 21, 2003 Renegade ++RIP++ link
shivers,

remembers me of Assembler

stops shivering

mov ax,4f02h --> move the value 4f02h into register ax
mov bx,03h --> move the value 03h into the register bx
int 10h

This is right yes ?

but int 10h = interupt on 10h or what does it mean ?

cheers
May 22, 2003 asphyxia link
basically you yank the chain of interrupt handler no 10h which goes and does something specific, in this case something grapics related depending on what you have loaded into the registers.

This of it like a primitive function, you pass the arguments via the registers (mov al, 13h) then call the function (int 10h), and it goes and does something (in this case switch to 320x200x256 vga)

asphy