China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-25 17:08
中国DOS联盟论坛 » 其它操作系统综合讨论区 » [Help] Does anyone know a way to put a Windows system on a CD? View 2,845 Replies 17
Floor 16 Posted 2003-05-01 00:00 ·  中国 江西 吉安 电信
版主
★★★★
Credits 7,296
Posts 1,628
Joined 2002-10-16 12:00
23-year member
UID 10
Gender Male
Status Offline
Also, a lot of programs need to write stuff into the windows directory when they start up. How do you prevent errors from that kind of writing?
Windows98 itself also needs to write stuff there, and regedit.exe is another program that absolutely has to write there.
How do you create a virtual disk when Windows98 starts up (or before that), and redirect all writes intended for the drive where Windows is installed so they get written to the virtual disk instead?

This still takes a lot of tricks and hands-on experience. I've seen posts about it, but I haven't tried it myself. This kind of testing is pretty troublesome.
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
Floor 17 Posted 2003-05-01 00:00 ·  中国 山东 滨州 联通
高级用户
★★
Credits 948
Posts 271
Joined 2002-12-13 00:00
23-year member
UID 502
Gender Male
From sd
Status Offline
Pwin98se running from CD

Booting Windows From CD-ROM
The reason Windows cannot boot from CD is that during startup Windows reports that it cannot access the registry. This article explains how to eliminate these errors and optimize CD booting.

To make a bootable Windows CD, you need at least 500M of disk space, some freeware, and some knowledge of DOS commands.

The method introduced here can only be used for systems above Windows 95b and Windows 98. It cannot be used for NT or 2000 boot CDs.

Actually, the whole problem is dealing with Windows write access to disk. Consider two issues: first, a system with the registry located on the CD can start and run normally. Second, place the registry on a RAM disk. A RAM disk is part of main memory and is emulated as a hard disk. The trick here is that you only need to copy the registry files to the RAM disk, so the RAM disk only needs about 4M of memory space. All files that do not require write access during startup remain on the CD. With this method, the registry can still be written even when there is no hard disk.

Before starting to install Windows, you need to make a boot disk and copy the Win98 installation directory to the hard disk, which will speed up the installation process.

Then you need to create some directories:
c:\w will be used for the CD boot image
c:\cdrom will be used as the CD directory
c:\cdrom\ramdisk is for storing the files that will be copied to the RAM disk when booting from CD
c:\cdrom\ramdisk\w will be the Windows directory on the RAM disk
c:\backup copy msdos.sys, io.sys, config.sys, autoexec.bat into it as a backup of the current system

Copy the following files into c:\w
dblbuff.sys, himen.sys, ifshlp.sys, setver.exe (located in the windows directory)
attrib.exe, keyb.com, keyboard.sys, mscdex.exe, subst.exe, xcopy.exe, xcopy32.exe, xcopy32.mod
(located in the windows\command directory)
A DOS CD-ROM driver, and a RAM drive driver (ramdrive.sys is not suitable because you cannot assign a drive letter to it; you can use xmsdsk.exe, which can be downloaded free from 【1】. If you use a different driver, you need to modify the settings in autoexec.bat)

Before reinstalling windows you must delete c:\config.sys and c:\autoexec.bat, and create a new autoexec.bat with the following settings:
c:\w\subst.exe x: c:\cdrom
path c:\;c:\w

Because the system will run from CD, and the CD can only be assigned an unused drive letter, the system must be installed on a later drive letter. This is important to make the registry independent of the drive letter. Therefore use the subst command to map the directory where you install windows to a virtual drive letter. The first line in autoexec.bat maps c:\cdrom to drive x:.

To prevent the existing system from being overwritten, you need to rename all win.com and system.ini files on the hard disk, and also system.dat. If windows cannot find these files in the system directory during startup, it will automatically search all partitions for system.dat, which may affect other systems.

Now begin installing windows. Run setup.exe, and it will report that subst.exe has already been loaded. Ignore this message, press esc to refuse the program's suggestion, and continue the installation. Use x:\w as the installation path. At the first reboot during installation, you must boot from the floppy disk you made earlier and ignore the prompt telling you to remove the floppy drive. After booting from the floppy disk, edit c:\config.sys and add the following settings, where ifshlp.sys is used to support the VFAT file system:
devicehigh=c:\w\himem.sys
devicehigh=c:\w\ifshlp.sys
devicehigh=c:\w\dblbuff.sys
devicehigh=c:\w\setver.exe

