Page 337 - DCAP103_Principle of operating system
P. 337

Principles of Operating Systems



                   Notes         Devices  are  referred  by their logical  addresses.  The  HAL  also  implements  software  scatter/
                                 gather (writing or reading from noncontiguous blocks of physical memory).
                                 The HAL also manages clocks and timers in a portable way. Time is kept track of in units of
                                 100 nsec starting at 1 January 1901, which is far more precise than MS-DOS’s keeping track of
                                 time in units of 2 sec since 1 January 1980 and provides support for the many computer-related
                                 activities in the 17th, 18th, and 19th centuries. The time services decouple the drivers from the
                                 actual frequencies at which the clocks run.

                                 Kernel components sometimes need to synchronize at a very low level, especially to prevent
                                 race conditions in multiprocessor systems. The HAL provides some primitives to manage this
                                 synchronization,  such  as  spin  locks,  in  which  one  CPU  simply  waits  for  a  resource  held  by
                                 another CPU to be released, particularly in situations where the resource is typically only held
                                 for a few machine instructions.

                                 Finally, after the system has been booted, the HAL talks to the BIOS and inspects the CMOS
                                 configuration memory, if any, to find out which buses and I/O devices the system contains and
                                 how they have been configured. This information is then put into the registry so other system
                                 components can look it up without having to understand how the BIOS or configuration memory
                                 work. A summary of some of the things the HAL does is given in Figure 11.2.
                                 Since the HAL is highly-machine dependent, it must match the system it is installed on perfectly,
                                 so a variety of HALs are provided on the Windows 2000 CD-ROM. At system installation time,
                                 the appropriate one is selected and copied to the system directory \winNT\system32 on the
                                 hard disk as hal.dll. All subsequent boots use this version of the HAL. Removing this file will
                                 make the system unbootable.
                                 Although the HAL is reasonably efficient, for multimedia applications, it may not be fast enough.
                                 For this reason, Microsoft also produced a software package called DirectX, which augments
                                 the HAL with additional procedures and allows user processes much more direct access to the
                                 hardware. DirectX is somewhat specialized, so we will not discuss it further in this unit.


                                             Figure 11.2: Some of the Hardware Functions the HAL Manages




















                                                Hardware refers to a physical piece of a computer. This could be a hard drive,
                                                monitor, memory chip, or CPU. The key idea is that the item is something
                                                you can touch.








        330                               LOVELY PROFESSIONAL UNIVERSITY
   332   333   334   335   336   337   338   339   340   341   342