Author Topic: diskless / embedded Win9x HOWTO  (Read 775 times)

Anonymous

  • Guest
diskless / embedded Win9x HOWTO
« on: February 09, 2002, 08:34:18 PM »
here is a very rough draft, i have tested it with win ME so far, and all the basics are covered.

1. make a bootable rescue floppy from a running Win9x system

Start with a blank HD, however VirtualPC or VMWare are highly recommended.

First, create directories:
MD C:WIN9x
MD C:W
MD C:CDROM
MD C:CDROMRAMDISK
MD C:CDROMRAMDISKW
MD C:BACKUP

WIN9x      for holding the windwows distro
W       for preparing the boot image
CDROM       for everything put on CD.
CDROMRAMDISK    for the RAM disk
CDROMRAMDISKW for the RAM disk\'s \'Windows directory\'.
BACKUP       for copies of msdos.sys, io.sys, config.sys and autoexec.bat

Where Z: is your CDROM drive, copy the contents of the Windows distro folder from the original Microsoft CD into the win9x directory on the c drive :

XCOPY32 /V /E Z:WIN9x*.* C:WIN9x


Copy the following
(example Z:DOS or wherever you may have these files)

COPY Z:DOSxmsdsk.exe C:W
COPY Z:DOSoakcdrom.sys C:W
COPY Z:DOShimem.sys C:W
COPY Z:DOSifshlp.sys C:W
COPY Z:DOSsetver.exe C:W
COPY Z:DOSattrib.exe C:W
COPY Z:DOSkeyb.com C:W
COPY Z:DOSkeyboard.sys C:W
COPY Z:DOSmscdex.exe C:W
COPY Z:DOSsmartdrv.exe C:W
COPY Z:DOSsubst.exe C:W
COPY Z:DOSxcopy.exe C:W
COPY Z:DOSxcopy32.exe C:W
COPY Z:DOSxcopy32.mod C:W  (Windows98, ME)

Before installing Windows : create new startup files:

edit C:config.sys

DEVICEHIGH=C:WHIMEM.SYS            
INSTALLHIGH=C:WSMARTDRV.EXE        
INSTALLHIGH=c:wSUBST.EXE X: C:CDROM


edit C:autoexec.bat

path C:;C:W



In order to create a mini-installation of Windows you should grab the latest copy of 98Lite, extract it to the WIN9X folder and use the DOS version of 98Lite to do a \'clean install\' of windows, using the \"98micro\" installation option.

The modifications it makes will force Windows to load only really needed drivers. This saves a lot of space.

The 98micro installation will require you to have your Windows 95 CD, in order to extract Win95 (OSR 2.1) frontend which it will use in place of the overweight win9x GUI
the files it needs from the Win95 (OSR 2.1) CD are:

explorer.exe
shell32.dll
comdlg32.dll

OSR 2.1 is Windows version 4.00.950, (check the properties tab on Explorer.exe)

Next, 98Lite will launch setup:

Setup should complain subst.exe is loaded. press ESC.
Use X:W as the installation path, not C:WINDOWS

While the installation process is going on you will be asked for the installation of optional components. Deactivate almost everything in order to save space. They can be added later.


following setup\'s first restart, instead of letting the C drive boot, (it will fail anyway because can\'t find HIMEM.SYS) boot with a rescue floppy, to edit C:config.sys

use this example:

DEVICEHIGH=C:Whimem.sys
INSTALLHIGH=C:Wsubst.exe x: C:CDROM
DEVICEHIGH=C:Wifshlp.sys
DEVICEHIGH=C:Wdblbuff.sys
DEVICEHIGH=C:Wsetver.exe

Then edit c:autoexec.bat :
Delete everything and drop this line in :

path C:W;X:w;X:WCOMMAND;X:WSYSTEM

If you are running Windows Me, apply the Real DOS-Mode Patch for Windows ME at this point.

Remove the startup floppy, restart your computer , finish installing windows.

After Setup completes, scanregw.exe must be prevented from autorun at startup, deactivate it with msconfig.exe.

Move Temoprary Internet files to X:RAMDISK, using Tools >Internet Options >Temporary Internet Files Settings

Disable the Recycle Bin

Disable Virtual Memory (delete the leftover pagefile)

Configure your Network properties to logon to a Windows NT domain

Changing the splash screen in Windows 9x is even simpler than in Windows 3.x, as it doesn\'t involve using the uncommon RLE format. The screen can be stored in the file LOGO.SYS, in the root directory of the boot drive. If you don\'t have this file, borrow sulogo.sys from Win ME and rename it logo.sys. Now, load this file into Paint after making a backup copy. You\'ll find it\'s a squashed-looking, 320-by-400, 256-color bitmap. During the loading process, Windows 9x stretches it to 640-by-400. To edit the existing screen, select Stretch/Skew from the Image menu and stretch the image to 200 percent horizontally. If you want to create an all-new logo bitmap, start with a 640-by-400, 256-color image. In either case, use the Stretch/Skew tool to reduce the file by 50 percent horizontally before saving it.

The standard logo screen has a color bar across the bottom that seems to move. This animation is produced by cycling the colors assigned to the last 20 entries in the 256-color palette. If you make changes to LOGO.SYS and save it, however, the animation disappears. To restore the animation, load LOGO.SYS into DEBUG and enter these commands at the prompt:

    E CS:132 EC
    W
    Q

