Tag Archives: dragonfly

Anything related to DragonFly BSD

screen, 256 colours and termcap mixed with PuTTY and FreeBSD

I have a 256 colour xterm set up on my DragonFly box.

Works perfectly. Especially for vim.

Now, I use FreeBSD 5.x as a gateway box to ssh into and have irssi and likewise programs screened.

Now, I was surprised to learn that I had only 16 colours. Outside of screen I had a full 256 colour palette (make sure to fix your PuTTY configuration by the way), but inside I was stripped of my colour scheme.

So I set off to find what was causing this. Interestingly enough one of the first emails encountered was from Jeremy Chadwick who had the exact same problem.

Turns out that screen needs to be compiled with 256 colour support (a knob should be in your ports Makefile now).

Since FreeBSD’s and DragonFly’s termcap is bereft of any 256 colour definitions for xterm apparently, you need to add the following to $HOME/.screenrc:

termcap xterm* 'Co#256:AB=E[48;5;%dm:AF=E[38;5;%dm'
terminfo xterm* 'Co#256:AB=E[48;5;%p1%dm:AF=E[38;5;%p1%dm'

This overrides your termcap settings with the appropriate definitions.

If you now start screen from a shell that has TERM exported as xterm or xterm-color (xterm* wildcard actually) it will fork off to a screen with 256 colour support.

You might need this in $HOME/.vimrc:

if &term =~ "xterm" || &term =~ "screen"
  set t_Co=256
  if has("terminfo")
    let &t_Sf=nr2char(27).'[3%p1%dm'
    let &t_Sb=nr2char(27).'[4%p1%dm'
  else
    let &t_Sf=nr2char(27).'[3%dm'
    let &t_Sb=nr2char(27).'[4%dm'
  endif
endif

strmode() function declaration buglet fixed

Was converting files to proper ANSI C function declarations and a user tripped over the fact that old 4.4 BSD’s function prototype of strmode() had int as a parameter, whereas it has been mode_t for a long, long time (read 1994 at least).

This broke buildworld of course.

Also asked Dima Dorfman to fix this for FreeBSD (broken in 4.x, 5.x, and 6.x).

NetBSD is fixed (as was to be expected to be honest).

And OpenBSD made the parameter int everywhere with a XXX comment in the strmode.c file that it should be mode_t actually. Weird.

True Type fonts, X.org, and MathML

I use MathML. Why? Because it just makes sense for mathematics on the websites.

On my DragonFly I had to do the following:

Installed X.org 6.8.1 or .2. Enable xfs (the X font server) by adding xfs_enable="YES" to rc.conf.

From ports install x11-fonts/ttmkfdir and x11-fonts/urwfonts-ttf.

Extract http://www.mozilla.org/projects/mathml/fonts/bakoma/texcm-ttf.zip to /usr/X11R6/lib/X11/fonts/TTF.

Extract from http://support.wolfram.com/mathematica/systems/windows/general/latestfonts.html the 4.1 TrueType fonts to /usr/X11R6/lib/X11/fonts/TTF.

In /usr/X11R6/lib/X11/fonts/TTF do:

# ttmkfdir > fonts.scale
# mkfontdir

This will update fonts.scale and fonts.dir, check them with cat or more to see if they contain references to the extracted new .ttf files.

Change /usr/X11R6/lib/X11/fs/config to have /usr/X11R6/lib/X11/fonts/urwfonts-ttf added to catalogue.
Also add /usr/X11R6/lib/X11/fonts/urwfonts-ttf as a FontPath to /etc/X11/xorg.conf.

# xset fp+ /usr/X11R6/lib/X11/fonts/urwfonts-ttf
# xset fp rehash

Edited $HOME/.fonts.conf and added:
[xml]<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family">
<string>symbol</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Standard Symbols L</string>
</edit>
</match>
</fontconfig>[/xml]

Added

user_pref("font.mathfont-family", "Math1, Math2, Math4");

to $HOME/.mozilla/firefox/<profile.default>/user.js.

There seem to be some bugs still, at least in displaying the W3C test suite.

Words of Light

Over the last couple of days I have been busy updating a lot of support within DragonFly, think of firewire support, ATA/SATA, AC’97, bridges, PCI definitions, and so on.
Lovely stuff.

Now if only my AMD Athlon/Asus A7N8X box would boot. Something is wrong with the nexus attachment.

At the moment de-OSSGing my TenDRA sources. If you’re doing whitespace changes run md5 on the resulting object file before and after the changes. They should match.

chak de chak de chak de // Cast it off…
chak de saare gam // cast off every sorrow.
chak de chak de chak de // Cast it off…
tere sang hain hum // I’m by your side!

Chak de, from the Indian movie Hum Tum…

Gaara – 我愛羅

Of course, some people might recognise the title. Sabaku no Gaara (砂瀑の我愛羅) being a character from the anime series. The name means: Gaara of the Desert. The name Gaara (我愛羅) itself is a combination of: ga-a(i)-ra, meaning: I, love, demon. In general you could read it as: “I love myself, I am a demon.”

The kanji ‘ai':

For some reason I love this Kanji. Consists of 13 strokes.

DragonFly is pushing along nicely, Emiel a.k.a. coolvibe has managed to get into contact with the NVIDIA guys and is now even getting prerelease drivers! Way cool. Thanks to all the people supporting DragonFly in any way, your enthousiasm is what keeps us moving along.

One of my plans for DragonFly’s support is bootable images for ISO 9660 and diskettes which do various reporting on BIOSes and the like. This should provide clues into the wonderful world of whacked implementations.

I also started work on the bdb (BSD-licensed debugger) in order to support my own work as well as DragonFly.

Butterflies on a Sea Wind

Some of those days are a mixture between the truly wonderful and truly weird.

Been actively sending in patches to other projects to support DragonFly natively. For projects using autoconf/config you need to bug the maintainers to update config.guess and config.sub so it detects DragonFly.

With TenDRA I am currently adding Amos’ -y flag, since it just makes sense to get rid of any hardwired stuff with regards to paths. Been looking at SuperH, ARM, and some other processors. Right now busy getting STLport working, of course, after I fix the -y flag and the building/* issues.

This is one of those days where you would put on Sigur Ros, The Counting Crows, Muse, or any other of those loveable melancholic bands…

Fixed, or was it?

So I finally managed to get the box compiling world -for some reason cpp1 didn’t like -fmemoize-lookups -fsave-memoized only to have it keel over due to Matt (Dillon) having changed something in the ATA code. And my ICH2 based chipset at work didn’t particularly like that.

Must say that Webmin is nice to use for DNS managing, but I still haven’t found a way to really use zone template files.

The Netherlands won against Latvia last night during the European Championship 2004 soccer/voetbal/futbol games with a 3 – 0 score. I must say that Latvian ladies can definately look very pretty. Also thanks to our Czechian friends for managing to keep Germany, a very strong soccer nation, under control and even winning!