Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 1996 17:31:35 +1000 (EST)
From:      Julian Assange <proff@suburbia.net>
To:        hackers@freebsd.org
Subject:   SVGATextMode under FBSD
Message-ID:  <199609210731.RAA15662@suburbia.net>

next in thread | raw e-mail | index | archive | help

I have a fetish for large text screens (the one I'm writing this email on
is 180x60 (8x16 font) 10800 chars on screen at once, that's 5 x as much
information before my brain). FreeBSD's inability to do this is the
biggest problem I have with it, so I've started porting linux's SVGATextMode
package. 

I'm managed to get vgaset running so far (lets you play with s/vga registers
interactively and produces XF86 mode lines from your fiddling), however
there are a few kernel issues I'd like advice on, before I start creating
my own standards.

FreeBSD, SVR4 and linux have:

	ioctl (open("/dev/console"), KDENABIO|KDDISABIO, 0)

which gives access to all ioports.

However SVR4 and linux also have:

	ioctl (open("/dev/console"), KDADDIO|KDDELIO, port)

which gives/removes access to ioports in granular manner.

Linux also has:

	       int ioperm(unsigned long from, unsigned long num, int turn_on);

	DESCRIPTION
	       Ioperm sets the port access permission bits for the
	       process for num bytes starting from port address from to
	       the value turn_on.  The use of ioperm require root
	       privileges.

	       Only the first 0x3ff I/O ports can be specified in this
	       manner.  For more ports, the iopl function must be used.

and:

	       int iopl(int level);

	DESCRIPTION
	       iopl changes the I/O privilege level of the current
	       process, as specified in level.

	       This  call  is  necessary to allow 8514-compatible X
	       servers to run under Linux.  Since these X servers
	       require access to all 65536 I/O ports, the ioperm call is
	       not sufficient.

Which are really just backends to KDADDIO|KDDISABIO and KDENABIO|KDDELIO
respectively.

Linux impliments KDADDIO/ioperm as a 128 byte bitmap for each process.
This is the way I'd like to see it in FreeBSD, but I do not understand
the how inb/outb interacts with the mm system well enough to do this
confidently (comments on this?). As a crude hack, I intend to wrap
KDADDIO|ioperm in linux_compat to KDENABIO. iopl wraps cleanly. This
should be enough to run svgalib programs, which is a big win, IMEO.

Linux also has:

$ fgrep define /usr/include/linux/vt.h
#define _LINUX_VT_H
#define VT_OPENQRY      0x5600  /* find available vt */
#define VT_GETMODE      0x5601  /* get mode of active vt */
#define VT_SETMODE      0x5602  /* set mode of active vt */
#define         VT_AUTO         0x00    /* auto vt switching */
#define         VT_PROCESS      0x01    /* process controls switching */
#define         VT_ACKACQ       0x02    /* acknowledge switch */
#define VT_GETSTATE     0x5603  /* get global vt state info */
#define VT_SENDSIG      0x5604  /* signal to send to bitmask of vts */
#define VT_RELDISP      0x5605  /* release display */
#define VT_ACTIVATE     0x5606  /* make vt active */
#define VT_WAITACTIVE   0x5607  /* wait for vt active */
#define VT_DISALLOCATE  0x5608  /* free memory associated to vt */
#define VT_RESIZE       0x5609  /* set kernel's idea of screensize */
#define VT_RESIZEX      0x560A  /* set kernel's idea of screensize + more */
#define VT_LOCKSWITCH   0x560B  /* disallow vt switching */
#define VT_UNLOCKSWITCH 0x560C  /* allow vt switching */

ioctl's used for VT resizing etc, most of which do not have syscon/pcvt
counterparts, but all of which should be relatively easy to impliment.
In terms of the linux emmulation code, should these be implimented in
syscons() using the linux defines/values, or as KD* extensions, with
FreeBSD values, and a linux_compat ioctl() wrapper? I'm in favour of
VT_* in order to avoid polluting the USL name space.

-- 
"Of all tyrannies a tyranny sincerely  exercised for the good of its victims  
 may be the most  oppressive.  It may be better to live under  robber barons  
 than  under  omnipotent  moral busybodies,  The robber baron's  cruelty may  
 sometimes sleep,  his cupidity may at some point be satiated; but those who  
 torment us for own good  will torment us  without end,  for they do so with 
 the approval of their own conscience."    -   C.S. Lewis, _God in the Dock_ 
+---------------------+--------------------+----------------------------------+
|Julian Assange RSO   | PO Box 2031 BARKER | Secret Analytic Guy Union        |
|proff@suburbia.net   | VIC 3122 AUSTRALIA | finger for PGP key hash ID =     |
|proff@gnu.ai.mit.edu | FAX +61-3-98199066 | 0619737CCC143F6DEA73E27378933690 |
+---------------------+--------------------+----------------------------------+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609210731.RAA15662>