proposal for /proc/vidinfo

proposal for /proc/vidinfo

Post by Carsten Zimmerma » Sun, 23 Apr 1995 04:00:00




: Is there any elegant way I can retrieve the video mode the system is
: booted in right after bootup, other than grepping kmsg?

: I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44"
: if that's what I boot up in (as a minimum), and that it be updated
: upon each change of video mode.

Hi,
what do you think about "dmesg |grep Console". If you parse this line
you may get every Information you want.

Carsten

--
*****************************************************************************

*Zimmermann      *                                   *  Loesung ...   "     *

 
 
 

proposal for /proc/vidinfo

Post by Bauke Jan Dou » Sun, 23 Apr 1995 04:00:00


Hi,

Is there any elegant way I can retrieve the video mode the system is
booted in right after bootup, other than grepping kmsg?

I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44"
if that's what I boot up in (as a minimum), and that it be updated
upon each change of video mode.

BJ


 
 
 

proposal for /proc/vidinfo

Post by Carsten Zimmerma » Tue, 25 Apr 1995 04:00:00



: C> : I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44" :
: C> if that's what I boot up in (as a minimum), and that it be updated : upon
: C> each change of video mode.

: C> Hi, what do you think about "dmesg |grep Console". If you parse this line
: C> you may get every Information you want.

: It doesn't tell the current mode, only the one used to boot.  If I change
: modes with SVGATextMode, I still get the old mode.
I'm sorry, i haven't read the last sentence :-(
But you can parse also the output from stty. And if you don't like to write
a parser you can also write a little program that prints the data in every
form you like. Ok, that could also be done in the kernel. But why should it
be done there ? A program can use the libraries to get this information, and
while in an interactive Session you can use stty.

Carsten

--
*****************************************************************************

*Zimmermann      *                                   *  Loesung ...   "     *

 
 
 

proposal for /proc/vidinfo

Post by Albert Cahal » Tue, 25 Apr 1995 04:00:00


C> : I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44" :
C> if that's what I boot up in (as a minimum), and that it be updated : upon
C> each change of video mode.

C> Hi, what do you think about "dmesg |grep Console". If you parse this line
C> you may get every Information you want.

It doesn't tell the current mode, only the one used to boot.  If I change
modes with SVGATextMode, I still get the old mode.
--

Albert Cahalan

 
 
 

proposal for /proc/vidinfo

Post by Darren J Moff » Wed, 26 Apr 1995 04:00:00




>C> : I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44" :
>C> if that's what I boot up in (as a minimum), and that it be updated : upon
>C> each change of video mode.
>C> Hi, what do you think about "dmesg |grep Console". If you parse this line
>C> you may get every Information you want.
>It doesn't tell the current mode, only the one used to boot.  If I change
>modes with SVGATextMode, I still get the old mode.

I could also be usefull if information about the video card could be
made available their.  ie the info from SVGAlib.
eg. cat /proc/vidinfo

Bootmode    color EGA 80x25
Currentmode color VGA 80x60
VideoCard   Cirrus Logic 5424
VideoRAM    1024k
.....

--
Darren J Moffat                               20 Southpark Ave

URL:   http://www.dcs.gla.ac.uk/~moffatd      G12 8HZ  Tel: 041-334-5902

 
 
 

proposal for /proc/vidinfo

Post by Raymond A. Bail » Wed, 26 Apr 1995 04:00:00




> : Is there any elegant way I can retrieve the video mode the system is
> : booted in right after bootup, other than grepping kmsg?

> : I propose /proc/vidinfo, containing for example "color\nEGA+\n132x44"
> : if that's what I boot up in (as a minimum), and that it be updated
> : upon each change of video mode.

> Hi,
> what do you think about "dmesg |grep Console". If you parse this line
> you may get every Information you want.

> Carsten

> --

 It would also be _reeeeally_ nice if there were some way to reset the console
either with some console key combination, or perhaps from a remote root login.
I think the single most serious problem I've ever had with Linux was when
experimenting with SVGAlib, XFree, or SVGATextmode, I sometimes lose video
and/or console keyboard, which makes it very inconvenient to keep the machine
up :)

  I realize a production server should probably be either headless, mono, or
not have an admin who likes SVGATextmode :)

--
/////////////////////////////////////
R. Andrew Bailey
Marshall University Computer Center
Unix and heavy equipment guy.
/////////////////////////////////////

 
 
 

proposal for /proc/vidinfo

Post by Andries Brouw » Wed, 26 Apr 1995 04:00:00



:  It would also be _reeeeally_ nice if there were some way to reset the console
: either with some console key combination, or perhaps from a remote root login.
: I think the single most serious problem I've ever had with Linux was when
: experimenting with SVGAlib, XFree, or SVGATextmode, I sometimes lose video
: and/or console keyboard, which makes it very inconvenient to keep the machine
: up :)

If the problem is that the video hardware is left in some strange state,
then often (but not always) the SVGAlib programs can be used to reset.
If the problem is that the console is left in raw scancode mode,
then a simple alias suffices (see the keyboard FAQ in kbd-0.90.tar.gz).

 
 
 

proposal for /proc/vidinfo

Post by Carsten Zimmerma » Thu, 27 Apr 1995 04:00:00



:  It would also be _reeeeally_ nice if there were some way to reset the console
: either with some console key combination, or perhaps from a remote root login.
: I think the single most serious problem I've ever had with Linux was when
: experimenting with SVGAlib, XFree, or SVGATextmode, I sometimes lose video
: and/or console keyboard, which makes it very inconvenient to keep the machine
: up :)

