Jump to content

Problem in the code to choose suitable Kernel


Recommended Posts

During installation of xp, i run bootlogo.cmd to select the suitable kernel to load during windows boot.

i have all the kernels(modified) in system32 dir.

The code works well to identify dual or single core.

Problem is in the 2nd para where it has to detect whether normal or PhysicalAddressExtension kernel.

Can someone guide me in this issue?

Clue is that NUMBER_OF_PROCESSORS is reg_sz (decimal)and PhysicalAddressExtension is reg_dword (hex).

bootlogo.cmd

---------------

FOR /F "tokens=3 delims= " %%A IN (\'REG QUERY "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v NUMBER_OF_PROCESSORS\') DO SET NUMBER_OF_PROCESSORS=%%A
if %NUMBER_OF_PROCESSORS%==2 goto DUAL

FOR /F "tokens=3 delims= " %%i IN (\'REG QUERY "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v PhysicalAddressExtension\') DO SET PhysicalAddressExtension=%%i
if %PhysicalAddressExtension%==0x1 goto SPAE
bootcfg /copy /D "Load using default singleprocessor kernel" /ID 1
bootcfg /RAW "/Kernel=KrnlS.exe /SOS" /A /ID 1
bootcfg /RAW "/SOS" /A /ID 2
goto End

:SPAE
bootcfg /copy /D "Load using default Singleprocessor PAE kernel" /ID 1
bootcfg /RAW "/Kernel=KrnlSpa.exe /SOS" /A /ID 1
bootcfg /RAW "/SOS" /A /ID 2
goto End

:DUAL
FOR /F "tokens=3 delims= " %%i IN (\'REG QUERY "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management" /v PhysicalAddressExtension\') DO SET PhysicalAddressExtension=%%i
if %PhysicalAddressExtension%==0x1 goto MPAE
bootcfg /copy /D "Load using default multiprocessor/HT kernel" /ID 1
bootcfg /RAW "/Kernel=KrnlM.exe /SOS" /A /ID 1
bootcfg /RAW "/SOS" /A /ID 2
goto End

:MPAE
bootcfg /copy /D "Load using default multiprocessor/HT PAE kernel" /ID 1
bootcfg /RAW "/Kernel=KrnlMpa.exe /SOS" /A /ID 1
bootcfg /RAW "/SOS" /A /ID 2

:End
bootcfg /Timeout 15
bootcfg /Default /ID 1

Edited by rajesh.kumar
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...