Subject: Problems with NetBSD

From: -----------------------oo-OO-oo------------------------- <[email-masked]>

I recentlty installed NetBSD (644), and so far I must say, that I'm
more than happy with it. Excellent work once again by Markus Wild.

But... I've found some strange things about it.

(1) When booting the kernel, loadbsd vmunix.644, I get:
    No suitable root 3 times of 4... I have set the inhibit_sync flag.
    Is this a common problem?

(2) I have a terminal connected to the serialport. Which device
    should I use? Now I use /dev/tty02, but it locks randomly, when
    using speeds from 9600 baud and up.

(3) When I start an editor, vi or emacs, from my terminal, the system
    panics. Something about mmu-fault.

(4) Is there a way to change the keymap, to anything else than US?

/Patrik

---

From: [email-masked] (Markus Wild)

>     Is this a common problem?

You did realize that the inhibit_sync variable is not a flag, but an
array of flags? Just want to make sure you set the right location, ie.
the address of inhibit_sync PLUS your unit number.

>     using speeds from 9600 baud and up.

Don't... the /dev/tty01 and /dev/tty02 "devices" are are quick&dirty
hack to turn on/off modem control for /dev/tty00, they're  not real 
devices. They, for example, don't have an associated line discipline,
and are sure as hell going to crash the machine if you use them for
regular ttys...

>     panics. Something about mmu-fault.

Do you use new binaries? If you use old binaries, AND have a 
/usr/share/zoneinfo directory which contains valid timezone data files,
just about all old binaries that used the ctime() function are going
to crash.

> (4) Is there a way to change the keymap, to anything else than US?

Check out sys/arch/amiga/stand/loadkmap. This directory contains an
experimental keymap loader. If you play around with keymaps, you may
end up with a bogous keymap installed, so you can't type anything. To
breach out of such a problem, there's a "magic" key combination to
reset the kernel to the builtin US-ISO keymap. However, the code for
this was broken in #644, here's a quick fick for #644 ite.c, this also
adds support for application mode cursor and keypad keys:

*** ite.c.644	Wed Sep  8 23:28:15 1993
--- ite.c	Wed Oct 20 20:42:02 1993
***************
*** 663,671 ****
      }

!   /* intercept Ctrl-LAlt-F1 here to switch back to original ascii-keymap.
       this should probably be configurable.. */
!   if (mod == (KBD_MOD_LALT|KBD_MOD_SHIFT) && code == 0x50)
      {
        bcopy (&ascii_kbdmap, &kbdmap, sizeof (struct kbdmap));
        splx (s);
--- 663,671 ----
      }

!   /* intercept LAlt-LMeta-F1 here to switch back to original ascii-keymap.
       this should probably be configurable.. */
!   if (mod == (KBD_MOD_LALT|KBD_MOD_LMETA) && c == 0x50)
      {
        bcopy (&ascii_kbdmap, &kbdmap, sizeof (struct kbdmap));
        splx (s);
***************
*** 747,753 ****
      }
    
    /* if not string, apply META and CTRL modifiers */
!   if (! (key.mode & KBD_MODE_STRING))
      {
        if (mod & KBD_MOD_CTRL)
          code &= 0x1f;
--- 747,754 ----
      }
    
    /* if not string, apply META and CTRL modifiers */
!   if (! (key.mode & KBD_MODE_STRING) 
!       && (!(key.mode & KBD_MODE_KPAD) || !kbd_ip->keypad_appmode))
      {
        if (mod & KBD_MOD_CTRL)
          code &= 0x1f;
***************
*** 755,766 ****
--- 756,797 ----
        if (mod & KBD_MOD_META)
          code |= 0x80;
      }
+   else if ((key.mode & KBD_MODE_KPAD) && kbd_ip->keypad_appmode)
+     {
+       static char *in  = "0123456789-+.\r()/*";
+       static char *out = "pqrstuvwxymlnMPQRS";
+       char *cp;
+       
+       if (caller != ITEFILT_CONSOLE && (cp = index (in, code)))
+ 	{
+ 	  /* keypad-appmode sends SS3 followed by the above translated
+ 	     character */
+ 	  itesendch (27); itesendch ('O');
+ 	  itesendch (out[cp - in]);
+ 	  splx (s);
+ 	  return -1;
+ 	}
+     }
    else
      {
        /* strings are only supported in normal tty mode, not in console mode */
        if (caller != ITEFILT_CONSOLE)
          {
+ 	  /* *NO* I don't like this.... */
+ 	  static u_char app_cursor[] = {
+ 	    3, 27, 'O', 'A',
+ 	    3, 27, 'O', 'B',
+ 	    3, 27, 'O', 'C',
+ 	    3, 27, 'O', 'D'};
+ 
            str = kbdmap.strings + code;
+ 	  /* if this is a cursor key, AND it has the default keymap setting,
+ 	     AND we're in app-cursor mode, switch to the above table. This
+ 	     is *nasty* ! */
+ 	  if (c >= 0x4c && c <= 0x4f && kbd_ip->cursor_appmode 
+ 	      && !bcmp (str, "\x03\x1b[", 3) && index ("ABCD", str[3]))
+ 	    str = app_cursor + 4 * (str[3] - 'A');
+ 
            /* using a length-byte instead of 0-termination allows to embed \0 into
               strings, although this is not used in the default keymap */
            for (i = *str++; i; i--)
***************
*** 1568,1573 ****
--- 1599,1634 ----
  		    ite_inchar (ip, sp, ite_argnum (ip));
  	            ip->escape = 0;
  	            return;
+ 
+ 
+ 		  case 'G':
+ 		    /* this one was *not* in my vt320 manual but in 
+ 		       a vt320 termcap entry.. who is right?
+ 		       It's supposed to set the horizontal cursor position. */
+ 		    *ip->ap = 0;
+ 		    x = atoi (ip->argbuf);
+ 		    if (x) x--;
+ 		    ip->curx = MIN(x, ip->cols - 1);
+ 		    ip->escape = 0;
+ 		    (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ 		    clr_attr (ip, ATTR_INV);
+ 		    return;
+ 
+ 
+ 		  case 'd':
+ 		    /* same thing here, this one's for setting the absolute
+ 		       vertical cursor position. Not documented... */
+ 		    *ip->ap = 0;
+ 		    y = atoi (ip->argbuf);
+ 		    if (y) y--;
+ 		    if (ip->inside_margins)
+ 		      y += ip->top_margin;
+ 		    ip->cury = MIN(y, ip->rows - 1);
+ 		    ip->escape = 0;
+ 		    snap_cury(ip, sp);
+ 		    (*sp->ite_cursor)(ip, MOVE_CURSOR);
+ 		    clr_attr (ip, ATTR_INV);
+ 		    return;

  		  case 'H':

-Markus
-- 
CHUUG/EUnet Switzerland				Markus Wild
Zweierstrasse 35	Tel: +41 1 291 45 80	[email-masked]
CH-8004 Zuerich		Fax: +41 1 291 46 42	S=mw;P=EUnet;A=EUnet;C=CH