Subject: Re: Non-blinking, block cursor
To: None <port-i386@netbsd.org>
From: Chris Baird <cjb@brushtail.apana.org.au>
List: port-i386
Date: 12/13/2000 23:25:45
>> How do I get a non-blinking, block cursor at the text console
>> starting from a default install of NetBSD 1.4.2 (GENERIC kernel)?

 > I don't believe you can under 1.4.2, you will need 1.5. Under 1.4.2
 > the 'pcvt' driver has cursor support, but only hardware (AFAICT) so
 > you'll still blink. :)

If using wscons, and blinking is acceptable, I was using the following
code for the old FAT_CURSOR effect:
-- 
Chris Baird,, <cjb@brushtail.apana.org.au>


/* compile with: cc -o fatcursor fatcursor.c -lm -li386
 * add "-static" to the above if calling from early in /etc/rc
 */
#include <sys/types.h>
#include <machine/sysarch.h>
#include <stdio.h>

void enableperm (short bit)
{
  unsigned long iomap[32], word, shift, mask;

  if (i386_get_ioperm(iomap))
    errx (1, "i386_get_ioperm failed");
  word = bit >> 5;
  shift = bit & 31;
  mask = 1L << shift;
  iomap[word] &= ~mask;
  if (i386_set_ioperm(iomap))
    errx (1, "i386_set_ioperm failed");
}

inline void outb (unsigned short port, unsigned char value)
{
  asm ("outb %0,%1" ::"a" (value),"d" (port));
}

int main(int argc, char *argv[])
{
  short iobase = 0x3D4;	

  enableperm (iobase);
  enableperm (iobase+1);
  outb (iobase, 10);
  outb (iobase+1, 0);
  outb (iobase, 11);
  outb (iobase+1, 31);

  return 0;
}