Installing Windows NT from CD, HDD or floppies as usual on modern hardware (I mean Pentium4-based and later PCs) it is a difficult task due to installer incompatibility with faster/newer hardware & CPUs. That doesnt mean that Windows NT cannot RUN on such hardware. You CAN install Windows NT in virtialization software (QEMU, VirtualBox, VmWare, VirtualPC, Bochs ...) and then copy intalled OS image on "real" PC harddrive.
[ProcessorVar] STF_PROCESSOR = "" ? $(!LIBHANDLE) GetProcessorafter:
[ProcessorVar] STF_PROCESSOR = $(ProcessorID_I586)
[Shell Commands] ... read-syms UiVars detect UiVars read-syms FreeSpace$(!STF_PLATFORM) ifstr(i) $(STF_PLATFORM) != $(STF_PLATFORMDET)after:
[Shell Commands] ... read-syms UiVars detect UiVars read-syms FreeSpace$(!STF_PLATFORM) set !STF_PLATFORMDET = "I386" ifstr(i) $(STF_PLATFORM) != $(STF_PLATFORMDET)
Hive: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
Key: Z: String Value: \\Device\\Harddisk0\\Partition2
[SCSI.Load] viaide = viaide.sys,4 ;must be first line!!! ... [SCSI] ... viaide = "VIA (E)IDE Controller" ...3) make these changes in dosnet.inf
[Files] ... d1,viaide.sys ...
CDROM.W DISK1.W DISK2.W DISK3.W ... DISK50.W DISK51.W
CDIMAGE -lNT3INST -h -ois -nt C:\SRC C:\nt3inst.isocdimage (or oscdimg) taken from WindowsPE ( xpsp2_2180_usa_x86fre_opk.zip or ensp1opk.zip )
EN-US version of MSGINA.DLL from Windows NT3.51 Workstation SP5 SP5_351I.EXE .76E3218F: 68BC90E376 push 076E390BC -- 1 .76E32194: 683091E376 push 076E39130 ;'DefaultPassword' .76E32199: 681C91E376 push 076E3911C ;'Winlogon' .76E3219E: FF151C11E376 call GetProfileStringW ;KERNEL32 .76E321A4: 85C0 test eax,eax .76E321A6: 7412 je .076E321BA -- 4 (74 12 change to EB 00) .76E321A8: 8D45BC lea eax,[ebp][-44] .76E321AB: 50 push eax .76E321AC: 68CF000000 push 0000000CF ;' ¦' .76E321B1: 56 push esi .76E321B2: FF15A411E376 call SetDlgItemTextW ;USER32 .76E321B8: EB15 jmps .076E321CF -- 5 .76E321BA: 681891E376 4push 076E39118 -- 6 .76E321BF: 68F890E376 push 076E390F8 ;'AutoAdminLogon' .76E321C4: 680090E376 push 076E39000 ;'Winlogon' .76E321C9: FF151811E376 call WriteProfileStringW ;KERNEL32 .76E321CF: 83BFF00A000000 5cmp d,[edi][00000AF0],0 .76E321D6: 7559 jne .076E32231 -- 9 .76E321D8: 6A00 push 0 .76E321DA: 68BC90E376 push 076E390BC -- 1 .76E321DF: 68D490E376 push 076E390D4 ;'DefaultDomainName' .76E321E4: 68C090E376 push 076E390C0 ;'Winlogon' .76E321E9: E840FAFFFF call .076E31C2E -- C
А известно ли Вам что система NT/2K/XP позволяет грузится с HDD который не
определяется BIOS-ом на весь свой размер. (>504 Mb, > 8 Gb, > 137 Gb и т.д.) Также возможна установка NT/2K/XP на такой диск.
Делается так:
[boot loader] timeout=30 default=scsi(0)disk(0)rdisk(0)partition(1)\WINNT [operating systems] scsi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows NT" scsi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows NT [VGA mode]" /basevideo /sosт.е. поменять префикс multi(0) на scsi(0).
Before:
if ((vinfo.dwMajorVersion < 4) || (vinfo.dwPlatformId == VER_PLATFORM_WIN32s))After:
if (vinfo.dwPlatformId == VER_PLATFORM_WIN32s)Note that glQuake REQUIRES MESA opengl32.dll or other third-party dll that supports OpenGL extensions version 1.1.
Use these toolkits - ERUNT and NTREGOPT. It also supports NT4/2000/XP. If you want to use builtin methods, run from Windows NT:
rdisk /s-
And your registry will be backed up to %SystemRoot%\REPAIR and defragmented there. You can extract hives from %SystemRoot%\REPAIR to %SystemRoot%\SYSTEM32\CONFIG as them packed in Micrsoft CAB-format. But note that you cannot replace hives in %SystemRoot%\SYSTEM32\CONFIG while Windows NT is running, you must dualboot of enter DOS session.
For "user-mode" program debugging any debugger is suitable, even NT4/W2K/XP ones. But for remote KERNEL debugging I recommend using ONLY "native" i386kd.exe debugger from NT 3.51 Device Development Kit (DDK). NT4/W2K DDK can start remote debugging connections to NT 3.51 but their output and stability is worse than with "native" DDK. Also note that NT 3.51 cdb/ntsd/i386kd debugger cannot recognize PDB debug symbols, which is standard starting with Visual Studio 97/6.0 and later (i.e. VC5/VC6). You must use DBG symbols. Here is DBG-making procedure for Microsoft Visual C/C++ compilers:
dumpbin /headers somefile.exethen search for:
OPTIONAL HEADER VALUES
10B magic #
6.00 linker version
15000 size of code
8000 size of initialized data
0 size of uninitialized data
1100 RVA of entry point
1000 base of code
16000 base of data
400000 image base // bingo!
rebase -b 0x400000 -x . somefile.exe
The CreateDesktop function creates a new desktop on the window station associated with the calling process. It retrieves a handle that can be used to access the new desktop. The calling process must have an associated window station, either assigned by the system at process creation time or set by SetProcessWindowStation. A desktop is a secure object contained within a window station object. A desktop has a logical display surface and contains windows, menus, and hooks.
HDESK CreateDesktop( LPCTSTR lpszDesktop, // name of new desktop LPCTSTR lpszDevice, // reserved; must be NULL LPDEVMODE pDevmode, // reserved; must be NULL DWORD dwFlags, // desktop interaction ACCESS_MASK dwDesiredAccess, // access of returned handle LPSECURITY_ATTRIBUTES lpsa // security attributes );
CreateDesktop exists in Unicode variant - CreateDesktopW(), and "normal" - CreateDesktopA().
Here I can explain what for lpszDevice and pDevmode are needed. When I first "met" NT 3.5x line I asked myself a question: why NT 3.5x cannot change screen resolution on-the-fly without rebooting, but otherways can test ANY mode for visibility in "Control Panel->Display" about some seconds.
These two reserved parameters made for creating new desktop surface with any chosen screen resolution.
lpszDevice parameter is a pointer to ASCIIz name of display device, as usual it is "\\.\Display1", "\\.\Display2", "\\.\Display3"...
pDevmode parameter is a pointer to standard DEVMODE structure (see MSDN), it can be obtained using EnumDisplaySettings(), EnumDisplaySettingsEx() or filled manually.
When these two field are NULL any CreateDesktop() call will create empty desktop with the same resolution as the system desktop, but when they are filled - it is possible to create desktop with any resoltion your videocard supports. This functionality also present in later NT incarnations - NT4/2000/XP/2003...
Starting from Windows NT 4.0, NTOSKRNL.EXE contains some basic 64-bit integer arithmetic API:
LONGLONG WINAPI _allmul( LONGLONG a, LONGLONG b ) return a * b; LONGLONG WINAPI _alldiv( LONGLONG a, LONGLONG b ) return a / b; LONGLONG WINAPI _allrem( LONGLONG a, LONGLONG b ) return a % b; LONGLONG WINAPI _allshr( LONGLONG a, LONGLONG b ) return a >> b; ULONGLONG WINAPI _aullmul( ULONGLONG a, ULONGLONG b ) return a * b; ULONGLONG WINAPI _aulldiv( ULONGLONG a, ULONGLONG b ) return a / b; ULONGLONG WINAPI _aullrem( ULONGLONG a, ULONGLONG b ) return a % b; ULONGLONG WINAPI _aullshl( ULONGLONG a, ULONGLONG b ) return a << b; ULONGLONG WINAPI _aullshr( ULONGLONG a, ULONGLONG b ) return a >> b;
But in NT 3.51 NTOSKRNL does not contains such functions. Please be aware while compiling drivers or native programs for NT 3.51 using Windows 2000 DDK and higher!
First of all, there is software MESA OpenGL driver that is compatible with NT 3.51 and provides OpenGL 2.1 API (Mesa 6.5.3, 7.x and later), this driver is preferred over internal OpenGL support. You can compile it using MinGW.
It also has software OpenGL 1.0 support via internal opengl32.dll. But note that some APIs are missing and present only in Windows 98/NT4/2000/XP and later (mostly OpenGL texturing support is absent):
glAreTexturesResident glArrayElement glBindTexture glColorPointer glCopyTexImage1D glCopyTexImage2D glCopyTexSubImage1D glCopyTexSubImage2D glDebugEntry glDeleteTextures glDisableClientState glDrawArrays glDrawElements glEdgeFlagPointer glEnableClientState glGenTextures glGetPointerv glIndexPointer glIndexub glIndexubv glInterleavedArrays glIsTexture GlmfBeginGlsBlock GlmfCloseMetaFile GlmfEndGlsBlock GlmfEndPlayback GlmfInitPlayback GlmfPlayGlsRecord glNormalPointer glPolygonOffset glPopClientAttrib glPrioritizeTextures glPushClientAttrib glTexCoordPointer glTexSubImage1D glTexSubImage2D glVertexPointer wglChoosePixelFormat wglDescribePixelFormat wglGetDefaultProcAddress wglGetPixelFormat wglSetPixelFormat wglSwapBuffers
So, you MUST avoid using these APIs in your programs. This API function present only in Windows 2000 and later: wglSwapMultipleBuffers.
In 1996 Microsoft release a special "update" for NT 3.51 - Shell Technology Preview and later - Shell Technology Preview Update the second beta release. It provides Windows 95/NT4.0 "look and feel" visual update for this OS. It is an unsupported and test-only release.
To install TechPreview unpack ZIP archive ( 05/26/95 or 08/09/95 release ) with it to somewhere and run:
shupdate.cmdTo uninstall, run:
shupdate.cmd /u
Special notes: I do not recommend this update to be installed. If you anyway wish to install it make sure that you install all hotfixes and updates BEFORE installing this TechPreview. Note that when this TechPreview is installed Windows NT 3.51 is now reported as Windows NT 4.0 (i.e. for example it reports itself as Windows NT 4.0 Service Pack 5 if before it was Windows NT 3.51 Service Pack 5). This is normal and made for compatibility reasons. Some programs which cannot run under NT 3.51 may run under this "updated" OS, some - may have different compatibility problems due to its beta status.
According to MSDN, The Windows Sockets WSAStartup function initiates use of sockets DLL (Ws2_32.dll/Wsock32.dll) by a process.
int WSAStartup( WORD wVersionRequested, LPWSADATA lpWSAData );
WSAData.iMaxUdpDg contains an actual maximum UDP message size specific to a particular Windows Sockets 1.x service provider and socket type.
The Windows Sockets getsockopt function retrieves a Winsock 2.0 socket option.
int getsockopt( SOCKET s, int level, int optname, char FAR *optval, int FAR *optlen );
The getsockopt function retrieves the current value for a socket option associated with a socket of any type, in any state, and stores the result in optval. Options can exist at multiple protocol levels, but they are always present at the uppermost socket level. Options affect socket operations, such as the packet routing and OOB data transfer.
When optval is SO_MAX_MSG_SIZE it returns maximum size of a message for message-oriented socket types (for example, SOCK_DGRAM). Has no meaning for stream oriented sockets.
Windows version, WSAData.iMaxUdpDg getsockopt(SO_MAX_MSG_SIZE) Service Pack Winsock 1.x (Wsock32.dll) Winsock 2.0 (Ws2_32.dll) ----------------------- -------------------------- --------------------------- NT3.51 65527, -n/a- NT4(SP6a)/2000(pre-SP3) 65467, 65527 2000(SP3+)/XP/2003 65467, 65507According to this MS Article MSKB: Getsockopt() Function Returns a Different Maximum UDP Message Size Than You Expect in Windows 2000 SP3 (Q822061) this is wrong. Don't be fooled that this article is covers Windows 2000, that problem also exists in previous Windows versions. But it fixed only in Windows 2000 SP3, thanks to Microsoft :).
The correct maximum UDP message size is 65507, as determined by the following formula: 0xffff - (sizeof(IP Header) + sizeof(UDP Header)) = 65535-(20+8) = 65507
If we try to send or receive message larger than 65507, we receive an error. So it is a good idea to check this value and make it <= 65507 bytes.
When you perform a clean install of NT 3.51 OS you may face a problem that you cannot install any local printer and/or select a port for it. You may also see such message as "Could not create printer: The printer name is invalid." and see no ports available for output. This is due to some missing registry entries:
; Default Print Processor [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Print Processors\winprint] "Driver"="winprint.dll" ; Local Computer Printing [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Local Port] "Driver"="localmon.dll" ; TCP-IP Printing, LPD [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port] "Driver"="lprmon.dll"
You may use regedt32.exe to make these changes. Before making them, make sure that these files are installed from NT 3.51 distribution media:
winprint.dll must be in %SystemRoot%\SYSTEM32\sPOOL\PRTPROCS\W32X86 localmon.dll must be in %SystemRoot%\SYSTEM32 lprmon.dll must be in %SystemRoot%\SYSTEM32
Microsoft confirmed some of these problems, see articles:
Some theory: Most of POSTSCRIPT printer drivers in Windows NT is module-based, and consists of three parts:
PSCRIPT.DLL PSCRPTUI.DLL PSCRIPT.CNT PSCRIPT.HLP PSCRIPT.SEP
PLOTTER.DLL PLOTUI.DLL PLOTUI.CNT PLOTUI.HLP
Now we know it. But how to install a new printer or plotter (which of course, doesn't have a suitable driver, since mainstream NT 3.51 support for printers was already cancelled) ? I'll take for example HP Color LaserJet 3800N, which is officialy unsupported in Windows 3.51.
Here are the steps:
[Identification]
OptionType = PRINTER
[Options]
"HP Color LaserJet 3800 PS" = pscrptui, hpc3800s, pscript
[Identify]
...
...
[Files-PrinterData]
hpc3800s = 2,hpc3800s.ppd
...
...
[OptionsTextENG]
"HP Color LaserJet 3800 PS" = "HP Color LaserJet 3800 PS"
Note that name, which I use - "HP Color LaserJet 3800 PS", I reprint from header of hpc3800s.ppd. This is important!