Annotation of driverkit/notes/lono_driver_config, revision 1.1

1.1     ! root        1:                lono driver config internals
        !             2:                
        !             3: * IODeviceDescription has new ivar, IOConfigTable *configTable.
        !             4: 
        !             5: * In kernel, IOConfigTable's _private ivar merely points to a char array
        !             6:   which consists of the contents of a device instance file. 
        !             7:   
        !             8: * kern_dev.dconf, a dev_conf_t, will become a pointer to IODeviceDescription.
        !             9:   (Note that nrw should probably do this too). For now, kern_dev will 
        !            10:   have both.
        !            11:   
        !            12: * Kernel IOConfigTable will use the routines in config_table.c to parse 
        !            13:   the config table text.
        !            14:   
        !            15: * There's a static copy of the *current system config table" in 
        !            16:   KERNBOOTSTRUCT. That's what is returned in _IOGetSystemConfig().
        !            17:   
        !            18: * boot sequence
        !            19: {
        !            20:        booter writes KERNBOOTSTRUCT to ??somewhere??
        !            21:        kernel comes up, eventually calls:
        !            22:        autoconf() {
        !            23:                registerIndirClasses(); // registers SCSIDisk, etc. 
        !            24:                probeNativeDevices();   // see below
        !            25:                probeHardware();        // nop on i386
        !            26:                probeDirectDevices();   // nop on i386
        !            27:                probePseudoDevices();   // starts up EventDriver, etc.
        !            28:        }
        !            29:   
        !            30:        /* 
        !            31:         * At this time, kernel can access boot device (at least).
        !            32:         * rc starts running; driverLoader starts up and does the rest of this.
        !            33:         */
        !            34:        for each device in System config's "Boot Drivers" list {
        !            35:                for each instance > 0 {
        !            36:                        /*
        !            37:                         * Booter only loads in instance 0.
        !            38:                         */
        !            39:                        IOLoadDevice();
        !            40:                }
        !            41:        }
        !            42:      
        !            43:        for each driver in System config's "Active Drivers" list {
        !            44:                if there's a .o {
        !            45:                        kern_load it;
        !            46:                }
        !            47:                for each instance {
        !            48:                        IOLoadDevice();
        !            49:                }
        !            50:        }
        !            51: }
        !            52: 
        !            53: /*
        !            54:  * This is the kernel's routine which configures and probes the boot 
        !            55:  * device and possibly additional drivers which either the booter passes 
        !            56:  * in config table info for, or which have statically declared config 
        !            57:  * tables.
        !            58:  */
        !            59: probeNativeDevices() {
        !            60:        for each config table passed in from booter {
        !            61:                create an IODeviceDescription;
        !            62:                probe the associated driver;
        !            63:        }
        !            64:        for each statically configured device {
        !            65:                /*
        !            66:                 * This is temporary, for internal development only 
        !            67:                 */
        !            68:                create an IODeviceDescription;
        !            69:                probe the associated driver;
        !            70:        }
        !            71: }
        !            72: 
        !            73: .......................
        !            74: 
        !            75: call graph in autoconfg_i386
        !            76: 
        !            77: IOProbeDriver
        !            78:        configureThread
        !            79:                configureDriver
        !            80:                        configTableToClassName (config_table.c)
        !            81:                        configureDriverClass
        !            82:                        
        !            83: probeNativeDevices
        !            84:        configureDriver
        !            85:                configDataToClassName() (config_table.c)
        !            86:                configureDriverClass
        !            87: 
        !            88: probePseudoDevices
        !            89:        probeClass
        !            90:                configureDriverClass
        !            91:                
        !            92: configureDriverClass
        !            93:        configDataToDev()       (config_table.c)
        !            94:        [IOEISADeviceDescription _initFromKernDev:]
        !            95:        [devDesc setConfigTable:]
        !            96:        [devDesc setDevicePort:];
        !            97:        [devDesc setDeviceMaster:];
        !            98:        [IODevice addLoadedClass];
        !            99:        
        !           100: .....................
        !           101: functions to keep in autoconf_i386
        !           102: 
        !           103: /* called by MI probePseudoDevices() */
        !           104: BOOL probeClass(port_name_t deviceMasterUport,
        !           105:        IODeviceNumber devNum,
        !           106:        const char *className,
        !           107:        IODeviceDescription **deviceDescP);     
        !           108: 
        !           109: /* 
        !           110:  * Called from MD probeNativeDevices() and from configureThread(), the
        !           111:  * IOTask version of IOProbeDriver().
        !           112:  */
        !           113: static BOOL configureDriver(const char *configData, port_t deviceMaster);
        !           114: 
        !           115: /*
        !           116:  * Given a class name and an IOConfigTable,
        !           117:  * create a kern_dev and an IODeviceDescription and probe the class. 
        !           118:  * This is used both at boot time - for the boot device and (temporarily) 
        !           119:  * any native drivers with static config tables - and by IOProbeDriver().
        !           120:  */
        !           121: static BOOL configureDriverClass(const char *className, 
        !           122:        IOConfigTable *configData, 
        !           123:        port_t deviceMaster);
        !           124: 
        !           125: 
        !           126: 
        !           127: ......................
        !           128: to do (2 Feb 93)
        !           129: 
        !           130: * add pointer to IODeviceDescription to kern_dev_t. DONE
        !           131: * when creating kern_dev, also create IODeviceDescription if valid 
        !           132:   IOConfigTable exists. DONE
        !           133: * Move relevant stuff from configTable.c to IOEISADeviceDescription.
        !           134: * configureDriverClass() should take an (IOConfigTable *) instead of
        !           135:   char *configData. 

unix.superglobalmegacorp.com

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