Help - Search - Members - Calendar
Full Version: Autoramresizer & Xp Sp2
The CD Forum > Bart's PE Builder > Troubleshooting
EmKay
Topic is question: Why does AutoRamResizer not work with PE build from XP SP2 files?

Any ideas?

EmKay
paraglider
It does but you need to make sure the eventlog service does not start as it locks the drive.
EmKay
How to do that?
I start AutoRamResizer in the XPE-custom (didn't change the existing entry), so that ARR is one of the first Apps to start.
I thought it started before anything else...
paraglider
If you are using the RunOnceEx keys then those keys are processed by explorer when it is starting so it is not the first thing that runs.

Change these lines in xpe-mmc.inf:

[SetupReg.AddReg]
0x4,"ControlSet001\Services\EventSystem","Start",0x3

to

0x4,"ControlSet001\Services\EventSystem","Start",0x4

That changes it from manual start to disabled. This means the eventlog service will never start which may or may not be a good thing.

The other thing to try is to change:

0x4,"ControlSet001\Services\winmgmt","Start",0x2

to

0x4,"ControlSet001\Services\winmgmt","Start",0x3

Winmgmt is an autostart service which depends on the EventLog service so when it starts it will start the EventLog service. Changing it to manual means you should start the service with

net start winmgmt

after doing the resize. There has been plenty of topics on resizing the ram in XPE recently. Just do a search on AutoRamResizer.
Loisi
QUOTE (paraglider @ Apr 1 2004, 01:24 PM)
If you are using the RunOnceEx keys then those keys are processed by explorer when it is starting so it is not the first thing that runs.

Change these lines in xpe-mmc.inf:

[SetupReg.AddReg]
0x4,"ControlSet001\Services\EventSystem","Start",0x3

to

0x4,"ControlSet001\Services\EventSystem","Start",0x4

That changes it from manual start to disabled. This means the eventlog service will never start which may or may not be a good thing.

The other thing to try is to change:

0x4,"ControlSet001\Services\winmgmt","Start",0x2

to

0x4,"ControlSet001\Services\winmgmt","Start",0x3

Winmgmt is an autostart service which depends on the EventLog service so when it starts it will start the EventLog service. Changing it to manual means you should start the service with

net start winmgmt

after doing the resize. There has been plenty of topics on resizing the ram in XPE recently. Just do a search on AutoRamResizer.

@paraglider
I changed xpe-mmc.inf, but ramresize won't work. it seems, that ramdrive is not empty when autoramresizer starts. can you help?
Loisi
paraglider
It works for me with both nu2menu and screenlock as the shell. If nu2menu is the shell make sure you resize the ram at the beginining of autorun.cmd. Make sure you run it with:

start /wait autoramresizer.exe

If you are using xpelogon or explorer as your shell then instead use my shellexecuteprogram as the shell and run a script that contains:

start /wait autoramresizer.exe
start xpelogon.exe

Details are on my website ( www.paraglidernc.com )
markav
@paraglider

I'm running XPE 0.9.6 w/ XP SP2 RC2 + the latest RamDisk and AutoRamResizer Plugins.

I tried your suggestions and went so far as to disable all services except RPC and PlugPlay... still no luck getting autoramresizer to work. I modified my login script to launch into a cmd shell so I could manually debug before XPE initializes and made some interesting observations:

CODE
0x1,"Setup","CmdLine","ShellExecute.exe -s -h logon.cmd"


Case 1:
  • The explorer.exe process is running and the Profile Dirs have been created on the ramdrive
  • The ProfileDirs contain files locked by explorer that can't be deleted (ex. index.dat in the History folder).
  • Explorer can't be killed to remove the locks or everything dies
  • AutoRamResizer can't delete anything so fails with (code 32)
Case 2:
I disabled (commented out) the following registry entries that define the user profiles. This allowed me to boot to a cmd shell with a clean ramdrive (0 files/0 dirs).
CODE
;0x2, "ControlSet001\Control\Session Manager\Environment", "USERPROFILE", "%RAMDRV%\@ProfilesDir@\Default User"
;0x2, "ControlSet001\Control\Session Manager\Environment", "ProfilesDir", "%RAMDRV%\@ProfilesDir@"
;0x2,"Microsoft\Windows NT\CurrentVersion\ProfileList","ProfilesDirectory","%RAMDRV%\@ProfilesDir@"
  • Explorer is running (Why?)
  • The ramdrive is still locked. AutoRamResizer fails (code 32)
  • I killed each running process one by one (except explorer) and tested AutoRamResizer after each kill. Each test failed until the system eventually blue screened on csrss.exe.
  • This seems to point to explorer as the culprit as in case 1
Case 3:
I moved my init script from login to XPE RunOnceEx, tried the same tests and got the same exact results.
CODE
0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\100","001","||xpeinit.exe -f -m ""Init XPE Startup"" initxpe.cmd"


The question of the day is "why is the explorer process running?" According to Sherpya's notes in xpe-custom.inf, the RunOnceEx\100","001" call should happen before explorer starts and before any dll registrations happen. No such luck.

Am I mssing something here?
paraglider
I think my ShellExecute program is not working correctly. It uses the WIN32 API function ShellExecute to launch the process you specify on the command line. I think this function is starting explorer.

Within the next couple of hours I should have a version that uses CreateProcess instead.

For the moment if you change the shell to:

0x1,"Setup","CmdLine","cmd.exe /k logon.cmd"

then it should work.
paraglider
The updated version of ShellExecute ( 1.0.0.3 ) is available from my website. It works for me when used as the shell to launch an autorun.cmd command file with XPE 0.9.6:

start /wait autoramresizer.exe
xpelogon.exe
exit


The shell is set in xpe_custom.inf as :

[SetupReg.AddReg]
0x1, "Setup", "CmdLine", "\Programs\ShellExecute\ShellExecute.exe /h /s autorun.cmd"

Don't forget to comment out the autorun of the autoramresizer from the xpe_custom.inf
Loisi
QUOTE (paraglider @ May 1 2004, 03:03 PM)
The updated version of ShellExecute ( 1.0.0.3 ) is available from my website. It works for me when used as the shell to launch an autorun.cmd command file with XPE 0.9.6:

start /wait autoramresizer.exe
xpelogon.exe
exit


The shell is set in xpe_custom.inf as :

[SetupReg.AddReg]
0x1, "Setup", "CmdLine", "\Programs\ShellExecute\ShellExecute.exe /h /s autorun.cmd"

Don't forget to comment out the autorun of the autoramresizer from the xpe_custom.inf

@paraglider
you are the greatest!
Up to now I spent a lot of hours to get autoramsizer working-without success.
But using your ShellExecute autoramsizing works. I still use the former version, commented out autoramsizer and
[SetupReg.AddReg]
; Use explorer.exe as standalone shell called by XPELogon.exe
;0x1,"Setup","CmdLine","XPELogon.exe"
;0x1,"Setup","CmdLine","cmd.exe"
;0x1,"Setup","CmdLine","explorer.exe"
in xpe_custom.inf.
In my shellexecute.inf I included
0x1,"Setup","CmdLine","\Programs\ShellExecute\ShellExecute.exe /s /h autorun1-ramdisk.cmd".
Is it better to use the newer ShellExecute version?
Thank you for the great job!!
Loisi
markav
@paraglider

THAT'S IT!

Your new version of ShellExecute fixed the autoramresizer problem for XP SP2 RC2.

Thanks a million for cranking this fix out so quickly. Great job!

I am a happy camper now smile.gif
Mark
sherpya
XPE 0.9.7 will process RunOnceEx entries before starting explorer, but I think there are different problems with pre-sp2 since some stuff is broken also using rpc patch...
I'll updated xpe reg entries when sp2 will be released... anyway if someone has a patch for xpe that works with or without pre-sp2, I'll add it.
Konstanz
14September2010
Greetings.
I'm doing my first XPE builds.
I have (seemingly) almost all the details in place except setting the RAMdisk size.
AutoRamResizer says at bootup "RAMdisk size 256mb" then "RAMdisk size not changed",
but the RAMdisk is always 96mb when boot is finished.

I guess I need to run/use ShellExecute with
CODE
[SetupReg.AddReg]
; Use explorer.exe as standalone shell called by XPELogon.exe
0x1,"Setup","CmdLine",
    "\Programs\ShellExecute\ShellExecute.exe /s /h autorun.cmd"

In this example ShellExecute will run the command file autorun.cmd hidden and stay resident for ever also hidden.

The autorun command file should resize your ram and then start explorer:

start /wait AutoRamResizer.exe
start XPELogon.exe
exit
???


QUOTE (paraglider @ May 1 2004, 11:03 AM) *
The shell is set in xpe_custom.inf as :

[SetupReg.AddReg]
0x1, "Setup", "CmdLine", "\Programs\ShellExecute\ShellExecute.exe /h /s autorun.cmd"

Don't forget to comment out the autorun of the autoramresizer from the xpe_custom.inf


I do not find any autoramresizer autorun in xpe_custom.inf.
Do I need to rem out the RunOnceEx entry in the AutoRAMre.inf file?
What entry should be in the AutoRAMre.inf file to set the RAMdisk size?
My xpe-defaults.inf has
CODE
0x1,"SetUp","CmdLine","XPELogon.exe-r"

Do I need to rem out this entry?
Ed_P
It's not a autoramresizer problem, you need a different ramdriv.sys file. The default one that comes with PEBuilder only supports RAM drives up to 96MB.
Konstanz
I tried the ramdriv.sys (5.3.1.6) from UBCD4W 3.6 but XPE apparently does not create any RAMdisk at all with that file.
XPE bootup gives the same messages (created ... not changed ...) as when using ramdriv.sys (5.2.10.2) from BartPE but before bootup is finsihed says cannot create documents and settings on b: ...

Is there some trick to using the UBCD4W ramdriv.sys with BPE/XPE?
Otherwise where/how does one find a ramdriv.sys to create an XPE RAMdisk greater than 96mb?
I've been searching online of course ...

The example here»
http://www.collewijn.info/xpe/page/pebuilder_xpe.php
says, "we change the INF file to use a 128MB ram drive" and
makes no mention, anywhere, of a 96mb RAMdisk limit ...
It makes no mention of ramdriv.sys at all except to say that,
"you need also Ramdisk plugin active since this does only the resizing"
nuMe
This help: http://www.911cd.net/forums//index.php?s=&...ost&p=62220
mbarnes
Hi Konstanz

you cant just take the ramdriv.sys from ubcd4win and put it into BartPE

you need the whole ramdrive plugin as some registry settings are different.

There is also the licensing issue as ubcd4win has purchased a advanced ramdrive license for their project

If you only use BartPE it on modern PC's with say 1GB of RAM or more you could set ramdrive size to 256MB in ramdriv.inf and remove or disable ramdisk resize option

regards
Mike Barnes
Ed_P
There is also the IMdisk ramdisk plugin option: http://www.911cd.net/forums//index.php?sho...=imdisk+ramdisk (which has no licensing issues. thumbup.gif )
Konstanz
18September2010
Greetings ... et merci viel Mal ...
Something is not clear to me ...
XPE-deftaults.inf has the following entries/options»
CODE
; Swap file
; 0x7,"ControlSet001\Control\Session Manager\Memory Management","PagingFiles","NUL: 0 0"
; 0x7,"ControlSet001\Control\Session Manager\Memory Management","PagingFiles","B:\pagefile.sys 32 48"
and Paraglider has the SetPageFile plugin.
How does a PE pagefile function? Does it? What is the relationship between a PE pagefile and RAMdisk?
Should one set an XPE pagefile? with the inf file? or with SetPageFile?

There seem to be three ways to set the RAMdisk in XPE.
The RamDiskDiskSize="0x06000000" entry in the RAMdisk plugin;
CODE
; 0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\100","100","||xpeinit.exe -f -m ""Resize ramdrive"" %ComSpec% /c start /wait %SystemDrive%\Programs\RAMsize\RAMsize.cmd"
from the RAMsize plugin; and the AutoRAMresizer plugin.
After the RAMdisk is set during XPE boot, one can no longer reset the RAMdisk (like one can with RAMsize under non-XPE BPE ...)?
When I used the RAMsize RunOnce entry with UBCD4W's ramdriv.sys, I saw the "use with BartPE disapproved" message
before ramdriv.sys self destructed, so I guessed UBCD4W had a special arrangement with ramdriv.sys and
that some registry entries or something allowed ramdriv.sys to identify a BartPE boot ...
I suppose options 2 or 3 are useful when a BPE build is for many/unknown PC configurations?
What is the relationship between PC RAM and PE RAMdisk size? Why do low mem PCs require smaller RAMdisks?

I can't believe I never noticed my BPE ramdisks were never larger than 96mb.
I can't believe I've never encountered any documentation of this 96mb limit.
I need to take a look at the "IMdisk ramdisk plugin" ...
Ed_P
QUOTE (Konstanz @ Sep 18 2010, 07:52 AM) *
What is the relationship between PC RAM and PE RAMdisk size? Why do low mem PCs require smaller RAMdisks?

Are you serious?? blink.gif

Example: PC has 192MB of RAM, PE requires 150MB to run. RAMdisk max size = 192 - 150 = 42MB

PC has 192MB of RAM, PE requires 120MB to run. RAMdisk max size = 192 - 120 = 72MB

Low mem PC's don't "require" smaller RAMdisks, they simply don't have sufficient RAM to support larger ones.
Konstanz
Yeah, I have always thought the RAMdisk was a special PE pagefile -
for which the general (MS) rule is 1.5 times system RAM ...
I didn't know the RAMdisk was in physical RAM

I would still like to hear/know about the PE pagefile ...
Ed_P
QUOTE (Konstanz @ Sep 18 2010, 11:30 AM) *
I would still like to hear/know about the PE pagefile ...

Since that has nothing to do with this topic's title I suggest you start a new thread.
NLe
So I have been messing around with XPE RAM resizing.

As far as I can tell the following»
CODE
0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\100","100","||xpeinit.exe -f -m AutoRamResizer AutoRamResizer.exe -d 2 -l 80 -h 512"
should yield a RAMdisk of 512mb on a laptop with 1024 or RAM; however, the AutoResizedRAMdisk has never been 512 and
seems to be a different value each time - depending on how much "free RAM" exists when resized.
So the RAMdisk.inf value
CODE
RamDiskDiskSize="0xWhatever"
seems to make the AutoRAMresize calculation somewhat circular ...

Anyway, everytime XPE resizes at boot, XPE gives me a "not enough virtual memory" error message, which is quite annoying.
XPE gives me this error message even though it successfully resizes every time.
Is this normal?

There is also the RAMresizer plugin, which can be run at startup.
XPE gives that annoying error message even when I use the RAMresizer to (successfully) resize.
The decision then becomes use both? or one? or the other?
I changed the RAMresizer.inf entry»
CODE
0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\100","100","||xpeinit.exe -f -m ""Resize RAMdrive"" %ComSpec% /c start /wait %SystemDrive%\Programs\ramsize\RAMsize.cmd"
to
CODE
"Microsoft\Windows\CurrentVersion\RunOnceEx\101"
so I could run both - Auto first/before RAMresizer.

Seeing as how I can do without that annoying error message,
I disabled AutoRAMre; set RAMdisk to
CODE
RamDiskDiskSize="0x18000000"
; and tweaked the RAMresize.cmd»
CODE
@echo off
:: just a simple batch file
:: created by CWorks
:: 0x100000 = 1meg
:: 0x200000 = 2megs
:: 0x300000 = 3megs
:: 0x10000000 = 256megs
:: 0x18000000 = 384megs
:: 0x20000000 = 512megs
:: etc.. etc...
Title=[ Ram Disk ] Choose Size
ECHO ****** Warning everything on ramdrive will be lost ******
ECHO.
:Start
ECHO      A. Install 1 meg Ramdisk
ECHO      B. Install 4mb Ramdisk
ECHO      C. Install 8mb Ramdisk
ECHO      D. Install 16mb Ramdisk
ECHO      E. Install 32mb Ramdisk
ECHO      F. Install 48mb Ramdisk
ECHO      G. Install 64mb Ramdisk
ECHO      H. Install 80mb Ramdisk
ECHO      I. Install 96mb Ramdisk
ECHO      J. Install 128mb Ramdisk
ECHO      K. Install 160mb Ramdisk
ECHO      L. Install 192mb Ramdisk
ECHO      K. Install 224mb Ramdisk
ECHO      N. Install 256mb Ramdisk
ECHO      O. Install 384mb Ramdisk
ECHO      P. Install 512mb Ramdisk
ECHO      X. none of the above

SET errorlevel=
@rem SET Choice=
@rem SET /P Choice=Type Your Selection And Press Enter:
@rem IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
Echo.
CHOICE Give Your Selection (in 15 seconds): /c:ABCDEFGHIJKLMNOPX /N /T:x,15
Echo.
@rem Goto Bye
IF /I '%errorlevel%'=='1' Goto Item1
IF /I '%errorlevel%'=='2' Goto Item4
IF /I '%errorlevel%'=='3' Goto Item8
IF /I '%errorlevel%'=='4' Goto Item16
IF /I '%errorlevel%'=='5' Goto Item32
IF /I '%errorlevel%'=='6' Goto Item48
IF /I '%errorlevel%'=='7' Goto Item64
IF /I '%errorlevel%'=='8' Goto Item80
IF /I '%errorlevel%'=='9' Goto Item96
IF /I '%errorlevel%'=='10' Goto Item128
IF /I '%errorlevel%'=='11' Goto Item160
IF /I '%errorlevel%'=='12' Goto Item192
IF /I '%errorlevel%'=='13' Goto Item224
IF /I '%errorlevel%'=='14' Goto Item256
IF /I '%errorlevel%'=='15' Goto Item384
IF /I '%errorlevel%'=='16' Goto Item512
IF /I '%errorlevel%'=='17' Goto Bye

@rem Echo. "%Choice%" is not valid. Please try again.
Echo. "%errorlevel%" is not valid. Please try again.
Echo.
Goto Start

:Item1
ECHO      Installing 1 meg Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x100000
Goto End
:Item4
ECHO      Installing 4mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x400000
Goto End
:Item8
ECHO      Installing 8mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x800000
Goto End
:Item16
ECHO      Installing 16mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x1000000
Goto End
:Item32
ECHO      Installing 32mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x2000000
Goto End
:Item48
ECHO      Installing 48mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x3000000
Goto End
:Item64
ECHO      Installing 64mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x4000000
Goto End
:Item80
ECHO      Installing 80mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x5000000
Goto End
:Item96
ECHO      Installing 96mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x6000000
Goto End
:Item128
ECHO      Installing 128mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x8000000
Goto End
:Item160
ECHO      Installing 160mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0xa000000
Goto End
:Item192
ECHO      Installing 192mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0xc000000
Goto End
:Item224
ECHO      Installing 224mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0xe000000
Goto End
:Item256
ECHO      Installing 256mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x10000000
Goto End
:Item384
ECHO      Installing 384mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x18000000
Goto End
:Item512
ECHO      Installing 512mb Ramdisk
REG.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Ramdriv\Parameters /f /v DiskSize /t REG_DWORD /d 0x20000000
@rem Goto End
:End
%SystemRoot%\system32\devcon disable ramdriv
%SystemRoot%\system32\devcon enable ramdriv
@rem Goto Bye
:Bye
@rem echo The variable is "%errorlevel%"
@rem PAUSE
EXIT
This makes the DOSbox popup timeout automatically, so my XPE boot-up can flow without input.
This requires that Choice.com be in the build and be PATHED ...

I would use the AutoRAMre followed by my tweaked RAMre.cmd,
if AutoRAMre did not give that error message (and if AutoRAMre would generate a predictable RAMsize value) ...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.