You can actually expand on this feature to animate your own logo screen. Just start with the existing logo screen and erase everything except the animated color bar. Use the dropper tool in Paint to pick up color from a portion of the animated bar, then paint something else on the screen with that color. Whatever you paint will change color along with the animated color bar.

Using Windows explorer, Move the start menu, Favorites, Cookies, All Users, and Desktop folders from X:W to X:RAMDISKW
also move \'Special Folders\' entries for \'Programs\', \'Start Menu\' and \'Startup\' to read \'X:Wstartmenu or the respective subdirectories. For Windows 98, you should also readjust the \'Desktop\' entry to read \'X:WDesktop\'. After rebooting, the W:WStartmenu and W:WDesktop folders can be deleted.

Done?
ok, now go into Device Manager and delete the \"plug and play bios\" device, if you plan to use the CD on different systems. It will remove all hardware devices specific to your system. This way, when you start the CD on another system windows won\'t crash because foreign drivers, it will plug and play instead.

You need to customize windows to include your own preferences, programs, tweaks and drivers, now....

**************************************************************
**************************************************************
**************************************************************

Whatever you configure after the following steps will be forgotten when the registry will reside in a RAM disk. Why not take the opportunity now , to make a system backup in case of emergency.

edit C:autoexec.bat : ADD the following string as your third line in config.sys:
INSTALLHIGH=C:Wsubst.exe x: C:CDROMRAMDISK

now, edit C:msdos.sys : to edit it, you must first make it accessible with ATTRIB -R -A -S -H /s C:*.*

change the first four lines:

[Paths]
WinDir=W:W
WinBootDir=W:W
HostWinBootDrv=W

add a line at the end of the last text section :

DisableLog=1

Now , a main reference to the Registry must be altered by hex-editing C:io.sys.

WinME IO.SYS IS ENCRYPTED

first make it accessible : attrib -s -h -r -a C:io.sys

to edit binary files in DOS, example: EDIT /70 C:io.sys

when edit starts, press the [Insert] key on your keyboard to turn off insert. (full-block cursor, instead of an underline)
search for \"system.dat\" and change it to SYSTEM.TAT

EDIT /70 C:CDROMWSYSTEM.DAT

Restart windows in MS-DOS mode.
type the following


ATTRIB -R -A -S -H /s C:*.*
COPY C:CDROMWSYSTEM.DAT C:CDROMRAMDISKWSYSTEM.TAT
COPY C:CDROMWsystem.ini C:CDROMRAMDISKW
COPY C:CDROMWuser.dat C:CDROMRAMDISKW
COPY C:CDROMWwin.ini C:CDROMRAMDISKW

Restart Windows and it will now use the registry on W:

the W: directory will be copied into RAM disk after booting from CD -- Its absolute path is noted in the registry.

EDIT /70 C:CDROMWSYSTEM.DAT

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion]
\"SystemRoot\"=\"W:W\"


Restart windows in MS-DOS mode.
ATTRIB -R -A -S -H /s C:*.*
edit C:autoexec.bat : delete everything

In its place, add the following lines:

copy C:command.com W:
set COMSPEC=W:command.com
C:Wxcopy32 /E /V C:CDROMRAMDISK*.* W:

During startup, this sets up a 16MB RAMdrive instead of a subst drive. The copy commands fill it with a command.com and the contents of the directory containing the registry.

after rebooting, you can delete all files in C:CDROMRAMDISKW except system.ini, user.dat, win.ini, control.ini and system.tat or system.dat respectively.

To create a bootable CD, you need a boot image :

create a normal startup disk using format a:/s or sys a:. Copy the patched io.sys and msdos.sys files as well as the config.sys and autoexec.bat you just made from C:, replacing existing files. In addition, put the entire C:W directory onto your disk.

Now, edit A:config.sys :

DEVICEHIGH=A:Whimem.sys
(IF USING WINDOWS ME DELETE the line about HIMEM.SYS it is unneccessary)

DEVICEHIGH=IFSHLP.SYS
DEVICEHIGH=DBLBUFF.SYS
INSTALLHIGH=XMSDSK.EXE 16000 W: /y
DEVICEHIGH=OAKCDROM.SYS /D:MSCD001
INSTALLHIGH=MSCDEX.EXE /D:MSCD001 /L:X /M:50


edit A:autoexec.bat :
The file should resemble this:

@ECHO OFF
COPY A:COMMAND.COM W:
set COMSPEC=W:COMMAND.COM
X:WCOMMANDXCOPY X:RAMDISK*.* W: /S
set COMSPEC=W:COMMAND.COM
PATH W:;X:W;X:WCOMMAND;X:WSYSTEM
X:WWIN.COM



copy io.sys, msdos.sys, config.sys and autoexec.bat from C: to a separate directory for backup purposes.

Then, copy the files from C:BACKUP back to C: and change the altered system.dat, system.ini and win.com back to their original names.

Use WinImage to create an image of the floppy you just made.
before building your ISO,
attrib -r -a -s -h /S C:CDROM*.*

The ISO is to have a Joliet file system and contain all of C:CDROM in its root directory