SVBUG

Silicon Valley BSD Users Group - A forum for BSD and embedded systems

How To Setup a Console for Advanced Options

This talk is to show how to get the console and all the virtual screens (in syscons) into a mode other than the default 80x25, and other fun stuff. From here you'll be able to setup and use the following system Advanced Options:

To do this we must: Other Ways of doing things:

Query the system about what is available

Just below is a script to to query our system about exactly what devices are available. The lines that start with a hash martk (#) are comments, of course.

To do this we use dmesg(1). It is a utility that repeats the boot-time messages telling use what hardware the system found. grep(1) is a text filter. We use it to look for the devices we need.

The first line filters for vga, ega or cga. It will print out only lines that contain those device names. As such, the second line is looking for serial ports (sio)and the third line is looking for PS/2 ports (psm).

The forth non-content line queries the video driver to report what type of video card is working. (We assume one to be working.) The fifth line queries the video driver to report all the video modes it knows about.

Write this information down or redirect it to a file for future reference.

	# here we check for the needed serial ports
	dmegs | grep (vga|ega|cga)
	dmesg | grep sio
	dmesg | grep psm
	# here we check for a video card, we assume you have one
	vidcontrol -i adapter
	# here we check for the modes available
	vidcontrol -i mode

Test the system for available video modes

Now that we know what we have, we need to test the video system as to which video modes to work. Syscons, unfortunately, can only switch into a mode or report an error. The error is rather non-sensical.

In any case, the script below will test all the modes vidcontrol(1) can test for. It will switch into a mode, or report an error. Test with this script vc.sh
You can download the script here.

One special note: you can't run this in an X11 window. xterm uses a virual terminal screen that can be resize on demand. Therefore, it can do all the modes that a text screen can, and it can do more.

Test the system for the mouse

This last test we will run will test to see if the mouse is attached and working.
Test with this script ms.sh
You can download the script here.

Another special note: Like the previous script, you can't do this in an X11 window. X11 has control of the mouse and the will report Device busy

Caveat: Mouse is flakey when used for XWindows. That is, the man page says to use /dev/sysmouse as an application level driver for XWindows. However, using it under XWindows makes the mouse pointer flakey as compared to the regular mouse driver.

If you insist on using 'moused' with X11, then kill 'moused' before you start X11. Then turn it on again after you are finished.

To do that:

	
	# su
	# killall moused
	vidcontrol -m off
	startx
	vidcontrol -n on
	# su
	# restart moused (somehow)

Add to your new kernel (/sys/i386/conf/YOURKERNEL)

Now that we know what is available, we want to add a kernel option so that we might have a splash screen. You'll need to edit your kernel in (/sys/i386/conf/). If you've forgotten how to do that, these instructions will help.

Add these two options so the VESA_800x600 mode will work, if it is available. pseudo-device splash is compiled into the GENERIC (default) kernel, as are the serial and PS/2 ports.

The "VM86" is required. It is not in the GENERIC kernel.

	pseudo-device	splash

	options		"VM86"
	options		VESA

Add to /etc/rc.conf

Alright, this is what we have been waiting for. Add the lines below to the /etc/rc.conf to:

The fonts are required to get any more larger thatn 80x30.

	moused_type="auto"
	moused_enable="YES"
	moused_flags="-3"
	font8x8="cp437-8x8"
	font8x14="cp437-8x14"
	font8x16="cp437-8x16"
	allscreens_flags="80x30"
	saver="rain"
	blanktime="30"

See moused(8) for more mouse options.
See vga(4) for even more options.
Other screen saver (names) available include: apm, blank, daemon, fade, fire, green, logo, rain, snake, star, warp

Add to /boot/loader.conf

To get a splash screen working, add following lines to the file, /boot/loader.conf. Make sure the bitmap file (daemon.bmp) is the /boot directory. You can get the bitmap here

If you don't like that bitmap, you can get more at http://www.baldwin.cx/splash/

	splash_bmp_load="TRUE"
	vesa_load="YES"
	bitmap_load="TRUE"
	bitmap_name="daemon.bmp"

Other Ways of doing things


Screen Saver Loading

To start the screen saver 'rain'. 'su' then,

	kldload -v /modules/rain_saver.ko

Screen Saver Change

To find out what is loaded
	kldstat

To change the screen saver from 'rain' to 'daemon'.
'su' then,

	kldunload -n rain
	kldload -v /modules/daemon_saver.ko

Screen Saver Timeout

To set the timeout to 30 seconds

	vidcontrol -t 30

Screen Saver Immediate On

Turn on the console screen saver by pressing the Shift and Pause.

	<SHIFT><PAUSE>

Screen Mode Quick and Dirty

Quick and Dirty way to setup up your screen mode

From: <sokol>
Date: Tue, 1 May 2001 11:54:11 -0700
Subject: vidcontrol


 I have it working as a one liner, I don't have VESA complied
 in yet

vidcontrol -f 8x8 iso-8x8.fnt 80x50


 This also works for 80x60 but my 6 Inch monitor cut off the 
top and bottom of the screen.

 JLS

Links from the FAQ


About SVBUG     Events     Projects     Links     Past Events

About BSD     History of BSD

For questions or comments, please send mail to: webmaster@svbug.com