Windows Server 2003 (NT 5.2 / 3790) guide
Preparing Environment
- Extract source tree, in this guide we will assume
C:\NT
(if you wish for your binaries to match RTM as closely as possible, useD:\srv03rtm
) - Unset Read Only on extracted directory (including subfolders and files)
- Create desktop shortcut for
%windir%\system32\cmd.exe /k C:\NT\tools\razzle.cmd free offline
(see below for explanation) and changeStart in
toC:\NT
(do not open it yet!) - Acquire new certificates and overwrite old files with newly extracted ones:
\tools\testroot.cer
\tools\testpca.cer
\tools\driver.pfx
\mergedcomponents\setupinfs\testroot.cer
- Manually import
\tools\driver.pfx
certificate and private key (if asked for password, simply continue without typing anything) - Apply patches (available below) to NT tree
- Copy these files/directories from XP source tree and copy them into 2K3 tree:
\public\internal\windows\lib\i386\directui.lib
\public\internal\windows\lib\i386\conlibk.lib
- Acquire these files/directories and copy them into source tree:
\tools\missing.cmd
\tools\oscdimg.cmd
- Copy these files/directories and store them safely outside source tree:
\ds\security\services\ca\tools\certut\obj\
\inetcore\outlookexpress\external\obj{pd}\
\base\ntos\ex\mp\obj
\base\ntos\ex\up\obj
- Now you can open new razzle window by using your shortcut
Building
You are now ready to attempt first build. First, decide on how you would like to proceed.
Clean build
perl tools\timebuild.pl -NOPOSTBUILD -NOSCORCH
- Copy back the files you've stored outside of source tree in preparation step
- Run
build /ZP
again and ensurebuild.err
is empty
"Dirty" build
nmake set_builddate set_buildnum set_buildname -f makefil0
perl tools\timebuild.pl -NOCLEANBUILD -NOPOSTBUILD -NOSCORCH
- Run
build /ZP
again and ensurebuild.err
is empty
Rest of instructions are the same for both types:
- Mount RTM CD and execute
tools\missing.cmd
(optionally, perform this step for every SKU) - Edit
\tools\postbuildscripts\pbuild.dat
and comment out (;
) thesxs_make_asms_cabs
lines tools\postbuild.cmd
(use-sku:{sku}
if you want to process only specific one, expect errors if you ignore this and have skipped onmissing.cmd
optional step)
Getting ISO files
- Execute
tools\oscdimg.cmd {sku}
where{sku}
is one of:srv
- Windows Server 2003 Standard Editionsbs
- Windows Server 2003 Small Business Editionads
- Windows Server 2003 Enterprise Editiondtc
- Windows Server 2003 Datacenter Editionbla
- Windows Server 2003 Web Editionper
- Windows XP Home Editionpro
- Windows XP Professional
Patches
Following patches should be applied before building:
Additions
Why build flags are necessary
Certain parts of code are missing but present in pre-built form, using -NOCLEANBUILD
and -NOSCORCH
ensures that they are not removed from the tree
Removing timebomb
Comment out timebomb
lines from tools\postbuildscripts\pbuild.dat
before running postbuild
for the first time (currently there is no guide to revert it)
Different build options
You can modify your razzle shortcut (or execute command manually inside C:\NT
) to include (or remove) additional argument(s):
free
- build 'free' bits (production, ommiting it will generated checked bits)CkhKernel
- build 'checked' (testing) kernel/hal/ntdll when building 'free' bitsno_opts
- disable binary optimization (useful for debugging, but will most likely fail a full build, some code can't be built without optimization)verbose
- enable verbose execution of the build processbinaries_dir <basepath>
- specifies custom output directory (default isbinaries
, the suffix added after.
is non-customizable)
Other options are not described here, see razzle.cmd /?
for details.
Creating fresh build
tools\postbuild.cmd -full
tools\missing.cmd
tools\postbuild.cmd
Use -sku:{sku}
if you want to process only specific one
Building specific components
Most components can be built seperately. For example, if you wish to rebuild ntos
component, perform these steps:
cd base\ntos
(you can also usentos
alias that razzle has set up for you)bcz
Generally postbuild.cmd
is clever enough to include your changes properly without needing fresh build as it uses bindiff
to detect changes.
Rebuilding for new NT version
Use tools\ntnewver.cmd
if you wish to update NT version
Original CD filenames
5.2.3790.0.srv03_rtm.030324-2048_x86fre_server-standard_retail_en-us-NRMSFPP_EN.iso
(SHA1: A600409482A5678EF6AF2B26D3576D6D9894178D)5.2.3790.0.srv03_rtm.030324-2048_x86fre_server-datacenter_retail_en-us-NRMDOEM_EN.iso
(SHA1: E2B47A7CE45C6C6305594CEE4C1B64894805AAF4)5.2.3790.0.srv03_rtm.030324-2048_x86fre_server-enterpriseserver_retail_en-us-NRMEFPP_EN.iso
(SHA1: 0309FFB4181BA5122C692A6E1079E9FC1D53FCE4)5.2.3790.0.srv03_rtm.030324-2048_x86fre_server-webserver_retail_en-us-NRMWFPP_EN.iso
(SHA1: 46C1CCB2CFC96803E304A35BEF50CD71B2C1DE38)5.1.2600.0.xpclient.010817-1148_x86fre_client-home_retail_en-us-WXHFPP_EN.iso
(SHA1: B273C8D41E3844E3E46722F52F5A4CF9F206C8D0)5.1.2600.0.xpclient.010817-1148_x86fre_client-professional_retail_en-us-WXPFPP_EN.iso
(SHA1: 1400DED4402D50F3864ED3D8DCF5CC52BA79A04A)sbs.iso
(coverted from mdf; SHA1: CDB30C80FDE314C16CA11F5CD31650ECBEC7A214)
Product keys
- Standard Edition: M6RJ9-TBJH3-9DDXM-4VX9Q-K8M8M