H. Peter Anvin wrote on 8 July:
> This is much better done by a framebuffer console driver. Although
> it's probably best done in user space (see kcon), it would be possible
> to extend fbcon to support an arbitrary large charset.
The framebuffer console is a nice abstraction, but I think anything
based on X is superior in practice.
On my machine with a Mach64 graphics card, I tried to boot with
framebuffer console in various configurations. (kernel: 2.2.16) The
only one that worked was CONFIG_FB_VESA, Other modes put my graphics card
into strange modes (fuzzy vertical strips). And CONFIG_FB_VESA caused
all text to appear with high intensity, i.e. with a contrast that is
too high for normal use. Thus I switched back to the old 80x34 VGA console.
My conclusion is that generally much better efforts are made to
support a graphics card through X than through the framebuffer
console.
So here is a hack which puts an X server and an xterm on an arbitrary
virtual console. With this I get a resolution of ca. 189x60 character
cells - which I wouldn't get with any framebuffer console. Plus,
double-width and combining characters are already implemented, through
Robert's patch. Plus, it doesn't need a new font format. Plus, if you
need a CJK input method additionally, just leave some room at the
bottom of the screen and put it there.
Have fun.
Bruno
========================== /usr/local/sbin/xgetty ============================
#!/bin/sh
# xgetty ttyNN puts an X session with xterm login at /dev/ttyNN
#
# In /etc/inittab add lines like the following:
# 5:123:respawn:/usr/local/sbin/xgetty tty5
# 6:123:respawn:/usr/local/sbin/xgetty tty6
#
# Customize login, so it doesn't time out if inactive:
# In /etc/login.defs, set LOGIN_TIMEOUT to 1000000000.
#
# History:
# 2000-07-24 version 0.01 First hack. Probably full of security holes.
# Set a PATH which will find X, xsetroot, xterm etc.
PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin
export PATH
# Set a few shell variables depending on the tty. Set DISPLAY.
tty="$1"
nr=`echo $tty | sed -e 's/^tty//'`
DISPLAY=:`expr 100 + "$nr"`
export DISPLAY
nr_padded=`echo $DISPLAY | sed -e 's/^.*\(..\)$/\1/'`
# For debugging, log every output.
exec >> /var/log/xgetty${nr_padded}.log 2>&1
# Start of the log entry.
date +"Start at %Y-%m-%d %H:%M:%S"
set -x
# Remove a lock file which could prevent X from starting up.
rm -f /tmp/.X`echo $DISPLAY | sed -e 's/^://'`-lock
# Start X and note its process id for later.
X $DISPLAY vt${nr_padded} -disableVidMode &
Xpid=$!
# Two ways to determine the X screen size. I have no idea why it causes the
# screen to flicker.
if true; then
tries=0
while true; do
displaysize=`xdpyinfo | grep 'dimensions:' | head -1 | sed -e 's/^[
]*dimensions:[ ]*//' -e 's/[ ]*pixels.*$//'`
if test -n "$displaysize"; then break; fi
# Wait until the X server is up
sleep 1
tries=`expr $tries + 1`
if test $tries = 10; then exit 1; fi
done
width=`echo "$displaysize" | sed -e 's/x.*//'`
height=`echo "$displaysize" | sed -e 's/.*x//'`
else
# This flickers even twice.
width=`xwininfo -root | grep Width: | sed -e 's/^[ ]*Width:[ ]*//' -e 's/[
]*$//'`
height=`xwininfo -root | grep Height: | sed -e 's/^[ ]*Height:[ ]*//' -e 's/[
]*$//'`
fi
while true; do
# The xterm will be nearly fullscreen; make the thin grey shaded borders
# at the right and bottom screen edge disappear.
(sleep 1; xsetroot -solid black)&
# The xterm we want to launch is an UTF-8 enabled one.
xterm="/usr/local/bin/xterm-brady -u8 -fn
-*-fixed-medium-R-semicondensed-*-13-120-*-*-*-*-ISO10646-1"
# Computation of the number of cells of xterm.
cellwidth=6
cellheight=13
width_cells=`expr '(' "$width" - 18 ')' / "$cellwidth"`
height_cells=`expr '(' "$height" - 2 ')' / "$cellheight"`
# Remove all environment variables, then set only
# PATH (so that it finds xterm if specified without full pathname),
# LANG (so programs are informed that UTF-8 is the encoding to use),
# HIDE_DISPLAY (so .bashrc and .profile scripts know to remove $DISPLAY -
# so that "emacs" will act like "emacs -nw").
# Then start xterm with a scrollbar and no exterior border.
env -i PATH=$PATH LANG=de_DE.UTF-8 HIDE_DISPLAY=1 \
$xterm -display $DISPLAY -geometry "$width_cells"x"$height_cells"+0+0 -bw 0 -ah -sb
-sl 1024 -rv -e /bin/login -p
# When xterm terminates, loop if the X server is still alive.
Xprocess=`ps ax | grep "^ *$Xpid "`
if test -n "$Xprocess"; then
continue
else
break
fi
done
# Clean up a lock file.
rm -f /tmp/.X`echo $DISPLAY | sed -e 's/^://'`-lock
# End of the log entry.
date +"End at %Y-%m-%d %H:%M:%S"
echo "======================================================================"
# End this script. If "respawn" is given in /etc/inittab, It will be restarted.
exit 0
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/