Native Apps and Virtual Memory

Microsoft’s documentation says:

“However, if CHKDSK is scheduled to run when the computer restarts, the
binary module that contains the verification code is Autochk.exe, a native
Windows program. Because Autochk.exe runs early in the computer’s startup
sequence, Autochk.exe does not have the benefit of virtual memory or of
other Win32 services.”

the link is: http://support.microsoft.com/kb/314835

http:Do they really mean Virtual memory
or Paging? I can understand paging, as that is now a page file defragger
will work too, but VM is supposed to be up long before ‘the native’s march
in’ :slight_smile: right?



- amitr0</http:>

Right.

I don’t know WHAT they mean. As written, the statement is definitely incorrect.

Peter
OSR

I suspect the system volume may be mounted as read only at that time, thus a page file may not be created and writing to a page file may be disabled. Thus, size of available virtual memory can’t exceed physical memory.

It’s read/write, but there is no page file, as smss hasn’t created it yet
(because it hasn’t run either).

mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: Tuesday, March 01, 2011 10:16 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Native Apps and Virtual Memory

I suspect the system volume may be mounted as read only at that time, thus a
page file may not be created and writing to a page file may be disabled.
Thus, size of available virtual memory can’t exceed physical memory.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>I don’t know WHAT they mean. As written, the statement is definitely incorrect.

The way I understood it, what they say here is that Win32 subsystem services, including VM functions that are exported by kernel32.dlll, are unavailable to native applications- ntdll.dll is the only thing available to them. If this is what they are saying, then they are correct…

Anton Bassov

If that’s what they’re saying, it’s a tautology. Native applications NEVER have access to Win32 subsystem services. Because they’re native applications.

Peter
OSR

I understand it as Autochk.exe is launched by the boot loader (in real mode
or flat mode?) before the kernel and the VM/paging subsystem is setup. It
does make sense as you don’t want the VM using a pagefile on an inconsistent
file system at the risk of loosing data.
I think the confusion is “native api”, I believe they mean direct Bios
access to disk instead?

J.

“amitr0” wrote in message news:xxxxx@ntdev…
Microsoft’s documentation says:

“However, if CHKDSK is scheduled to run when the computer restarts, the
binary module that contains the verification code is Autochk.exe, a native
Windows program. Because Autochk.exe runs early in the computer’s startup
sequence, Autochk.exe does not have the benefit of virtual memory or of
other Win32 services.”

the link is: http://support.microsoft.com/kb/314835

Do they really mean Virtual memory or Paging? I can understand paging, as
that is now a page file defragger will work too, but VM is supposed to be up
long before ‘the native’s march in’ :slight_smile: right?



- amitr0

Nope, it’s through whatever HBA driver is usually loaded. No INT21h(DOS FS)
or INT13h(DOS block dev). It means that the Win32 subsystem isn’t
available, just the NTDLL on which Win32 is built.

Philip D. Barila??? (303) 776-1264

Also, during CHKDSK the system volume may be completely unmounted, to allow direct write access. Which also precludes any possibility of paging.

Grigora,

are you sure about the unmount? I sort of remember seeing it being mounted
and locked, we had a volume filter and we had device events configured on
it. IIRC, this was with winxp, might have changed with vista?

thanks

amit

On Wed, Mar 2, 2011 at 3:50 AM, wrote:

> Also, during CHKDSK the system volume may be completely unmounted, to allow
> direct write access. Which also precludes any possibility of paging.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>



- amitr0

>
It’s read/write, but there is no page file, as smss hasn’t created it yet
(because it hasn’t run either).

Smss is the one which looks for bootexecute value in Session Manager key and
runs the native apps listed there (including autochk).
Smss has ran already, it’s after this step, it enables pagefile to be used
as backing store (In processor terms, paging has already been enabled, hence
virtual memory services also has already been started)

-Deepak

On Wed, Mar 2, 2011 at 2:01 PM, amitr0 wrote:

> Grigora,
>
> are you sure about the unmount? I sort of remember seeing it being mounted
> and locked, we had a volume filter and we had device events configured on
> it. IIRC, this was with winxp, might have changed with vista?
>
>
AFAIK, it gets locked

>Autochk.exe is launched by the boot loader (in real mode
or flat mode?)

No, it is in protected mode and not by the boot loader.

It does make sense as you don’t want the VM using a pagefile on an
inconsistent
file system at the risk of loosing data.

