windows NT的一个重要概念:object:the data structure manipulated by OS,including
注意,有个object叫做section,他是在内存中的数据的一种抽象,包括DLL,EXE,还有在内存中的文件。
每个对象有handler,security descriptor.
不像UNIX一样分散的命名object,在NT中,有统一的命名引用管理,就是object manager.
programming windows vista
我们知道,windows不是开源的,所以我们的编程其实不是跟kernel-mode层次交互,而是跟native NT API层次交互。但是,windows支持若干不同风格的编程,包括windows风格和POSIX标准,所以实际上,为了支持多种风格,windows分别构筑了不同的subsystem,当然,一般情况下我们打交道的是win32的subsystem,实际上,win32API是对native NT API的包装。
Win32API提供的服务既有高层的又有底层的,而作为研究操作系统的书,主要着眼于包装native NT API的win32API。另外,程序员可见的还有配置信息,即registry.
另外,NT用很多用户态的subsystem process来提供操作系统的服务.
system structure
1.HAL
to hide machine dependencies for portability.
2.NTOS kernel layer:synchronization for control object and dispatcher object.
control object includes thread,interrupt,timer,and DPC,APC.
DPC:Deferred procedure call(用来处理ISR(interrupt service routine))
APC:Asynchronous Precedure call:比DPC粒度更小,which operates in the context of specific thread.
dispatcher object:semaphore,mutex,events......
进程和线程:在UNIX,process is the unit of concurrency;在NT,process is container for sharing memory and object resources,and thread is the unit of concurrency for scheduling.
IPC:
NT有Remote Procedure Call:let process A to have process B call a procedure in B's address space on A's behalf and return the result to A.
inter-thread synchronization(与linux不同,因为linux的同步是在进程间)。
NT特有机制是event.
Memory Management
Segmentation is not supported in any form.
Caching Management(注意,是OS层面的软cache,不是硬件的cache)引入概念view.
I/O:在windowsNT,除了设备驱动,文件系统,网络协议栈,也是以驱动的形式实现。
I/O操作的请求是通过IRP(I/O REQUEST PACKET)
NTFS:不同于UNIX FS的一个文件是一个字节流,NTFS把一个文件看做若干字节流。
NTFS提供用户透明的压缩解压缩。




没有评论:
发表评论