Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Making an application non-pageable

1 view
Skip to first unread message

Tom K

unread,
Aug 19, 2008, 3:18:02 PM8/19/08
to
Hi

I was wondering if there is a way to tell the kernel to not page a specific
application.

I have read this article:
http://blogs.msdn.com/ce_base/archive/2008/01/19/Paging-and-the-Windows-CE-Paging-Pool.aspx

And, it suggests a method for making all applications non-pageable or a
method for making a section or sections of a specific application
non-pageable.

I have tried the first method, but I find that the system memory consumption
is too high.

The second method may be acceptable, but I would perfer to make the entire
application non-pageable instead of doing this by sections.

Is there a method for doing this?

Thank you,

Tom

C.L

unread,
Aug 19, 2008, 10:02:08 PM8/19/08
to
You can set the 'M' flag of the binary image builder (.bib) file to force
your application into an non-pageable mode.

for example,
app.exe $(_FLATRELEASEDIR)\app.exe NK SHM

For the section non-pageable, you can refer to the codes below.

/***************************************/
#pragma comment(linker, "/section:.no_page,ER!P")
#pragma code_seg(push, ".no_page")
XXX_PowerDown()
{ //Perform single-threaded power off logic }
XXX_PowerUp()
{ //Perform single-threaded power on logic }
#pragma code_seg(pop)
/***************************************/

Tom K

unread,
Aug 20, 2008, 10:04:02 AM8/20/08
to
Thanks for the tip about the bib file, but unfortunately that method won't do
either. We build and release our kernel seperately from the applications
that actually run on our platform. Updating the kernel in our device is not
easy (and extremely time consuming).

Is there another way of telling the system to not page an exe? Perhaps a
registry entry that tells the loader to not page?

C.L

unread,
Aug 20, 2008, 11:58:05 PM8/20/08
to
Do you have the source codes of the application?
If yes, you can add the pre-compile instructions as below to make your
application non-pageable.

#pragma comment(linker, "/section:.no_page,ER!P")
#pragma code_seg(push, ".no_page")

/// Application source codes.
#pragma code_seg(pop)

Tom K

unread,
Aug 26, 2008, 2:13:09 PM8/26/08
to
I guess the pragma method is the only way. I do have the source, but I was
hoping to avoid doing this as the source is spread across many files.

Thanks for the help.

Tom K

unread,
Aug 26, 2008, 2:15:02 PM8/26/08
to
Also, another thought just occurred to me...

If the process that I am trying to make non-pageable calls code in a dll
then how can I guarantee that that code is not paged?

I assume that the answer is to recompile any dlls that the process uses as
well?

Paul G. Tobey [eMVP]

unread,
Aug 26, 2008, 2:39:34 PM8/26/08
to
You can load a DLL using LoadDriver, rather than LoadLibrary, and that will
assure that you can make it non-pageable. In fact, that's what I'd do for
the whole problem. Have the application EXE be only stuff that can be
paged. Load DLLs for everything else.

By the way, I don't see where you told us what version of CE we're talking
about...

Paul T.

"Tom K" <To...@discussions.microsoft.com> wrote in message
news:30B561C2-C4AE-4C68...@microsoft.com...

0 new messages