VM is up, but page file assess is not enabled yet. I believe page file
access is started by SMSS right after native apps are done running. This is
how page file defragmenter works.

I think the confusion is “native api”, I believe they mean direct Bios
access to disk instead?

No, native APIs are system calls in Windows, and Win32 is built over them.
Native calls are exported by the NTOSKernel…

On Sun, Feb 27, 2011 at 3:20 AM, jerome wrote:

> I understand it as Autochk.exe is launched by the boot loader (in real mode
> or flat mode?) before the kernel and the VM/paging subsystem is setup. It
> does make sense as you don’t want the VM using a pagefile on an
> inconsistent
> file system at the risk of loosing data.
> I think the confusion is “native api”, I believe they mean direct Bios
> access to disk instead?
>
> J.
>
>
> “amitr0” wrote in message news:xxxxx@ntdev…
> Microsoft’s documentation says:
>
>
> “However, if CHKDSK is scheduled to run when the computer restarts, the
> binary module that contains the verification code is Autochk.exe, a native
> Windows program. Because Autochk.exe runs early in the computer’s startup
> sequence, Autochk.exe does not have the benefit of virtual memory or of
> other Win32 services.”
>
>
> the link is: http://support.microsoft.com/kb/314835
>
>
>
>
> Do they really mean Virtual memory or Paging? I can understand paging, as
> that is now a page file defragger will work too, but VM is supposed to be
> up
> long before ‘the native’s march in’ :slight_smile: right?
>
> –
>
> - amitr0
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>



- amitr0

Thanks Deepak, amitr0. So Autochk memory footprint must be monitored closely
as what you’re saying is that page eviction is not effective at this stage.
Now with common 4G mem everywhere I suspect this is not a problem but on a
very damage FS with much fewer memory config or on a mobile, it may ?

J.

“Deepak Gupta” wrote in message news:xxxxx@ntdev…
<>
It’s read/write, but there is no page file, as smss hasn’t created it yet
(because it hasn’t run either).
>

Smss is the one which looks for bootexecute value in Session Manager key and
runs the native apps listed there (including autochk).
Smss has ran already, it’s after this step, it enables pagefile to be used
as backing store (In processor terms, paging has already been enabled, hence
virtual memory services also has already been started)

-Deepak

On Wed, Mar 2, 2011 at 2:01 PM, amitr0 wrote:

Grigora,

are you sure about the unmount? I sort of remember seeing it being mounted
and locked, we had a volume filter and we had device events configured on
it. IIRC, this was with winxp, might have changed with vista?

AFAIK, it gets locked

That early in boot phase there not any processes loaded other than Smss.exe
and bootexecute listed one’s.
Moreover size of kernel modules is also not going to be much taken all
together (Probably 100 MB).
Also Smss and bootexecute native apps also will occupy memory for their own
image and shared ntdll image, nothing else.
Apart from this memory required by all these components. Most of the drivers
don’t have much memory usage until unless app starts doing I/Os.

I beleive that’s one of the various parameter on which Windows suggests what
should be the minimum memoy configurations for Windows to run.

-Deepak

On Thu, Mar 3, 2011 at 5:52 PM, jerome wrote:

> Thanks Deepak, amitr0. So Autochk memory footprint must be monitored
> closely
> as what you’re saying is that page eviction is not effective at this stage.
> Now with common 4G mem everywhere I suspect this is not a problem but on a
> very damage FS with much fewer memory config or on a mobile, it may ?
>
> J.
>
> “Deepak Gupta” wrote in message news:xxxxx@ntdev.
> …
> <>
> It’s read/write, but there is no page file, as smss hasn’t created it yet
> (because it hasn’t run either).
> >
>
> Smss is the one which looks for bootexecute value in Session Manager key
> and
> runs the native apps listed there (including autochk).
> Smss has ran already, it’s after this step, it enables pagefile to be used
> as backing store (In processor terms, paging has already been enabled,
> hence
> virtual memory services also has already been started)
>
> -Deepak
>
>
> On Wed, Mar 2, 2011 at 2:01 PM, amitr0 wrote:
>
> Grigora,
>
>
> are you sure about the unmount? I sort of remember seeing it being mounted
> and locked, we had a volume filter and we had device events configured on
> it. IIRC, this was with winxp, might have changed with vista?
>
>
>
> AFAIK, it gets locked
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>