Annotation of driverkit/Examples/KStub/README.rtf, revision 1.1

1.1     ! root        1: {\rtf0\ansi{\fonttbl\f0\fmodern Courier;\f1\fmodern Ohlfs;}
        !             2: \paperw13040
        !             3: \paperh9540
        !             4: \margl120
        !             5: \margr120
        !             6: \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b0\i0\ulnone\fs24\fc0\cf0 This directory contains a simple pseudo device driver, called IOStub, with the following characteristics:\
        !             7: 
        !             8: \pard\tx1152\tx2304\tx3456\tx4608\tx5760\tx6912\tx8064\tx9216\tx10368\tx11520\fc0\cf0 \
        !             9: 
        !            10: \fi-440\li1160 �       The IOStub driver is loaded into a running kernel using the kern_loader.\
        !            11: \
        !            12: �      IOStub is a subclass of the standard driverkit disk object, 
        !            13: \b IODiskDevice
        !            14: \b0 . The Objectice C interface to the IOStub device is defined by the 
        !            15: \b DiskDeviceRw
        !            16: \b0  protocol.\
        !            17: \
        !            18: �      The interface to the driver from User space is just like a disk driver's interface; i.e., via read()s and writes()s on a node in /dev/. \
        !            19: \
        !            20: �      The driver does not do any actual I/O; instead, it maintains a region of kernel memory. Writes to the device merely write to this region of memory; reads from the device return portions of this memory. \
        !            21: \
        !            22: �      This driver also provides an example of an implementation of an 
        !            23: \b I/O thread
        !            24: \b0 ; exported methods pass along I/O requests to the I/O thread. All I/O is single threaded via this mechanism. \
        !            25: \
        !            26: \
        !            27: 
        !            28: \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc0\cf0 The driver is comprised of the following files:\
        !            29: \
        !            30: 
        !            31: \b\fi-440\li1160 IOStubKernLoad.m
        !            32: \b0  \
        !            33: \
        !            34:        This file contains functions which are invoked by the kern_loader at load and unload time. The only significant operations performed here are loading the driver's cdevsw and bdevsw structs into the system's cdevsw and bdevsw array, and calling the IOStub's stubProbe method. \
        !            35:        \
        !            36: 
        !            37: \b IOStubUnix.m
        !            38: \b0  \
        !            39: \
        !            40:        This file basically maps Unix-style devsw and bdevsw callouts into Objective C method calls which are sent to the IOStub device. \
        !            41:        \
        !            42: 
        !            43: \b IOStub.m\
        !            44: 
        !            45: \b0 \
        !            46:        Implementation of exported methods. The methods which perform actual I/O (readAt:length:buffer:pending:, etc.) merely create I/O requests in the form of an IOBuf and pass them to the I/O thread via the enqueueIoBuf: method. Asynchronous requests (which all requests from the IOStubUnix module currently are) result in I/O complete via the kernel's diskIoComplete:status:bytesXfr: method, which is called by the I/O thread.\
        !            47:        \
        !            48: 
        !            49: \b IOStubThread.m
        !            50: \b0 \
        !            51: \
        !            52:        The I/O thread (
        !            53: \b IOStub_thread()
        !            54: \b0 ) and its associated methods.\
        !            55:        
        !            56: }

unix.superglobalmegacorp.com

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