SVR3 console message capturing

SVR3 console message capturing

Post by Keith Gregoi » Thu, 02 Aug 1990 06:49:00



I am running Bell Tech System V/386, release 3 on a Bell Tech 386.

I am looking for a way of capturing console error messages (notices,
warnings and panics) to a file (or at least a printer) such as
the way BSD and XENIX do with dmesg.  I have scoured the Bell Tech
System Admin manuals and cannot find a clue as to whether there is
an existing way to do this.  The dmesg command cannot be found.  

I'd rather not reinvent the wheel.  Does anyone have a solution to
this?  I have several ideas:

1.      Obtaining a console driver to customize to send output to a file
        as well as the usual places.

2.      Obtaining a console driver that can use a hardcopy terminal as
        a console instead of the monitor and keyboard.

3.      Write a dmesg that works on SVR3.

4.      Can /dev/contty be exploited somehow?  

There must be someone else who has had this same problem.  If there is a
way of doing this with the resources I already have with System V/386,
please let me know what I'm missing via email.

--

In-Real-Life: Keith Gregoire, Thalatta Corporation, (+1 206 455 9838)

 
 
 

SVR3 console message capturing

Post by Jeff Bowl » Thu, 02 Aug 1990 14:42:00



>I am running Bell Tech System V/386, release 3 on a Bell Tech 386.

>I am looking for a way of capturing console error messages (notices,
>warnings and panics) to a file (or at least a printer) such as
>the way BSD and XENIX do with dmesg...

Yes, I know this is going to three groups, but the answer is useful
to people who read all three groups.

Included in the Bell Tech release (and EVERY System V source release since
SVR3.0) is a driver called "osm". In effect, it's a driver that provides
read/write access to the circular buffer (that's by default a couple of
thousand bytes) that captures kernel printf messages. Investigate your
OS directories, you'll find it - add the driver to your kernel, reboot,
make the nodes for it (CHARACTER-SPECIAL devices, mind you!)  and then
you can just cat(1) the device.... Nothing more needed.

        Jeff Bowles

 
 
 

SVR3 console message capturing

Post by John Fe » Thu, 02 Aug 1990 20:09:00



> I am running Bell Tech System V/386, release 3 on a Bell Tech 386.

> I am looking for a way of capturing console error messages (notices,
> warnings and panics) to a file (or at least a printer) such as

