Re: GGI, EGCS/PGCC, Kernel source

Jason McMullan (jmcc@pepsi.visus.com)
2 Mar 1998 11:20:08 GMT


Theodore Y. Ts'o <tytso@MIT.EDU> wrote with confidence:

> I note the Brave New GGI world description you defined doesn't contain
> the word "tty" in it at all. Could you explain how EvStack interacts
> with the tty system, please? Granted in the case of X, it wouldn't
> interact with the tty layer except through the xterm program opening a
> pty, but in the case of VT consoles you have to directly interact with
> the tty later, or else be totally incompatible with the rest of the
> Linux world....

Sorry to omit that:

tty layer interaction:

/dev/tty[0-63]'s VT driver (drivers/char/console.c)
is replaced by a new VT driver (drivers/console/console.c)
that under stands multi-headed displays. There is a
`default VT' (ie /dev/tty0) for each head, with a total
of 16 heads w/15 VTs/head available on the `sister' /dev/vty
device.

The new tty driver allows for different `console modes'
(#rows/#cols/fontsize, etc) for each VT, and provides the
`character injection system' (console_vt_stuff([s]tring,[c]har))
for the EvStack stacks that provide (say) XTerm emulation.

The only modification to the drivers/char/tty_io.c are to
a) no longer use fg_console (we use console_head_get_active_vt()),
b) #ifdef out some char/console.c specific code we don't use and
c) rename console_init termios_init

I have attached the revelevant diffs to drivers/char/tty_io.c
(sorry, Xterm cut/paste, you'll need to tell patch to ignore spaces)

------------- tty_io.c diffs --------------------------------
diff --recursive -u linux-2.1.x/drivers/char/tty_io.c linux-2.1.x-ggi/drivers/ch
ar/tty_io.c
--- linux-2.1.x/drivers/char/tty_io.c Wed Dec 31 19:40:08 1997
+++ linux-2.1.x-ggi/drivers/char/tty_io.c Wed Feb 18 01:38:21 1998
@@ -51,6 +51,9 @@
*
* Rewrote init_dev and release_dev to eliminate races.
* -- Bill Hawes <whawes@star.net>, June 97
+ *
+ * Integrated in the GGI console system
+ * -- Jason McMullan <jmcc@ontv.com>, Oct 97
*/

#include <linux/config.h>
@@ -80,9 +83,13 @@
#include <asm/system.h>
#include <asm/bitops.h>

+#ifdef CONFIG_GGI
+#include <ggi/console.h>
+#else
#include <linux/kbd_kern.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
+#endif

#ifdef CONFIG_KERNELD
#include <linux/kerneld.h>
@@ -1189,7 +1196,17 @@
}
#ifdef CONFIG_VT
if (device == CONSOLE_DEV) {
+#ifdef CONFIG_GGI
+ int curr_vt = console_head_get_active_vt(0);
+ int fg_console;
+
+ if (curr_vt < 0) {
+ curr_vt=0;
+ }
+ fg_console=MK_CONSOLE_ID(0, curr_vt);
+#else
extern int fg_console;
+#endif
device = MKDEV(TTY_MAJOR, fg_console + 1);
noctty = 1;
}
@@ -1621,7 +1638,7 @@
return put_user(tty->ldisc.num, (int *) arg);
case TIOCSETD:
return tiocsetd(tty, (int *) arg);
-#ifdef CONFIG_VT
+#if defined(CONFIG_VT) && !defined(CONFIG_GGI)
case TIOCLINUX:
return tioclinux(tty, arg);
#endif
@@ -1895,12 +1912,12 @@


/*
- * Initialize the console device. This is called *early*, so
+ * Initialize the termios structs. This is called *early*, so
* we can't necessarily depend on lots of kernel help here.
* Just do some early initializations, and do the complex setup
* later.
*/
-long console_init(long kmem_start, long kmem_end)
+long termios_init(long kmem_start, long kmem_end)
{
/* Setup the default TTY line discipline. */
memset(ldiscs, 0, sizeof(ldiscs));
@@ -1923,7 +1940,11 @@
* inform about problems etc..
*/
#ifdef CONFIG_VT
+# ifdef CONFIG_GGI
+ kmem_start = kgi_printk_init(kmem_start, kmem_end);
+# else
kmem_start = con_init(kmem_start);
+# endif
#endif
#ifdef CONFIG_SERIAL_CONSOLE
kmem_start = serial_console_init(kmem_start, kmem_end);
@@ -1974,7 +1995,6 @@
if (tty_register_driver(&dev_syscons_driver))
panic("Couldn't register /dev/console driver\n");

-#ifdef CONFIG_VT
dev_console_driver = dev_tty_driver;
dev_console_driver.driver_name = "/dev/tty0";
dev_console_driver.name = dev_console_driver.driver_name + 5;
@@ -1985,6 +2005,7 @@
if (tty_register_driver(&dev_console_driver))
panic("Couldn't register /dev/tty0 driver\n");

+#ifndef CONFIG_GGI
kbd_init();
#endif
#ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */
@@ -2018,7 +2039,7 @@
specialix_init();
#endif
pty_init();
-#ifdef CONFIG_VT
+#ifdef CONFIG_VT_VCS
vcs_init();
#endif
return 0;

-- 
Jason McMullan - Linux - GGI - http://pepsi.visus.com/~jmcc
NT 5.0 is the last nail in the Unix coffin. Interestingly, Unix
isn't in the coffin... It's wondering what the heck is sealing 
itself into a wooden box 6 feet underground... 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu