struct tty_table[] - where is it? - Minix

This is a discussion on struct tty_table[] - where is it? - Minix ; comp.os.minix struct tty_table[] - where is it? In Minix 2.0.2, the structure tty_table[] is referenced in consol.c, keyboard.c & a few others (see below). Nowhere, in the space in or above the directory usr, is it declared. Must be hiding ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: struct tty_table[] - where is it?

  1. struct tty_table[] - where is it?

    comp.os.minix
    struct tty_table[] - where is it?

    In Minix 2.0.2, the structure tty_table[] is referenced in consol.c,
    keyboard.c & a few others (see below). Nowhere, in the space in or above the
    directory usr, is it declared. Must be hiding -- anyone know where?

    Many thanks, Hul


    /usr/src/kernel/console.c: line = tp - &tty_table[0];
    /usr/src/kernel/keyboard.c: tty_table[current].tty_events = 1;
    /usr/src/kernel/keyboard.c: tp = &tty_table[current]; /* always use
    the current console */
    /usr/src/kernel/keyboard.c: case CF7: sigchar(&tty_table[CONSOLE], SIGQUIT);
    break;
    /usr/src/kernel/keyboard.c: case CF8: sigchar(&tty_table[CONSOLE], SIGINT);
    break;
    /usr/src/kernel/keyboard.c: case CF9: sigchar(&tty_table[CONSOLE], SIGKILL);
    break;
    /usr/src/kernel/pty.c: line = tp - &tty_table[NR_CONS + NR_RS_LINES];
    /usr/src/kernel/rs232.c: line = tp - &tty_table[NR_CONS];
    /usr/src/kernel/tty.c:#define tty_addr(line) (&tty_table[line])
    /usr/src/kernel/tty.c:#define END_TTY tty_addr(sizeof(tty_table) /
    sizeof(tty_table[0]))
    /usr/src/kernel/tty.h:EXTERN tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];
    /usr/wrk/findbst.sh:find /usr -type f | xargs grep "tty_table" >/crap

     

  2. Re: struct tty_table[] - where is it?

    Hul Tytus wrote:
    > comp.os.minix
    > struct tty_table[] - where is it?
    >
    > In Minix 2.0.2, the structure tty_table[] is referenced in consol.c,
    > keyboard.c & a few others (see below). Nowhere, in the space in or above the
    > directory usr, is it declared. Must be hiding -- anyone know where?


    /usr/src/kernel/tty.h:EXTERN tty_t
    tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];

    When tty.h is included by table.c EXTERN is defined as a null string

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  3. Re: struct tty_table[] - where is it?


    Hul Tytus writes:

    > comp.os.minix
    > struct tty_table[] - where is it?
    >
    > In Minix 2.0.2, the structure tty_table[] is referenced in consol.c,
    > keyboard.c & a few others (see below). Nowhere, in the space in or above the
    > directory usr, is it declared. Must be hiding -- anyone know where?


    Yep. Look here:

    > /usr/src/kernel/tty.h:EXTERN tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];


    This declares tty_table as array of tty_t (note: It's not a struct as
    I'd have expected from the other code snippets you posted and from the
    name. But where is it defined?

    I thought I remembered that OSDI/1 explained how some games with the
    EXTERN macro are played to use the same header file for declaration
    and for definition. Unfortunately I can't find that text in my copy of
    OSDI/1 nor in OSDI/2 in a hurry. Maybe I were mistaken. Nonetheless,
    what I remmber is, that there should be one .c file which includes
    tty.h (possibly indirectly) and #undef-ines EXTERN before, thus making
    the line above from a declaration into a definition.

    Regards -- Markus








  4. Re: struct tty_table[] - where is it?

    Markus - Giovanni marked it's location.

    Hul

    M E Leypold wrote:
    :
    : Hul Tytus writes:
    :
    :> comp.os.minix
    :> struct tty_table[] - where is it?
    :>
    :> In Minix 2.0.2, the structure tty_table[] is referenced in consol.c,
    :> keyboard.c & a few others (see below). Nowhere, in the space in or above the
    :> directory usr, is it declared. Must be hiding -- anyone know where?
    :
    : Yep. Look here:
    :
    :> /usr/src/kernel/tty.h:EXTERN tty_t tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];
    :
    : This declares tty_table as array of tty_t (note: It's not a struct as
    : I'd have expected from the other code snippets you posted and from the
    : name. But where is it defined?
    :
    : I thought I remembered that OSDI/1 explained how some games with the
    : EXTERN macro are played to use the same header file for declaration
    : and for definition. Unfortunately I can't find that text in my copy of
    : OSDI/1 nor in OSDI/2 in a hurry. Maybe I were mistaken. Nonetheless,
    : what I remmber is, that there should be one .c file which includes
    : tty.h (possibly indirectly) and #undef-ines EXTERN before, thus making
    : the line above from a declaration into a definition.
    :
    : Regards -- Markus
    :
    :
    :
    :
    :
    :
    :

    --
    - for email, put the word "keeper" in the subject line -

  5. Re: struct tty_table[] - where is it?

    Thanks Giovanni. I appreciate your insight.

    Hul


    Giovanni wrote:
    : Hul Tytus wrote:
    :> comp.os.minix
    :> struct tty_table[] - where is it?
    :>
    :> In Minix 2.0.2, the structure tty_table[] is referenced in consol.c,
    :> keyboard.c & a few others (see below). Nowhere, in the space in or above the
    :> directory usr, is it declared. Must be hiding -- anyone know where?
    :
    : /usr/src/kernel/tty.h:EXTERN tty_t
    : tty_table[NR_CONS+NR_RS_LINES+NR_PTYS];
    :
    : When tty.h is included by table.c EXTERN is defined as a null string
    :
    : Ciao
    : Giovanni

    --
    - for email, put the word "keeper" in the subject line -

  6. Re: struct tty_table[] - where is it?


    Hul Tytus writes:

    > : I thought I remembered that OSDI/1 explained how some games with the
    > : EXTERN macro are played to use the same header file for declaration
    > : and for definition. Unfortunately I can't find that text in my copy of
    > : OSDI/1 nor in OSDI/2 in a hurry. Maybe I were mistaken. Nonetheless,
    > : what I remmber is, that there should be one .c file which includes
    > : tty.h (possibly indirectly) and #undef-ines EXTERN before, thus making
    > : the line above from a declaration into a definition.


    > Markus - Giovanni marked it's location.


    I still wonder where from I had that information originally: Certainly
    I didn't have it from reading table.c.

    BTW: Could you consider not to (full-) quote the previous posters text
    *below* your answer? I had to edit your mail to put the pieces in the
    right order so the result made sense. Else, it would have looked like
    this:

    I still wonder where from I had that information originally: Certainly
    I didn't have it from reading table.c.

    > Markus - Giovanni marked it's location.


    > : I thought I remembered that OSDI/1 explained how some games with the
    > : EXTERN macro are played to use the same header file for declaration
    > : and for definition. Unfortunately I can't find that text in my copy of
    > : OSDI/1 nor in OSDI/2 in a hurry. Maybe I were mistaken. Nonetheless,
    > : what I remmber is, that there should be one .c file which includes
    > : tty.h (possibly indirectly) and #undef-ines EXTERN before, thus making
    > : the line above from a declaration into a definition.



    I think you can see the problem. -- Regards -- Markus


+ Reply to Thread