Hardware Reference
In-Depth Information
of the warts and idiosyncracies with which real hardware is so richly endowed.
Among the devices modeled are off-chip caches, timers, I/O buses, interrupt con-
trollers, and DMA controllers. By exposing these to the rest of the operating sys-
tem in idealized form, it becomes easier to port Windows 7 to other hardware plat-
forms, since most of the modifications required are concentrated in one place.
System Library Kernel User-mode Dispatch Routines
User mode
Kernel mode
NTOS
Kernel
layer
Trap/exception/interrupt dispatch
CPU scheduling and synchronization, threads
Drivers
Procs and threads
Virtual memory
Object manager
Config manager
File systems,
volume manager,
TCP/IP stack,
net interfaces
graphics devices,
all other devices
Local Proc. Calls
Cache manager
I/O manager
Security monitor
Executive run-time library
NTOS Executive layer
Hardware Abstraction Layer
Hardware
CPU, MMU, Interrupt Controllers, Memory, Physical Devices, BIOS
Figure 6-32. The structure of Windows 7.
Above the HAL, the code is divided into two major parts, the NTOS executive
and the Windows drivers , which includes the file systems, networking, and graph-
ics code. On top of that is the kernel layer. All of this code runs in protected ker-
nel mode.
The executive manages the fundamental abstractions used in Windows 7, in-
cluding threads, processes, virtual memory, kernel objects, and configurations.
Also here are the managers for local procedure calls, the file cache, I/O, and secu-
rity.
The kernel layer handles trap and exception handling, as well as scheduling
and synchronization.
Outside the kernel are the user programs and the system library used to inter-
face to the operating system. In contrast to UNIX systems, Microsoft does not
encourage user programs to make direct system calls. Instead they are expected to
call procedures in the library. To provide standardization across different versions
of Windows (e.g., XP, Vista, and Windows 7), Microsoft defined a set of calls cal-
led the Win32 API ( Application Programming Interface ). These are library
procedures that either make system calls to get the work done, or, in some case, do
the work right in the user-space library procedure. Although many Windows 7 li-
brary calls have been added since Win32 was defined, these are the core calls and
it is them we will focus on. Later, when Windows was ported to 64-bit machines,
 
 
Search WWH ::




Custom Search