Annotation of OSKit-Mach/oskit/ds_osenv.c, revision 1.1

1.1     ! root        1: #include "ds_oskit.h"
        !             2: 
        !             3: #include <oskit/dev/dev.h>
        !             4: #include <oskit/dev/linux.h>
        !             5: #include <oskit/dev/osenv_irq.h>
        !             6: #include <oskit/dev/osenv_intr.h>
        !             7: #include <oskit/dev/osenv_sleep.h>
        !             8: #include <oskit/c/stdlib.h>
        !             9: 
        !            10: #include <oskit/c/termios.h>
        !            11: #include <oskit/tty.h>
        !            12: 
        !            13: oskit_osenv_t *mach_osenv;
        !            14: 
        !            15: extern int serial_console;     /* base_console_init.c */
        !            16: 
        !            17: oskit_stream_t *ds_console_stream;
        !            18: 
        !            19: extern int console_irq;                /* kludge in osenv_irq.c */
        !            20: 
        !            21: 
        !            22: void
        !            23: ds_osenv_init (void)
        !            24: {
        !            25:   oskit_error_t rc;
        !            26: 
        !            27:   mach_osenv = oskit_osenv_create_default ();
        !            28: 
        !            29:   kmsg_init ();
        !            30: 
        !            31:   oskit_dev_init (mach_osenv);
        !            32: 
        !            33:   if (getenv ("BOGUS_CONSOLE"))
        !            34:     {
        !            35:       extern oskit_stream_t *console;
        !            36:       ds_console_stream = console;
        !            37:       printf("using bogus console!\n");
        !            38:       rc = 0;
        !            39:     }
        !            40:   else if (serial_console)
        !            41:     {
        !            42:       oskit_osenv_intr_t *intr = oskit_create_osenv_intr ();
        !            43:       char *p = getenv ("COM_CONS");
        !            44:       int port = p ? atoi(p) : 1;
        !            45:       struct termios param = base_cooked_termios;
        !            46:       param.c_lflag &= ~ECHO;
        !            47:       param.c_iflag &= ~ICRNL;
        !            48:       param.c_oflag &= ~OPOST;
        !            49:       console_irq = -1;
        !            50:       rc = cq_com_console_init (port, &param,
        !            51:                                oskit_create_osenv_irq (),
        !            52:                                intr,
        !            53:                                oskit_create_osenv_sleep (intr),
        !            54:                                &ds_console_stream);
        !            55:     }
        !            56:   else
        !            57:     {
        !            58:       oskit_osenv_intr_t *intr = oskit_create_osenv_intr ();
        !            59:       console_irq = -1;
        !            60:       rc = cq_direct_console_init (oskit_create_osenv_irq (),
        !            61:                                   intr,
        !            62:                                   oskit_create_osenv_sleep (intr),
        !            63:                                   &ds_console_stream);
        !            64:     }
        !            65:   if (rc)
        !            66:     panic ("cannot create interrupt-driven console stream: %x\n", rc);
        !            67: 
        !            68:   oskit_linux_init_osenv (mach_osenv);
        !            69:   oskit_linux_init_devs ();
        !            70: 
        !            71: #ifdef HAVE_I8042
        !            72:   oskit_dev_init_i8042 ();
        !            73: #endif
        !            74: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.