Page 380 - DCAP103_Principle of operating system
P. 380

Unit 13: Input/Output and Security of Windows



            The I/O manager is also closely connected with the power manager. The power manager can   Notes
            put the computer into any of six states, roughly described as:
               1.  Fully operational.

               2.  Sleep 1: CPU power reduced, RAM and cache on; instant wake-up.

               3.  Sleep 2: CPU and RAM on; CPU cache off; continue from current PC.

               4.  Sleep 3: CPU and cache off; RAM on; restart from fixed address.
               5.  Hibernate: CPU, cache, and RAM off; restart from saved disk file.

               6.  Off: Everything off; full reboot required.

            I/O devices can also be in various power states. Turning them on and off is handled by the
            power manager and I/O manager together. Note that states 2 through 6 are only used when
            the CPU has been idle for a shorter or longer time interval.

            Somewhat surprisingly, all the file systems are technically I/O drivers. Requests for data blocks
            from user processes are initially sent to the cache manager. If the cache manager cannot satisfy
            the request from the cache, it has the I/O manager call the proper file system driver to go and
            get the block it needs from disk.
            An interesting feature of Windows 2000 is its support for dynamic disks. These disks may span
            multiple partitions and even multiple disks and may be reconfigured on the fly, without even
            having to reboot. In this way, logical volumes are no longer constrained to a single partition or
            even a single disk so that a single file system may span multiple drives in a transparent way.
            Another interesting aspect of Windows 2000 is its support for asynchronous I/O. It is possible for a
            thread to start an I/O operation and then continue executing in parallel with the I/O. This feature
            is especially important on servers. There are various ways the thread can find out that the I/O has
            completed. One is to specify an event object at the time the call is made and then wait on it eventually.
            Another is to specify a queue to which a completion event will be posted by the system when the
            I/O is done. A third is to provide a callback procedure that the system calls when the I/O has
            completed.
            13.1.2 Input/Output API Calls

            Windows 2000 has over 100 separate APIs for a wide variety of I/O devices, including mice,
            sound cards, telephones, tape drives, etc. Probably the most important is the graphics system,
            for which there are thousands of Win32 API calls. We began our discussion with the Window
            graphical system. Here we will continue, mentioning a few of the Win32 API categories, each
            of which has many calls. A brief summary of the categories are given in Figure 13.1.

            Win32 calls exist to create, destroy, and manage windows. Windows have a vast number of
            styles and options that can be specified, including titles, borders, colours, sizes, and scroll bars.
            Windows can be fixed or movable, of constant size or resizable. Their properties can be queried
            and messages can be sent to them.
            Many windows contain menus, so there are Win32 calls for creating and deleting menus and
            menu bars. Dynamic menus can be popped up and removed. Menu items can be highlighted,
            dimmed out, or cascaded.



                                             LOVELY PROFESSIONAL UNIVERSITY                                   373
   375   376   377   378   379   380   381   382   383   384   385