Page 365 - DCAP103_Principle of operating system
P. 365

Principles of Operating Systems



                   Notes            2.  Each process contains at least ...................... .
                                       (  a)  one thread               (b)  two threads
                                       (  c)  four threads             (d)  none of these.
                                     3.  A thread normally runs in ...................... .
                                       (  a)  User mode                (b)  Safe mode.
                                       (  c)  both (a) and (b)         (d)  None of these
                                    4.  A semaphore is created using the ...................... API function.
                                       (  a)  APISemaphore             (b)  CreateSemaphore
                                       (  c)  WaitSemaphore            (d)  None of these
                                 12.2 Booting Windows 2000


                                 Before Windows 2000 can start up, it must be booted. The boot process creates the initial processes
                                 that bring up the system. In this section, we will briefly discuss how the boot process works for
                                 Windows 2000. This short assembly language program reads the partition table to see which
                                 partition contains the bootable operating system. When it finds the operating system partition,
                                 it reads in the first sector of that partition, called the boot sector, and jumps to it. The program
                                 in the boot sector reads its partition’s root directory, searching for a file called ntldr (another
                                 piece of archaeological evidence that Windows 2000 is really NT). If it finds that file, it reads
                                 the file into memory and executes it. Ntldr loads Windows 2000. As an aside, there are several
                                 versions of the boot sector, depending on whether the partition is formatted as FAT-16, FAT-32,
                                 or NTFS. When Windows 2000 is installed, the correct version of the master boot record and
                                 boot sector are written to disk.
                                 Ntldr now reads a file called Boot.ini, which is the only configuration information not in the
                                 registry. It lists all the versions of hal.dll and ntoskrnl.exe available for booting in this partition.
                                 The file also provides many parameters, such as how many CPUs and how much RAM to use,
                                 whether to give user processes 2 GB or 3 GB, and what rate to set the real-time clock to. Ntldr
                                 then  selects  and  loads hal.dll  and  ntoskrnl.exe  files  as  well  as  bootvid.dll,  the  default  video
                                 driver for writing on the display during the boot process. Ntldr next reads the registry to find
                                 out which drivers are needed to complete the boot (e.g., the keyboard and mouse drivers, but
                                 also dozens more for controlling various chips on the parentboard). Finally, it reads in all these
                                 drivers and passes control to ntoskrnl.exe.
                                 Once started, the operating system does some general initialization and then calls the executive
                                 components to do their own initialization. For example, the object manager prepares its name
                                 space to allow other components call it to insert their objects into the name space. Many
                                 components also do specific things related to their function, such as the memory manager setting
                                 up the initial page tables and the plug-and-play manager finding out which I/O devices are
                                 present and loading their drivers. All in all, dozens of steps are involved, during which time
                                 the progress bar displayed on the screen is growing in length as steps are completed. The last
                                 step is creating the first true user process, the session manager, smss.exe. Once this process is
                                 started and running, booting is completed.
                                 The session manager is a native Windows 2000 process. It makes true system calls and does not
                                 use the Win32 environment subsystem, which is not even running yet. In fact, one of its first
                                 duties is to start it (csrss.exe). It also reads the registry hives from disk and learns what else it is
                                 supposed to do. Typically its work includes entering many objects in the object manager’s name
                                 space, creating any extra paging files needed, and opening important DLLs to have them around
                                 all the time. After it has done most of this work, it creates the login daemon, winlogon.exe.
                                 At this point, the operating system is up and running. Now it is time to get the service processes
                                 (user  space  daemons)  going  on  and  allow  users  to  log  in.  Winlogon.exe  first  creates  the
                                 authentication manager (lsass.exe), and then the parent process of all the services (services.exe).
                                 The latter looks in the registry to find out which user space daemon processes are needed and
                                 what files they are in. It then starts creating them. The fact that the disk is generally being heavily


        358                               LOVELY PROFESSIONAL UNIVERSITY
   360   361   362   363   364   365   366   367   368   369   370