*BSD News Article 48026


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!swidir.switch.ch!newsfeed.ACO.net!Austria.EU.net!EU.net!howland.reston.ans.net!swrinde!sdd.hp.com!col.hp.com!news.dtc.hp.com!canyon.sr.hp.com!darrylo
From: darrylo@sr.hp.com (Darryl Okahata)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: More virtual terminals
Date: 28 Jul 1995 17:19:16 GMT
Organization: Hewlett-Packard / Center for Primal Scream Therapy
Lines: 168
Message-ID: <3vb66k$6lj@canyon.sr.hp.com>
References: <3vb5oo$idb@ddi2.digital.net>
Reply-To: darrylo@sr.hp.com
NNTP-Posting-Host: mina.sr.hp.com
X-Newsreader: TIN [version 1.2 PL2]

Kevin (klo@digital.net) wrote:

> How do I go about adding more virutal terminals? MAKEDEV doesn't want to 
> make any more, and I can't seem to find it in my kernel config file 
> (maybe I'm blind or something).

     Here's a fragment of some things that I submitted for addition to
the FAQ (ignore the strange question numbering).  Check out the last
question.

[ Hmm.  Looking at these answers, some of them are a bit incomplete.
  Not all possibilities are given. ]

     -- Darryl Okahata
	Internet: darrylo@sr.hp.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.

===============================================================================
5 Miscellaneous Questions
----------------

5.0.1: Hey!  Chmod doesn't change the file permissions of symlinked files!
       What's going on?

You have to use either "-H" or "-L" together with the "-R" option to make
this work.  See the chmod(1) and symlink(7) man pages for more info.

WARNING: the "-R" option does a *RECURSIVE* chmod.  Be careful about
specifying directories or symlinks to directories to chmod.  If you want to
change the permissions of a directory referenced by a symlink, use chmod(1)
without any options and follow the symlink with a trailing slash ("/").  For
example, if "foo" is a symlink to directory "bar", and you want to change
the permissions of "foo" (actually "bar"), you would do something like:

	chmod 555 foo/

With the trailing slash, chmod will follow the symlink, "foo", to change the
permissions of the directory, "bar".


5.0.2: How do I mount a CDROM?  I've tried using mount(8), but it keeps on
       giving me an error like, "/dev/cd0a on /mnt: Incorrect super block."

You have to tell mount(8) the type of the device that you want to mount.  By
default, mount(8) will assume the filesystem is of type "ufs".  You want to
mount a CDROM filesystem, and you do this by specifying the "-t cd9660"
option to mount(8).  This does, of course, assume that the CDROM contains an
ISO 9660 filesystem, which is what most CDROMs have.  As of 2.0.5R, FreeBSD
also understands the Rock Ridge (long filename) extensions.

As an example, if you want to mount the CDROM device, "/dev/cd0c", under
/mnt, you would execute:

	mount -t cd9660 /dev/cd0c /mnt

Note that your device name ("/dev/cd0c" in this example) could be different,
depending on the CDROM interface.  Note that the "-t cd9660" option just
causes the "mount_cd9660" command to be executed, and so the above example
could be shortened to:

	mount_cd9660 /dev/cd0c /mnt


5.0.3: When I try to mount a CDROM, I get a "Device not configured" error.
       What's going on?

This generally means that there is no CDROM in the CDROM drive.  Feed the
drive something.


5.0.4: My programs occasionally die with "Signal 11" errors.  What's
       going on?

This can be caused by bad hardware (memory, motherboard, etc.).  Try running
a memory-testing program on your PC.  Note that, even though every memory
testing program you try will report your memory as being fine, it's possible
for slightly marginal memory to pass all memory tests, yet fail under
operating conditions (such as during busmastering DMA from a SCSI
controller like the Adaptec 1542).


5.0.5: Help, some of my X Window menus and dialog boxes don't work right!  I
       can't select them.

Try turning off the Num Lock key.


5.0.6: How do I access the virtual consoles?

If the console is not currently displaying X Windows, just press Alt-F1 to
Alt-F12.  NOTE: the default FreeBSD installation has only three (3) virtual
consoles enabled, and so only Alt-F1, Alt-F2, and Alt-F3 will work to switch
between three virtual consoles.  If you want to increase this number, see
the next question.

If the console is currently displaying X Windows, you can use Ctrl-Alt-F1,
etc. to switch to a virtual console.  Note, however, that once you've
switched away from X Windows to a virtual terminal, you use only the Alt-
function key to switch to another virtual terminal or back to X Windows.
You do not also press the Ctrl key; the Ctrl-Alt-function key combination is
used only when switching from X Windows to a virtual terminal.


5.0.7: How do I increase the number of virtual consoles?

Edit /etc/ttys and add entries for "ttyv4" to "ttyvc" after the comment on
"Virtual terminals" (delete the leading whitespace in the following
example):

	# Edit the existing entry for ttyv3 in /etc/ttys and change
	# "off" to "on".
	ttyv3   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv4   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv5   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv6   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv7   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv8   "/usr/libexec/getty Pc"         cons25  on secure
	ttyv9   "/usr/libexec/getty Pc"         cons25  on secure
	ttyva   "/usr/libexec/getty Pc"         cons25  on secure
	ttyvb   "/usr/libexec/getty Pc"         cons25  on secure

Use as many or as few as you want.  The more virtual terminals you have, the
more resources that are used; this can be important if you have 8MB RAM or
less.  You may also want to change the "secure" to "insecure".

IMPORTANT NOTE: if you want to run X Windows, you *MUST* leave a virtual
terminal unused (or turned off).  For example, if you want to attach a
virtual terminal to all of your twelve Alt-function keys, you can only
attach virtual terminals to eleven of them.  The last must be left unused,
because X Windows will use it, and you will use the last Alt-function key to
switch back to X Windows (after you have switched from X Windows to a
virtual console via a Ctrl-Alt-function key).  The easiest way to do this is
to disable a console by turning it off.  For example, if you have a keyboard
with twelve function keys, you would change settings for virtual terminal 12
from:

	ttyvb   "/usr/libexec/getty Pc"         cons25  on secure

to:

	ttyvb   "/usr/libexec/getty Pc"         cons25  off secure

If your keyboard has only ten function keys, you would end up with:

	ttyv9   "/usr/libexec/getty Pc"         cons25  off secure
	ttyva   "/usr/libexec/getty Pc"         cons25  off secure
	ttyvb   "/usr/libexec/getty Pc"         cons25  off secure

(You could also just delete these lines.)

Once you have edited /etc/ttys, the next step is to make sure that you have
enough virtual terminal devices.  The easiest way to do this is:

	cd /dev
	./MAKEDEV vty12			# For 12 devices

Next, the easiest (and cleanest) way to activate the virtual consoles is to
reboot.  However, if you really don't want to reboot, you can just shut down
X Windows and execute (as root):

	kill -HUP 1

It's imperative that you completely shut down X Windows if it is running,
before running this command.  If you don't, your system will probably appear
to hang/lock up after executing the kill command.