Yes, i totally agree. I've made the same experiences and had to connect the
keyboard to my other box to start a remote seesion _without_ a monitor.
I think i've heard that somebody developed a solution that enables a proper
shutdown by using the gameport or even the trigger of the joystick.
If it is possible to get back video/keyboard control one could use a
similar solution.

:   I realize a production server should probably be either headless, mono, or
: not have an admin who likes SVGATextmode :)

In the moment i also would exclude Svgalib. That causes most problems.

Carsten

--
*****************************************************************************

*Zimmermann      *                                   *  Loesung ...   "     *

 
 
 

proposal for /proc/vidinfo

Post by Teeceep » Fri, 28 Apr 1995 04:00:00


: Pardon my ignorance, but how do you get a PC-based Linux box to operate
: headless?  I didn't think you could even boot without a video card
: of some kind in the box.  I'd love to be able to run some Linux-based
: servers using a serial port as console.  Is this possible?

My AMI BIOS has a video setting for VGA/PGA/EGA, Color 80x25, Monochrome,
Color 40x25 and Not Installed. You want the last one.

--
Jean

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
         Jean Aggenbach                        ___________
     Cape Town, South Africa                /\/           \   / \

  --------===:Linux:===--------          --------===:2004:===--------
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

 
 
 

proposal for /proc/vidinfo

Post by Jurgen Bo » Fri, 28 Apr 1995 04:00:00




Quote:>  I realize a production server should probably be either headless, mono, or
>not have an admin who likes SVGATextmode :)

Pardon my ignorance, but how do you get a PC-based Linux box to operate
headless?  I didn't think you could even boot without a video card
of some kind in the box.  I'd love to be able to run some Linux-based
servers using a serial port as console.  Is this possible?
 
 
 

proposal for /proc/vidinfo

Post by Werner Almesberg » Sat, 29 Apr 1995 04:00:00




> Pardon my ignorance, but how do you get a PC-based Linux box to operate
> headless?  I didn't think you could even boot without a video card
> of some kind in the box.

Even if you can, I'd still leave some video board in the machine. If
the system fails really badly (e.g. config RAM corruption), it's
easier to connect a CRT and a keyboard to fix it than to open it,
add a video board you've never used before, risk running into some
stupid other problems, etc. Low-end VGA boards are essentially for
free these days.

Quote:> I'd love to be able to run some Linux-based
> servers using a serial port as console.  Is this possible?

Yup, I'm using such a configuration since a few weeks on two PCs who
get lots of printks. It seems to work. What you need are a kernel
patch (for printk) and a few minor config changes:

 - link /dev/console to /dev/ttySwhatever
 - change inittab to start a getty on that device (useful if the net
   fails)
 - add something like  serial=1,9600  and  append="scon=0x02f8"  to
   your /etc/lilo.conf

I've attached a patch that should do the trick (it's extracted from
a larger patch, so maybe some parts have to be applied manually)
with some recent kernel. But don't tell Ted about it ... ;-)

- Werner

---------------------------------- cut here -----------------------------------

--- ref/arch/i386/config.in     Tue Mar  7 15:25:26 1995

 #if [ "$CONFIG_M586" = "n" ]; then
 bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
 #fi
+bool 'Serial console support' CONFIG_SERIAL_CONSOLE y

 comment 'Loadable module support'
 bool 'Set version information on all symbols for modules' CONFIG_MODVERSIONS n
--- ref/drivers/char/console.c  Thu Mar 23 17:09:13 1995

        video_screen_size = video_num_lines * video_size_row;
 }

+
+#ifdef CONFIG_SERIAL_CONSOLE
+
+
+static unsigned long tty_base = 0;
+
+
+static void put_scon(char ch)
+{
+       unsigned long flags;
+
+       while (1) {
+               while (!(inb_p(tty_base+5) & 0x20));
+               save_flags(flags);
+               cli();
+               if (inb_p(tty_base+5) & 0x20) break;
+               restore_flags(flags);
+       }
+       outb_p(ch,tty_base);
+       restore_flags(flags);
+}
+
+
+static void print_scon(const char *str)
+{
+       if (!tty_base) return;
+       while (*str) {
+               if (*str == '\n') put_scon('\r');
+               put_scon(*str++);
+       }
+}
+
+
+void serial_console_setup(char *str,int *ints)
+{
+       if (ints[0] != 1) return;
+       tty_base = ints[1];
+}
+
+
+#endif
+
+
 /*
  *  long con_init(long);

                display_desc,
                video_num_columns,video_num_lines,
                MIN_NR_CONSOLES, (MIN_NR_CONSOLES == 1) ? "" : "s", MAX_NR_CONSOLES);
+#ifdef CONFIG_SERIAL_CONSOLE
+       if (tty_base) {
+           register_console(print_scon);
+           return kmem_start;
+       }
+#endif
        register_console(console_print);
        return kmem_start;
 }
--- ref/init/main.c     Fri Feb 24 15:41:01 1995

 extern void sonycd535_setup(char *str, int *ints);
 #endif CONFIG_CDU535
 void ramdisk_setup(char *str, int *ints);
+#ifdef CONFIG_SERIAL_CONSOLE
+void serial_console_setup(char *str,int *ints);
+#endif

 #ifdef CONFIG_SYSVIPC

 #ifdef CONFIG_CDU31A
        { "cdu31a=", cdu31a_setup },
 #endif CONFIG_CDU31A
+#ifdef CONFIG_SERIAL_CONSOLE
+       { "scon=", serial_console_setup },
+#endif
        { 0, 0 }
 };

--
  _________________________________________________________________________

/_IN_R_311__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/