|
|
|
Modern Operating Systems by Herbert Bos and Andrew S. Tanenb...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf
Showing 933-934 out of 1137
Modern Operating Systems by Herbert Bos and Andrew...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Modern Operating Systems by Herbert...
Modern_Operating_Systems_by_Herbert_Bos_and_Andrew_S._Tanenbaum_4th_Ed.pdf-M ODERN O PERATING S YSTEMS
Page 933
902
CASE STUDY 2: WINDOWS 8
CHAP. 11
NtCreateFile( \??\C:\ foo\ bar)
IoCallDriver
IRP
File system filters
Win32 CreateFile(C:\ foo\ bar)
OpenObjectByName( \??\C:\ foo\ bar)
I/O
manager
I/O
manager
Object
manager
IopParseDevice(DeviceObject,\ foo\ bar)
C: s Device stack
NTFS
NtfsCreateFile()
(5)
IoCallDriver
IoCompleteRequest
User mode
Kernel mode
\
(a)
(b)
(1)
Devices
??
C:
Harddisk1
SYMLINK:
\Devices\Harddisk1
DEVICE OBJECT:
for C: Volume
(2)
(3)
(4)
(6)
(7)
(8)
(9)
(10)
(5)
Handle
File
object
Figure 11-20.
I/O and object manager steps for creating/opening a file and get-
ting back a file handle.
2. The object manager searches through directories and symbolic links
and ultimately finds that
\ ?? \ C:
refers to a device object (a type de-
fined by the I/O manager).
The device object is a leaf node in the part
of the NT namespace that the object manager manages.
3. The object manager then calls the
Parse
procedure for this object
type, which happens to be
IopParseDevice
implemented by the I/O
manager.
It passes not only a pointer to the device object it found (for
C:
), but also the remaining string
\ foo \ bar
.
4.
The I/O manager will create an
IRP
(
I/O Request Packet
), allocate a
file object, and send the request to the stack of I/O devices determined
by the device object found by the object manager.
5.
The IRP is passed down the I/O stack until it reaches a device object
representing the file-system instance for
C:
.
At each stage, control is
passed to an entry point into the driver object associated with the de-
vice object at that level. The entry point used here is for CREATE
operations, since the request is to create or open a file named
\ foo \ bar
on the volume.
Page 934
SEC. 11.3
SYSTEM STRUCTURE
903
6.
The device objects encountered as the IRP heads toward the file sys-
tem represent file-system filter drivers, which may modify the I/O op-
eration before it reaches the file-system device object.
Typically
these intermediate devices represent system extensions like antivirus
filters.
7.
The file-system device object has a link to the file-system driver ob-
ject, say NTFS.
So, the driver object contains the address of the
CREATE operation within NTFS.
8. NTFS will fill in the file object and return it to the I/O manager,
which returns back up through all the devices on the stack until
Iop-
ParseDevice
returns to the object manager (see Sec. 11.8).
9. The object manager is finished with its namespace lookup.
It re-
ceived back an initialized object from the
Parse
routine (which hap-
pens to be a file object—not the original device object it found).
So
the object manager creates a handle for the file object in the handle
table of the current process, and returns the handle to its caller.
10.
The final step is to return back to the user-mode caller, which in this
example is the Win32 API
CreateFile
, which will return the handle to
the application.
Executive components can create new types dynamically, by calling the
ObCreateObjectType
interface to the object manager.
There is no definitive list of
object types and they change from release to release.
Some of the more common
ones in Windows are listed in Fig. 11-21. Let us briefly go over the object types in
the figure.
Process and thread are obvious. There is one object for every process and
every thread, which holds the main properties needed to manage the process or
thread. The next three objects, semaphore, mutex, and event, all deal with
interprocess synchronization.
Semaphores and mutexes work as expected, but with
various extra bells and whistles (e.g., maximum values and timeouts).
Events can
be in one of two states: signaled or nonsignaled.
If a thread waits on an event that
is in signaled state, the thread is released immediately.
If the event is in nonsig-
naled state, it blocks until some other thread signals the event, which releases ei-
ther all blocked threads (notification events) or just the first blocked thread (syn-
chronization events). An event can also be set up so that after a signal has been
successfully waited for, it will automatically revert to the nonsignaled state, rather
than staying in the signaled state.
Port, timer, and queue objects also relate to communication and synchroniza-
tion. Ports are channels between processes for exchanging LPC messages.
Timers
Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
Operating_Systems
Course:
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades
Students also viewed documents
lab 18.docx
lab_18.docx
Course
Course
3
Module5QuizSTA2023.d...
Module5QuizSTA2023.docx.docx
Course
Course
10
Week 7 Test Math302....
Week_7_Test_Math302.docx.docx
Course
Course
30
Chapter 1 Assigment ...
Chapter_1_Assigment_Questions.docx.docx
Course
Course
5
Week 4 tests.docx.do...
Week_4_tests.docx.docx
Course
Course
23
Week 6 tests.docx.do...
Week_6_tests.docx.docx
Course
Course
106