Amiga Unix — 68040 · 68060

Manual pages › Devices and drivers (7)

monsw(7)

the monitor switch between the chipset display and a display card

Package: monsw46, added for amigaux.

monsw - the monitor switch between the chipset display and a display card

/dev/monsw
#include <sys/monsw.h>

Some display cards share the monitor with the Amiga's own picture: one or two lines of the CIA-B port (CTS and SEL of the serial and parallel ports) switch a monitor or a KVM between the two. monsw owns those lines. It is a loadable kernel module of the demand class: it loads at the first open of /dev/monsw, or before a card driver that depends on it. A card driver switches through its kernel interface; programs use the device, as monswctl(1M) does.

The value says which lines switch the monitor and at which level. It is a sum of these bits, the meanings of the Z3660's own monitor_switch setting:

1
drive CTS (CIA-B port A, bit 4);
2
drive SEL (bit 2);
16
CTS low is the card's picture (without it, CTS high is);
32
SEL low is the card's picture.

0 touches no line. The valid values are 0 to 3, 16 to 19, 32 to 35 and 48 to 51; another value is reported once on the console and taken as 0. For example, 34 switches with SEL, the card's picture when SEL is low.

The first of these that is set is the value in effect:

1.
the module parameter config, 0 or more, in /etc/conf/modreg.local.d/monsw: the value is then forced, and the next source is refused;
2.
the value set with MONSWIOC_SETCFG, root only. At every boot, /etc/rc2.d/S20monsw sets the monsw line of /etc/display; when that file has no such line, the first line of the older file /etc/monsw, and the boot log says so; when neither has a value it sets nothing;
3.
the value the first card driver offered when it registered, its seed (the Z3660 offers its firmware setting);
4.
otherwise 0.

A value that cannot be set at boot is one line on the console and in the boot log, and the boot goes on.

Only the lines the value names are touched, and nothing is driven until the first switch. The switch returns to the chipset's picture at the last close of the device when the program that asked for the card's picture holds it, so a program that dies cannot leave the monitor on the card.

MONSWIOC_RTG, MONSWIOC_NATIVE and MONSWIOC_SETCFG need the device open for writing, and give EBADF on a descriptor opened only for reading; MONSWIOC_GETCFG needs only a read-only open.

switch to the card's picture.
switch to the chipset's picture.
fill a struct monsw_info: the value in effect, its source, the state, the holder flag and the number of cards registered.
the argument is the value itself, or -1 to unset it. Root only (EPERM). EINVAL for a value that is not a valid sum, EBUSY while a value is forced by the parameter.

/dev/monsw
character major 52, minor 0, mode 0644, owner root: any user can open it for reading and read the value; switching and setting it need it open for writing, which is root's.
/etc/conf/mod.d/monsw
the module.
/etc/init.d/monsw
the boot step, installed also as /etc/rc2.d/S20monsw.
/etc/display, /etc/monsw
the value set at boot.

monswctl(1M), display(4), display.d(4), xstart(1)

31 October 2026 monsw