开发者

How do the Windows DDK samples deal with being paged out? I don't see much code dealing with it in the samples

How come the Windows DDK samples do n开发者_运维技巧ot deal with being paged out? Are they non-pageable?


Pageable code is marked with #pragma code_seg("PAGE"). That's why the drivers are not dealing with paging. They are by default all non-pagable.


Not speaking specifically of Windows drivers, but only for device drivers in general:

Don't have large drivers.

Don't do that much work in kernel mode and certainly don't do that much work at high interrupt priority levels. Do only what's needed at these levels, then delegate the rest of the work to code that runs at the lowest level (0).


Paged code is wrapped by #pragma code_seg("PAGExxx"), paged data by #pragma data_seg("PAGExxx"). It's also possible to specify paged functions (only c-linkage) with #pragma alloc_text. Classes can also be paged by using declspec(allocate()) starting with WDK 8. There is also an API to lock and unlock pages in memory, allowing runtime control. See more here: http://social.msdn.microsoft.com/Forums/en-US/wdk/thread/ba75e766-6a8f-4fe8-9d03-b69be85655d9

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