Also edit c:\autoexec.bat and add the following:
c:\w\subst.exe x: c:\cdrom
path c:\w;x:\w;x:\w\command;x:\w\system

Remove the floppy disk, press ctrl-alt-del to reboot, and complete the installation. At this point you can install some necessary drivers and applications into this system, which will eventually all go onto the CD, such as sound card and graphics card drivers. To make the later setup easier, you need to install the TweakUI tool. In windows98 you can find it in \tools\reskit\powertoy, and the windows95 version can be downloaded free from 【2】.

Now prepare a RAM disk for the registry. Still using the subst command, add the following line to c:\autoexec.bat:
c:\w\subst.exe w: c:\cdrom\ramdisk

windows looks in \msdos.sys on the boot partition for the location of the registry files, so you need to modify it. This file has the system attribute, so use the command attrib msdos.sys -s -h -r to remove its system, hidden, and read-only attributes. Then modify its first four lines as follows:

WinDir=w:\w
WinBootDir=w:\w
HostWinBootDrv=w

When editing msdos.sys you also need to add the following line:
DisableLog=1
Note that if it already contains a line DisableLog=0, you only need to change the 0 to 1.

As mentioned above, to prevent the system from reading system.dat from the hard disk when booting from CD, the registry file must be renamed. Its name is contained in c:\io.sys. Use a hex editor to modify it, search for all system.dat strings, and change them to system.tat. This change ensures that only system.tat will be regarded as the system registry file, while system.dat will be ignored.
In windows95 it is recommended to make this change, but in windows98 more problems need to be considered: the registry filename is not only specified in io.sys, some applications run at startup will also automatically detect this registry file. If you make this change, you may face registry error messages at every startup. Also scanregw.exe must be disabled at startup, and you can use msconfig.exe to disable it.

To make the next reboot safer, copy the start menu from c:\cdrom\w to c:\cdrom\ramdisk\w

Then shut down windows to command-line mode, and copy system.dat, system.ini, user.dat, win.ini from c:\cdrom\w to c:\cdrom\ramdisk\w. If you modified io.sys as described above, you need to rename system.dat to system.tat at this point.

When windows is restarted again it will use the registry on drive w:. However, during startup the system not only needs write access to the registry files, it also needs write access to the system directory. Therefore after booting the system from CD, the system directory must be changed to the path on the RAM disk. This location is indicated in the registry by the following key. Use regedit.exe to change this key value to 'w:\w':
HKLM\Software\Microsoft\Windows\CurrentVersion

At present the start menu resides on the RAM disk (simulated by the subst command), but it takes up unnecessary space, so you need to move it back to the CD: start TweakUI from the system controls directory, choose 'General', and adjust the entries in 'Special Folders', changing 'Programs', 'Start Menu', and 'Startup' to 'x:\w\startmenu' and their respective subdirectories. In windows98 you also need to adjust the 'Desktop' directory entry to 'x:\w\Desktop'. After reboot, the w:\w\Start Menu directory and w:\w\Desktop directory can be deleted.

Next, configure a real RAM disk. Reboot to DOS again, and use attrib c:\cdrom\ramdisk\*.* -s -h -r /s to remove the system, hidden, and read-only attributes from all files under c:\cdrom\ramdisk. Edit c:\autoexec.bat and delete the following line:
subst w: c:\cdrom\ramdisk
and add the following lines:
c:\w\xmsdsk 4000 w: /y
copy c:\command.com w:\
set COMSPEC=w:\command.com
c:\w\xcopy c:\cdrom\ramdisk\*.* w:\ /s

During startup these settings allocate 4000K of memory as a RAM disk, replacing the RAM disk previously virtualized by subst. The copy command copies the command interpreter and the registry files in the system directory to the RAM disk, and the COMSPEC parameter specifies the location of the command interpreter.

If everything runs normally after rebooting, you can then delete all files under c:\cdrom\ramdisk\w except system.ini, user.dat, win.ini, control.ini, system.dat (or system.tat if io.sys was modified).

Burning:

To burn a bootable CD, you need either a boot disk or a boot disk image file, depending on the burning software you use.

So, you need to make a normal boot disk using format a:/s or sys a:, copy the previously modified io.sys, msdos.sys, config.sys, autoexec.bat from c:\ to the boot disk and overwrite the original files, and copy the entire c:\w directory to the floppy disk.

