Windows NT internals refer to the inner workings of the Windows NT operating system. It includes the system architecture, critical data, and how the system is organized.
2. WINDOWS NT AND
OBJECTIVES
• Design of NT object-based
• Kernel and Execute modules define
• Driver is allowed to access some object
fields and access functions
• I/O Manager objects are partially opaque
to a driver
3. NT Objects Win 32 Objects
• No external visible names
• Not managed by Object
Manager
• Use pointer to the
Object body
• Visible names
• Managed by
Object Manager
• Use Handles to the
Object body
4. I/O REQUEST PACKETS
• I/O packet driver in NT
• IRPs are data structures which contains
work order
5. OPERATIONS OF IRPS
• User specifies some function
• I/O Manager allocates IRP from non
paged system memory
• IRP is passed to driver dispatch routine
• Dispatch routine passes IRP to driver’s start
I/O routine
• Start I/O routine uses contents of the IRP
and sets up device operation
• On operation completion, Dpc For lsr
routine stores final status code in IRP and
sends it back to I/O Manager
• I/O Manager sends the user final status
6. LAYOUT OF IRP
IO Status
Major Function;
Minor function;
Union { Struct{} Read;
Struct{}Write;
Struct{}Device located;
}parameters
IRP
IO-STATUS-BLOCK
Status;
Information;
IO-STACK-LOCATION
Two sections in IRP
•Header area containing book keeping information
•One or more parameter blocks called I/O stack
locations
7. IRP HEADER
• IO status- holds final status of the I/O
operation
Status field-STATUS XXX value
Information fiels- 0(error)
value(no.of bites
transferred)
8. I/O STACK LOCATIONS
• Major functions- hold function code(IRP-MJ-XXX
function)
• Minor function- used by file system and SCSI
drivers
• Parameters- Operation to perform
Struct Read-parameters for IRP-MJ-READ
Struct Write- parameters for IRP-MJ-WRITE
Struct Device IO control- parameters for IRP-MJ-
DEVICE-CONTROL and IRP-MJ-INTERNAL-DEVICE-
CONTROL
9. DRIVER OBJECT
• A catalog that contains pointers to various
driver functions
10. OPERATION OF DRIVER
OBJECT
• I/O Manager creates Driver Object
• Driver Entry routine loads pointer to other
driver functions
• I/O Manager uses associated dispatch
routine of Driver Object
• I/O Manager uses Driver Object to locate
the driver’s start I/O routine
• I/O Manager deletes the Driver Objects
• I/O Manager uses Driver Object to find
unload routine
12. DEVICE OBJECTS AND
DEVICE EXTENSIONS
• Keep information about a device’s
characteristics and state
• One device object for each virtual, logical,
and physical device on the system
13. OPERATION OF DEVICE
OBJECTS
• Driver Entry routine creates a Device Object
• I/O Manager uses a pointer in the Device
Object to locate corresponding Driver Object
•Driver routines use the Device Object to
locate corresponding Device Extension
•Driver’s Unload routine deletes the Device
Object
14. LAYOUT OF DEVICE OBJECT
Driver Object
Pending
IRP
Pending
IRP
Device Object
Next Device
Flags
Driver Object
Current lrp
Device
Extension
Device Queue
Object
Current
IRP
Device
Extension
15. DEVICE EXTENSION
• Used to hold any information associated with
a particular device
• Block of non=paged pool that the I/O Manager
attaches to Device object
17. CONTROLLER AND CONTROLLER
EXTENSIONS
• A token that can be owned by only one
device at a time
Operation of Controller Objects
• Driver Entry routine creates controller object and stores its
address in Device Extension
• Start I/O asks for exclusive ownership of controller object
• I/O Manager grants ownerships and calls controller control routine
which starts I/O operation
• After completion of device operation, driver’s Dpc For lsr routine
releases the controller object
• Unload routine deletes the controller object
19. ADAPTER OBJECTS
• Used to prevent arguments over DMA hardware
• One Adapter Object for each DMA data transfer channel
• Manage mapping registers used to map scattered physical pages
of a user’s buffer onto contiguous range of address
Operations on Adapter Objects
• HAL creates Adapter Objects for all DMA channels detected
at bootsteap time
• Driver Entry routine locates the Adapter Object and stores
pointers in the Device or Controller Extension
• Start I/O routine requests owner ship of Adapter Object
• I/O Manager calls the drivers Adapter Control routine
• Dpc For lsr routine releases the Adapter Object
21. INTERRUPT OBJECTS
• Give the Kernel’s interrupt dispatcher a
way to find right ISR
Operation of Interrupt Object
Driver Entry routine creates Interrupt
Object
Kernel’s interrupt dispatcher locates
the ISR
Unload routine deletes the Interrupt
Object
22. LAYOUT OF AN INTERRUPT
OBJECT
Device or
Controller
Extension
Interrupt Ptr
Interrupt
Object
Interrupt
Service
Routine