Skip to contentSkip to conversation

vbetool on pure AMD64 system

DISCUSSION Frank 7 participants 8 messages Nov 9, 2005 – Nov 14, 2005 5 messages not in the archive ACPI

lore
Share & tools
lore

Frank

author
#0 lore raw

Hey guys,

due to your work in new kernels, my AMD64-laptop now resumes after an ACPI S3 suspend (I can type commands and they get executed) :-). Thanks a lot.

But the LCD stays black. So I read about the various options to reinitialize the VGA, which were:
1. kernel boot options: acpi=s3_sleep, acpi=s3_mode, pci=routeirq. I tried each one of them, LCD still stays black.
2. Using the vbetool to save/restore the state of the VGA.

Here is the problem: I didn't find an AMD64 version of vbetool (using Debian testing AMD64), so I forced the i386 package and manually met its 32bit dependencies. It does run, and the "vgastate off" option does disable the LCD. But saving and restoring the state, I get the following error:

# vbetool vbestate save > /tmp/save
Can't get video state buffer size (vm86 failure)
Get video state buffer size failed
Can't save video state (vm86 failure)
Save video state failed

So I guess, there is some reason, that this program does not work on 64bit machines. Is there a workaround or any other idea, how I can get my display back alive?

Thanks,
Frank

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

A message that is not in the archive (sent off-list or not yet received): 200511092342.40477.hugelmopf-S0/[email protected]

#2 lore raw
Quoted 4 lines · Frank

Here is the problem: I didn't find an AMD64 version of vbetool (using Debian testing AMD64), so I forced the i386 package and manually met its 32bit dependencies. It does run, and the "vgastate off" option does disable the LCD. But saving and restoring the state, I get the following error:

If you're running a 64-bit kernel, you can't make vm86 calls. At the moment, vbetool requires that. I'm looking at porting it to use x86emu on non-x86 systems, but haven't been able to get it to work properly yet.

There's a video_post program that should also be mentioned in the docs. It uses x86emu, but I'm not convinced that it's entirely correct. Implementing the same functionality in vbetool shows different interrupts being called in lrmi mode and x86emu mode.

Signature · 8 lines
Matthew Garrett | [email protected]


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
#3 lore raw
In reply to a message not in the archive

Hi!

Quoted 14 lines

due to your work in new kernels, my AMD64-laptop now resumes after an ACPI S3 suspend (I can type commands and they get executed) :-). Thanks a lot.

But the LCD stays black. So I read about the various options to reinitialize the VGA, which were:
1. kernel boot options: acpi=s3_sleep, acpi=s3_mode, pci=routeirq. I tried each one of them, LCD still stays black.
2. Using the vbetool to save/restore the state of the VGA.

Here is the problem: I didn't find an AMD64 version of vbetool (using Debian testing AMD64), so I forced the i386 package and manually met its 32bit dependencies. It does run, and the "vgastate off" option does disable the LCD. But saving and restoring the state, I get the following error:

Quoted 5 lines
# vbetool vbestate save > /tmp/save
Can't get video state buffer size (vm86 failure)
Get video state buffer size failed
Can't save video state (vm86 failure)
Save video state failed

vm86 is unsupported on x86-64. Something like qemu will be required :-(.
Pavel

Signature · 8 lines
Thanks, Sharp!


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

A message that is not in the archive (sent off-list or not yet received): 20051111103315.GB27805-I/[email protected]

#5 lore raw

When you say that vm86 is not supported on x86-64, what do you mean exactly? I'm pretty sure that the hardware supports it, and I don't see how the vesa frame buffer Xorg driver works without it. If the hardware supports v86 mode, why wouldn't the kernel?

For the OP: you might check if your bios has an option to repost the video bios on S3 resume. I turned that on in my bios and that fixed this problem for me. You also might try switching consoles after the resume, for instance, by pressing ctrl-alt-F1, then ctrl-alt-F7 ( or whichever tty the X server is on ) to switch back to X. That sometimes will reset the video state.

Quoted 16 lines · Pavel Machek

Hi!

Quoted 6 lines

due to your work in new kernels, my AMD64-laptop now resumes after an ACPI S3 suspend (I can type commands and they get executed) :-). Thanks a lot.

But the LCD stays black. So I read about the various options to reinitialize the VGA, which were:
1. kernel boot options: acpi=s3_sleep, acpi=s3_mode, pci=routeirq. I tried each one of them, LCD still stays black.
2. Using the vbetool to save/restore the state of the VGA.

Quoted 7 lines

Here is the problem: I didn't find an AMD64 version of vbetool (using Debian testing AMD64), so I forced the i386 package and manually met its 32bit dependencies. It does run, and the "vgastate off" option does disable the LCD. But saving and restoring the state, I get the following error:

# vbetool vbestate save > /tmp/save
Can't get video state buffer size (vm86 failure)
Get video state buffer size failed
Can't save video state (vm86 failure)
Save video state failed
Quoted 3 lines

vm86 is unsupported on x86-64. Something like qemu will be required :-(.
Pavel

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 4 lines · Phillip Susi

When you say that vm86 is not supported on x86-64, what do you mean exactly? I'm pretty sure that the hardware supports it, and I don't see how the vesa frame buffer Xorg driver works without it. If the hardware supports v86 mode, why wouldn't the kernel?

The hardware supports vm86 mode only if the OS is in 32bit mode. Its conceptually possible to support this in a 64bit OS but it would be very very hairy code and very hard to make secure or correct. Feel free to try it.

Xorg has a software x86 emulator that is very basic but sufficient to boot most but not all video bioses on all sorts of systems. It uses that on x86-64.

Alan

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

A message that is not in the archive (sent off-list or not yet received): 1132004907.16148.32.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#9 lore raw
Quoted 3 lines · Alan Cox

Xorg has a software x86 emulator that is very basic but sufficient to boot most but not all video bioses on all sorts of systems. It uses that on x86-64.

This emulator has also been ported to the kernel, but I doubt that patch is ever going to get included.

As an alternative, somebody skilled could implement a two-stage resume code where all devices except graphics card get resumed normally, a usermode helper (standalone x86 emulator) is called to boot the graphics BIOS, after that the graphics card is resumed and resume continues normally to unfreeze all of userspace. Once this infrastructure is in place, it can also be used to boot video BIOSes on non-x86 platforms.

Regards,
Carl-Daniel

Signature · 8 lines
http://www.hailfinger.org/


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php

A message that is not in the archive (sent off-list or not yet received): 1131793377.5267.6.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

author
#12 lore raw

Thanks for your replies. So I was right assuming that vbetool can not be used with a 64 bit kernel. I hope that you succeed porting it, Matthew. I was told that my laptop suspends and wakes fine on x86 (with the most recent Kubuntu). I suppose they are using vbetool to get the VGA back.

10. November 2005 17:07, Matthew Garrett:

| There's a video_post program that should also be mentioned in the docs.
| It uses x86emu, but I'm not convinced that it's entirely correct.
| Implementing the same functionality in vbetool shows different
| interrupts being called in lrmi mode and x86emu mode.

I tried that and it does not get my display back active after Suspend. Furthermore, if I run it on a normally working display (before Suspend) it makes the display go mad (the content scrolls by very rapidly, kind of flickering).

12. November 2005 12:02, Erik Slagter:
| What kind of video adapter does your laptop feature?

It is an SiS M760 chipset including VGA. Do you have any suggestions for that?

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php