Now you must modify a:\config.sys to contain the correct paths. The modified result is as follows:
devicehigh=a:\w\himem.sys
devicehigh=a:\w\ifshlp.sys
devicehigh=a:\w\dblbuff.sys
devicehigh=a:\w\setver.exe
device=a:\w\aspi8dos.sys
device=a:\w\aspicd.sys /D:CD001

Likewise, the paths in a:\autoexec.bat must also be modified, and the subst command must be replaced with mscdex.exe. The final version is as follows:
a:\w\mscdex.exe /D:CD001 /L:X /M:50
a:\w\xmsdsk 4000 w: /y
copy a:\command.com w:\
set COMSPEC=w:\command.com
a:\w\xcopy x:\ramdisk\*.* w:\ /S
path w:\;x:\w;x:\w\command; x:\w\system
x:

Make sure the data buffer for mscdex.exe is not too small. With the parameter /M:12 and a fast CD-ROM drive, windows may crash during startup because the CD-ROM cannot provide data fast enough. The /L:X parameter specifies drive x: as the CD-ROM drive letter.

Before restoring the original system, you can back up io.sys, msdos.sys, config.sys, autoexec.bat from c:\ to some unrelated directory for future use. Then copy the original system backup from c:\backup back to c:\, and rename the previously renamed system.dat, system.ini, win.com back to their original names. Then you can boot the original system and do the burning.

The CD must contain a Joliet file system and use c:\cdrom as its root directory.

Before, I made one according to this method. As soon as the system started,
it tried to write data to the cdrom, and then blue screen,
I think it may have been because of virtual memory.
But no matter how I set the location of virtual memory, or disabled

virtual memory, the system always wanted to access the win386.swp file in my windows directory.
But on other machines, I could easily adjust the location of virtual memory.
So my cdwin98 never succeeded, and I gave up.
These past two days I saw that winpe had come out, so I wanted to solve this problem again.

I carefully studied the win98 system on my new disk
and found that the wininit.ini file was still there, which I found very strange.
When I opened the file, it turned out to be a command to delete my win386.swp
null=x:cdwin98\win386.swp
This shows that this command had never been executed.
So it suddenly dawned on me, and I copied the 4 registry files under the ramwin98 directory under ramdisk, along with
the wininit.ini file, to the original cdwin98 directory,
then restart, and everything was ok, the original win386.swp file was gone.

I think maybe when win98 first starts running, it still looks for some system files under the original directory,
for example system.ini (the virtual memory settings are controlled by this file)

Also, you don't necessarily have to install twui,

and even if you do install it, you still have to adjust the registry manually.
The adjustments by twui are all placed under the following registry subkey

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

the defaults are under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

directly modifying the contents of the default subkey is useless

you need to add items under User Shell Folders to override the default values


Brother! It seems you forgot to mention MSdos.sys!!!???
Back in March last year I spent more than a week trying to make a CD Win98, and it was exactly
because of the Msdos.sys problem that I had to stop! What you said is not bad, and most of it works,
you just forgot Msdos.sys.
That file is used to configure the Windows98 boot disk and directory. If there is no hard disk, then everything above is for nothing!

I'm testing it now, not sure whether it will work. Besides, the article didn't take into account IE cache\temporary directories\
virtual memory and other issues, so it needs a more detailed study.

--------------------------------------------------------------------------------
According to what the article says, at the last step, when restarting, an IE browser error appears. I don't know how to solve it!
Could uninstalling IE and using another browser be considered?
Install the standard SVGA driver, and disable the system's automatic detection of new hardware. I think using this kind of CD
would only be for occasional need. Especially if making it shared, there is no need to install so many drivers. This is also for
the sake of running efficiency, so there is no need to install any special drivers, unless it is only for use on your own
machine.



You can go to http://www.qualystem.com/en/download.html
to download the tool for making a WIN98 that runs from CD. You need to fill out a form,

Product to be tried : choose Qualystem Rescue for Win9X/ME

One minute later you will receive an email containing the download address.
Another minute later you will receive an email containing the installation password (archive password).
The trial version has a one-month usage limit, and the finished CD can only be used on the same machine.
Floor 18 Posted 2003-05-01 00:00 ·  中国 湖北 武汉 蔡甸区 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
First, thanks, but I've already read this article. It's not ideal enough. Leaving aside the many problems it still has, even if it succeeds it's still too large.
I want to keep it within 80m.
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Forum Jump: