Bug 152232

Summary: [syscons] [patch] syscons VGA screensavers don't work on some computers
Product: Base System Reporter: crocket <crockabiscuit>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: 8.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description crocket 2010-11-14 11:50:08 UTC
All VGA screensaver except logo_saver.ko couldn't be executed on my desktop due to 
module_register_init: MOD_LOAD (XXXX_saver, 0xXXXXXXXX, 0) error 19.

After inspection, I found out that each VGA screensaver probed its own predefined set of video modes only and if the probe failed, they would generate that error.

A quick solution to this problem is to generate a header file that manages the video mode of all VGA screensavers.
If I managed the video mode in one place, it would be easier to change the video mode and build screensaver modules at once.
So I made a patch.
The patch is attached to this problem report.
You should apply the patch in /usr/src/sys.
For example, Execute "diff -p1 < xxx.diff" on /usr/src/sys.

This patch can be applied to 8.1-RELEASE safely.

Fix: Currently, screensavers don't detect video modes automatically.
I'd appreciate it if somebody makes a patch that makes screensavers detect video modes automatically using vidcontrol or something else.
It would be nice if we could change the video mode of screensavers with vidcontrol.

To fix this issue, first apply the attached patch in /usr/src/sys.
Change VIDEO_MODE #define macro in /usr/src/sys/dev/syscons/videomode.h to
one of 8bit video modes shown from "vidcontrol -i mode".
Screensavers, for now, assume 8bit video mode.
After changing VIDEO_MODE to any 8bit video mode, execute "make; make install clean" in /usr/src/sys/modules/syscons.
All syscons screensavers will be installed into /boot/kernel.
You don't have to worry about the currently loaded screensaver since loaded screensaver modules are already in RAM.
Overwriting those screensavers on disk would not affect screensavers loaded onto RAM.
Execute "kldunload (loaded screensaver module); kldload XXX_saver(XXX is the name of a screensaver)" as root.
To test the screensaver, press Shift + PauseBreak. You'll see the new screensaver working.

Patch attached with submission follows:
How-To-Repeat: Load any of VGA screensavers(rain, fire, dragon, etc...) using kldload.
Execute the screensaver by pressing Shift+PauseBreak.
If it didn't execute, then read /var/log/messages, and you'll see the relevant errors.
Comment 1 crocket 2010-11-14 12:21:39 UTC
Be aware that such ascii screensavers as daemon_saver.ko and snake_saver.ko can't be executed in VGA video modes.
Those ascii screensavers are executable on such video modes as 80x25, 80x30, etc...

Available video modes are displayed by "vidcontrol -i mode"
Comment 2 crocket 2010-11-14 23:31:54 UTC
videomode.h contains some wrong content.
VIDEO_MODE doesn't have to be 8bit VGA mode.
If it was 8 bit video mode, it wouldn't matter if the mode was VGA or not.
8bit video modes can be distinguished by "x8" at the end.
For example, 800x600x8, 320x200x8, etc.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:15 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:35:45 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>