(This assumes that thew Bell Tech UNIX behaves like Intel's version of UNIX)
The kernel keeps a buffer of PANIC, WARNING, driver printf's, etc.
There are two easy ways to read it.  First go into crash and type "panic".
The messages will be printed.  The second way is to create a character special
file for the "osm" driver (make sure it's configured into your kernel and check
the major number by looking in /etc/conf/systems and
/etc/conf/modules/osm/config. Then you can use cat or tail to look at the
messages (cat /dev/osm).

John Fenk
Intel Corporation
tektronix!ogcvax!littlei!osdtm1!fenk

 
 
 

SVR3 console message capturing

Post by Eric Varsan » Fri, 03 Aug 1990 00:04:00




>>I am looking for a way of capturing console error messages (notices,
>Included in the Bell Tech release (and EVERY System V source release since
>SVR3.0) is a driver called "osm".

If you have another machine, you can patch 'kernputc' to either 0x2f8 or
0x3f8 and all kernel printf's will go to the serial port (at 9600 baud).
The problem with osm is that it does not catch a panic message, you have to
go look at the dump to find the panic since the 'cat' will never get dispatched
after a panic. If you have another box that can record stuff off the serial
port it is a great way to log disk errors and other stuff that usually scrolls
away.
 
 
 

SVR3 console message capturing

Post by WU SHI-KU » Thu, 02 Aug 1990 17:26:00





>>>I am looking for a way of capturing console error messages (notices,
>>Included in the Bell Tech release (and EVERY System V source release since
>>SVR3.0) is a driver called "osm".

Our console is a Qume 102 terminal with a printer port.  That port feeds a
PC serial to parallel buffer (Microfazer), which in turn feeds an ancient
and slow Epson printer.  This kludge lets the console run at 9600 while
still capturing everything on paper (YECH).

All this on a 3B2/400 running SV.2.04.

Only a guest here, I really am:

Carl Brandauer
uunet!nbires!bdaemon!carl

 
 
 

SVR3 console message capturing

Post by Joe Bob Will » Thu, 02 Aug 1990 18:24:00



>I am running Bell Tech System V/386, release 3 on a Bell Tech 386.

>I am looking for a way of capturing console error messages (notices,
>warnings and panics) to a file (or at least a printer) such as
>the way BSD and XENIX do with dmesg.  I have scoured the Bell Tech
>System Admin manuals and cannot find a clue as to whether there is
>an existing way to do this.  The dmesg command cannot be found.  

is /usr/lib/errdemon present on your system?  we have it here.  it
takes reads from /dev/conslog and writes to /usr/adm/console_log.
i believe our system is S5R2 based.  one might assume bell tech didn't
remove features ...

however, the device driver for a console log output driver is very
simple.  read from the system error message ring buffer, write to
the user address space (passc() should be helpful here).  do this until
u.u_count goes to zero or passc() returns an error.
--

     "Never attribute to malice what is adequately explained by stupidity"
                -- Hanlon's Razor

 
 
 

SVR3 console message capturing

Post by Larry Phil » Thu, 02 Aug 1990 10:39:00



>I am running Bell Tech System V/386, release 3 on a Bell Tech 386.

>I am looking for a way of capturing console error messages (notices,
>warnings and panics) to a file (or at least a printer) such as
>the way BSD and XENIX do with dmesg.  I have scoured the Bell Tech
>System Admin manuals and cannot find a clue as to whether there is
>an existing way to do this.  The dmesg command cannot be found.  

>In-Real-Life: Keith Gregoire, Thalatta Corporation, (+1 206 455 9838)


On some versions of 386 UNIX, most particularily 386/ix from ISC, there is a
"osm" pseudo device that can be configured into the kernel.  osm stands for
Operating System Messages, and it does just what you want.  Look in your config
directory and see if you have it.  If so, create /dev/osm (usally major 17,
minor 0) then run "cat -u > filename" on it to copy the messages to a file.

If it turns out that you don't have it, write one yourself.  The kernel printf
code saves all messages it prints in a global circular character array called
"putbuf", the variable "putbufsz" gives the number of characters in this array,
and the variable "putbufndx" gives the location at which the next character
will be put into the array.  The printf code also does a wakeup(putbuf)
whenever new characters are put into the array.  Makes for an easy 50 line
driver to access the information you want.

Here is a short user program I wrote ages ago when I was trying to figure out
how putbuf was used.  Actually, you could probably hack this into something
close to what you want instead of writing a driver.
----------
#include <stdio.h>
#include "sys/types.h"

#include "nlist.h"

#define PUTBUF          0
#define PUTBUFSZ        1
#define PUTBUFNDX       2
struct nlist nl[] = {
#ifdef vax
        { "_putbuf" },
        { "_putbufsz" },
        { "_putbufndx" },
#else
        { "putbuf" },
        { "putbufsz" },
        { "putbufndx" },
#endif
        { 0 },

Quote:};

#define BUFFERSIZE      10000
char    buf[BUFFERSIZE];

char    *malloc();

main()
{
        int     i, j;
        int     memfd, putbufndx, putbufsz;
        char    *putbuf;

        if ((memfd = open("/dev/kmem", 0)) < 0) {
                perror("/dev/kmem");
                exit(1);
        }

        nlist("/unix", nl);
        if (nl[0].n_value == 0) {
                fprintf(stderr, "nlist failed\n");
                exit(2);
        }
#ifdef vax
        nl[0].n_value = ((int)nl[0].n_value  & 0x3fffffff);
        nl[1].n_value = ((int)nl[1].n_value  & 0x3fffffff);
        nl[2].n_value = ((int)nl[2].n_value  & 0x3fffffff);
#endif

        Lseek("putbufsz", memfd, (long)nl[PUTBUFSZ].n_value, 0);
        Read("putbufsz", memfd, (char *)&putbufsz, sizeof(putbufsz));
        printf("putbufsz %d\n", putbufsz);

        if (putbufsz >= BUFFERSIZE) {
                fprintf (stderr, "putbufsz(%d) >= BUFFERSIZE(%d)\n",
                                putbufsz, BUFFERSIZE);
                exit(4);
        }

        Lseek("putbufndx", memfd, (long)nl[PUTBUFNDX].n_value, 0);
        Read("putbufndx", memfd, (char *)&putbufndx, sizeof(putbufndx));
        printf("putbufndx %d\n", putbufndx);

        if ((putbuf = malloc(putbufsz)) < 0) {
                perror("sbrk");
                exit(5);
        }

        Lseek("putbuf", memfd, (long)nl[PUTBUF].n_value, 0);
        Read("putbuf", memfd, (char *)putbuf, putbufsz);

        putbufndx = (putbufndx + 1) % putbufsz;
        putbuf[putbufndx] = '\0';

        i = (putbufndx + 1) % putbufsz;
        while (i != putbufndx && putbuf[i] == '\0')
                i = (i + 1) % putbufsz;
        j = 0;
        while (i != putbufndx) {
                buf[j] = putbuf[i];
                i = (i + 1) % putbufsz;
                j++;
        }
        buf[j] = '\0';

        printf("putbuf:\n%s\n", buf);
        return(0);

Quote:}

Lseek(s, fd, offset, set)
        char    *s;
        int     fd, offset, set;
{
        if (lseek(fd, offset, set) == -1) {
                sprintf(buf, "%s: lseek (%d, 0x%x, %d)", s, fd, offset, set);
                perror (buf);
                exit (1);
        }

Quote:}

Read(s, fd, addr, n)
        char    *s;
        int     fd, addr, n;
{
        int     i;

        if ((i = read(fd, addr, n)) == -1) {
                sprintf(buf, "%s: read(%d, 0x%x, %d)", s, fd, addr, n);
                perror (buf);
                exit (2);
        }

        if (i != n) {
                fprintf(stderr, "%s: read(%d, 0x%x, %d) returned %d\n",
                                s, fd, addr, n, i);
                exit (3);
        }

Quote:}

----------
Larry Philps                             HCR Corporation
130 Bloor St. West, 10th floor           Toronto, Ontario.  M5S 1N5
(416) 922-1937                           {utzoo,utcsri,decvax,ihnp4}!hcr!larry
 
 
 

1. Console text capture (to review kernal compile error messages)?

Hi all,

I have been trying unsucessfully to recompile my kernal.  After I run
"make mrproper", "make xconfig", "make dep", "make clean" then "make
bzImage" it runs throught all the various makes and after about 2-3
minutes end with an error 127 and error 2.  I would like to submit this
error message to the group in a request for help.  But how do I copy
this console message to a text file so I can review and copy off to a
message?

Is there a screen text log file?

2. DNS Problems

3. Capturing console messages to a file

4. Where is hdparm ?

5. Capture Console Messages

6. Quotiing * in Bourne shell question

7. Help: capturing console messages in X

8. pts: problems???

9. Differences between SVR2, SVR3, and SVR3.1 for 3B15 ?

10. shl on console hangs on console message

11. How to present console messages without a console window?

12. Why don't console message appear in my ``console'' window?

13. Intercepting console messages without disabling the console