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-07-22 17:11
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Analysis of Yiyesong's Boot Disk View 3,556 Replies 11
Original Poster Posted 2002-12-29 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
This is my analysis of this boot disk. My personal skill level is limited, so if there is anything inappropriate, please point it out.


************
CONFIG.SYS
************

The 4 menus are specified by CONFIG.SYS. The default is graphical mode GP, with 20 seconds selection time, color code 7. Background color code 0
COMMON section
Loads the XMS driver HIMEM.SYS /testmemff (in higher-version HIMEM.SYS, TESTMEM is also OFF by default), without testing memory
//*UMBPCI.SYS I don't know what it is (judging by the filename, I guess it's a driver for loading UMB; I use EMM386.EXE), the moderator's disk has it too*//
Specifies DOS to load into HMA or UMB
Specifies FILES=30, BUFFES=30
STACKS=9,256 I ran into this stack segment setting before; it may make some DOS software unusable.
LASTDRIVE=N, sets the last drive letter to N

The remaining SUBs are all empty

*************
AUTOEXEC.BAT
*************

@ECHO OFF turn off display
set EXPAND=YES //*don't know what this variable is for, the later programs don't seem to use it*//
SET DIRCMD=/O:N //*don't know this environment variable either (moderator please explain)*//
XMSDSK 8192 N: /y specifies 8M XMS as RAMDRIVER, drive letter N
set temp=c:\ set temp folder to C:\
set tmp=c:\ same as above
set ramd=n marker variable for RAM DRIVER, used by later programs to determine the drive letter of RAMD
path=N:\;A:\;C:\ sets search path
cls clear screen
unzip /d /o CAB1.zip n:\ > nul extract CAB1.ZIP to the RAM virtual disk
EXTRACT /Y /e /L n: CAB2.CAB > nul ......CAB2.CAB............
copy command.com n:\ /y > nul copy command.com...........
copy vide-cdd.sys n:\ /y > nul ....vide-cdd.sys..........
set comspec=N:\command.com specify COMMAND.COM path.......
LH CTMOUSE.EXE > NUL mouse driver
LH N:\SMARTDRV.EXE cache
LH N:\DOSKEY.COM > NUL DOSKEY
GOTO %CONFIG% execute according to CONFIG.SYS SUB

OS
tw /np > nul run Chinese character support system
n:
cd \
GOTO END

:CDROM
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
tw /np > nul run Chinese character support system
N:
cd \
GOTO END

:GP
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
menua.bat batch file to start the graphical interface

:NOGP
menua.bat batch file to start the graphical interface

:END

***********
FINDCD.BAT
***********

@echo off turn off display
set cdrom= marker variable, used to store the CDROM drive letter

:LOOP
findcd -e find the CDROM drive letter, returns ERROR code
if errorlevel 255 goto NOCD determine the CDROM drive letter according to different returned ERROR codes
if errorlevel 0 set cdrom=A
if errorlevel 1 set cdrom=B
if errorlevel 2 set cdrom=C
if errorlevel 3 set cdrom=D
if errorlevel 4 set cdrom=E
if errorlevel 5 set cdrom=F
if errorlevel 6 set cdrom=G
if errorlevel 7 set cdrom=H
if errorlevel 8 set cdrom=I
if errorlevel 9 set cdrom=J
if errorlevel 10 set cdrom=K
if errorlevel 11 set cdrom=L
if errorlevel 12 set cdrom=M
if errorlevel 13 set cdrom=N
if errorlevel 14 set cdrom=O
if errorlevel 15 set cdrom=P
if errorlevel 16 set cdrom=Q
if errorlevel 17 set cdrom=R
if errorlevel 18 set cdrom=S
if errorlevel 19 set cdrom=T
if errorlevel 20 set cdrom=U
if errorlevel 21 set cdrom=V
if errorlevel 22 set cdrom=W
if errorlevel 23 set cdrom=X
if errorlevel 24 set cdrom=Y
if errorlevel 25 set cdrom=Z
goto END

:NOCD Why not run this SUB first, then run LOOP?
ctload VIDE-CDD.SYS /D:mscd001 load CD-ROM driver (I use OAKCDROM.SYS)
/D:MSCD001 specifies the device name as MSCD001. It can be changed, but it must be the same as MSCDEX.EXE's device name
CTLOAD may be a program that can still load device drivers after system startup, saving the need to load them in CONFIG.SYS,
LH MSCDEX.EXE /D:mscd001 file access format conversion under DOS, so DOS can process ISO9660 file format
GOTO LOOP

:END

******
Summary:
******

How some of the tricks used by this boot disk are implemented
1. > NUL is used to achieve no output (not really a trick to experts) >nul redirects the default display output to the null device NUL
There are other useful tricks too. For example, if a file's HELP is too long, you can redirect its HELP to a file, such as mode/? > mode.txt
(If you're interested, you can look up DOS redirection techniques and pipe | techniques)
2. It uses the ERRORLEVEL function. This is very useful and can improve the program's detection mechanism, running different programs according to different errors or states
3. GET It uses the file GET.EXE to detect keyboard input, such as GET N, and then below checks whether GET is equal to N.
4. Batch files use parameters, for example adding parameters after yiyesong.bat, then checking the parameters inside yiyesong.bat
if "%1"=="/cd" goto cd
if "%1"=="/a" goto a
if "%1"=="/?" goto help
if "%1"=="" goto null
goto end
5. Using LOCATE.COM to detect whether a file exists. For example locate.com %cdrom%:\yiyesong.bat /np /nr
If %cdrom%:\ is changed to %cdrom%: then it becomes a full-disk search. (What he called searching any directory is implemented this way)
Corresponding search methods
98SE locate %cdrom%: w98setup.bin /S:162939! /np /g:y
2000 locate %cdrom%: winnt.exe /s:81757! /c:"set dirname=&d" /np /G:Y
ME locate %cdrom%: w9xsetup.bin /S:181875! /np /g:y
Whether it is the "Yiyesong Software House Boot CD" locate.com %cdrom%:\yiyesong.bat /np /nr (this is an absolute path)
Actually it is just checking whether these 4 files exist, only without specifying an absolute path and doing a full-disk search. If you keep only these 4 files, you can easily
pass its detection mechanism.
For LOCATE.COM usage, just look at /?

6. Automatic installation for 98, ME, 2000: among the tools included on the 98 CD there is a program for making automatic installation scripts.
I forgot the specifics, everyone can look for it themselves. All information that needs to be entered during installation, including the serial number, can be made into a script to achieve a fully
automatic installation.
Specifically on this disk, the corresponding script files are: 98SE Msbatch.inf implementation method SETUP.EXE n:\MSBATCH.INF /IS
2000 Win2kpro.txt SETUP.EXE n:\MEBATCH.INF /IS
ME Mebatch.inf WINNT.EXE /u:n:\win2kpro.txt /s:%dirname%

To disable disk checking during 98 installation, add the /IS parameter. For a specific explanation, see SETUP/?

*******************************
Some unreasonable points and potential BUGs (personal opinion)
*******************************

**************
Program detection mechanism
**************
All batch programs that need to use the CD have 2 detection mechanisms: one checks whether the CD-ROM driver has been loaded, and the other checks
whether it is the "Yiyesong Software House Boot CD"
The detection mechanism is simple.
Example CD-YE.BAT
findcd -e
if not errorlevel 255 goto check
ctload n:\VIDE-CDD.SYS /D:MSCD001
call findcd.bat
This is used to detect whether the CD-ROM has been loaded. If not, it runs the loading batch file FINDCD.BAT. But this part of the program is not very efficient. When the CD-ROM was initially set up,
it used the variable CDROM to store the CD-ROM drive letter. As long as you check whether the value of this CDROM variable is empty, you can determine whether the CD-ROM has been loaded. There is no need to
search for CDROM again and check the error return code. Also, after this section checks whether the CD-ROM has been loaded, if it has not been loaded, it runs one load of VIDE-CDD.SYS,
and then this driver is called again later in FINDCD.BAT. Repeatedly loading the driver is inefficient.

*******************
FINDCD.BAT has a big BUG
*******************
If this machine has no CD-ROM drive at all, but CDROM boot is selected, FINCD.BAT will enter an infinite loop here
:LOOP
findcd -e
if errorlevel 255 goto NOCD
...
GOTO END

:NOCD
ctload VIDE-CDD.SYS /D:mscd001
LH MSCDEX.EXE /D:mscd001
GOTO LOOP

Because there is no CD-ROM drive, FINDCD's error return code is always 255, but if the return code is 255 it loads the CD-ROM driver again, and after loading the driver the return code is still 255...
Even if the BUG above is fixed
this issue may still cause problems later, because many .BAT files use the %CDROM% variable multiple times. If there is no CD-ROM drive, this variable becomes invalid, and all
.BAT files that use this variable may produce unexpected execution results.

There is also a habit issue: FINDCD.BAT and FINDCD.COM have the same filename. In an MSDOS system, FINDCD.COM takes priority over FINDCD.EXE, which takes priority over FINDCD.BAT.
If your system contains both FINDCD.BAT and FINGCD.COM, then to run the .BAT you must type the extension. Although when you use FINDCD.BAT you always
add the extension, if you have a large system and call it many times, one oversight can cause many unexpected results in your program. I suggest not using duplicate names in the future.

******************
CDROM.BAT has a potential BUG
******************
CALL FINDCD.BAT
IF EXIST n:\*.* GOTO END
xmsdsk 4096 N: /y If the computer booted with this disk has no CD-ROM drive, the program will run this line, but AUTOEXEC.BAT initially already specified loading an 8M
RAMDRIVER, and here it loads another 4M again and assigns the same drive letter N. I don't know what result this repeated loading will produce.
:END
%CDROM%:
CD \

****************
Changing the TEMP variable multiple times
****************
Some application batch files change the TEMP environment variable multiple times. Sometimes it is %RAMD%:\, sometimes C:\. If this machine has no partition or for some unexpected reason
drive C cannot be recognized, and this application just happens to need TMP/TEMP temporary storage space, then it will access drive C, but drive C cannot be recognized, so an error will definitely occur. Although this error
is not a major problem, it is still a nuisance for the user.


MENUA.BAT calls GOMENU.BAT, but this file does not exist, so the graphical interface of this boot disk cannot be seen.Open attachment

Teamwork !
Floor 2 Posted 2002-12-29 00:00 ·  中国 广东 佛山 三水区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
The analysis is quite good.
STACKS=9,256 This line is required for WIN3X, but unnecessary for WIN9X.
Using EXTRACT and UNZIP together wastes too much space; in fact just one is enough. AIN/RAR can also be used instead. You could even make the archive into a self-extracting file to save even more space.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 3 Posted 2002-12-29 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
PKZIP/PKUNZIP are the most convenient to use. Actually, finding the CD-ROM drive isn't that troublesome either; one or two commands are enough.

nre: VIDE-CDD.SYS is the best CD-ROM driver, who knows how many times better it is than OAKCDROM.SYS.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 4 Posted 2002-12-29 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
According to testing in a virtual machine, I need to correct some mistakes in the analysis above.
At first menustar couldn't run, and I thought GOMENU.BAT was missing. Later testing showed that
MENUSTAR just can't run under WIN,
that's all; GOMENU.BAT is generated by MENUSTAR. MENUSTAR does not actually run the .BAT corresponding to the selected item itself.
Instead it generates GOMENU.BAT, whose contents are CALL *the .BAT of the selected item*

*********
menua.bat
*********
menustar.exe graphical interface program; the menu is in menustar.cfg, and in Menustar.dat you can modify it yourself as needed
(it's a text file)
call gomenu.bat run the .BAT corresponding to the item selected in MENUSTAR
IF %setif%==0 GOTO quit test whether the CD classic edition in the menu was selected; if SETIF=0 then it was not selected
IF %setif%==Y GOTO Y when the CD classic edition is selected, Cd-ye.bat will run
and it will set SETIF to Y
GOTO loop

:Y
%CDROM%:\YIYESONG.BAT run YIYESONG.BAT on the CD

:quit
n:
cd \

:END

**********
About XMSDSK
**********
After testing, XMSDSK can recreate a RAMDISK with a new capacity after a RAMDISK has already been created, but the contents will be cleared
If the line xmsdsk 4096 N: /y is run in CDROM.BAT, the RAMDISK will be cleared, and all .BAT files that use
programs in the RAMDISK will fail.
But the section below cannot possibly reach the XMSDSK line. N:\ will definitely have files. So I ????
IF EXIST n:\*.* GOTO END
xmsdsk 4096 N: /y
:END
%CDROM%:

Teamwork !
Floor 5 Posted 2002-12-30 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
nre's analysis is very detailed and very accurate. It saved me the trouble, so I don't need to write a post analyzing my own boot disk for everyone. This disk was made a few months ago. I uploaded it just to share it with everyone, and I also hope everyone will offer more opinions and views so we can learn and improve together. I myself still haven't found any problems while using it (meaning in actual use). I really didn't consider the case of having no CD-ROM drive, but I figure no one without a CD-ROM drive would still click load CD-ROM, right? If any friends who downloaded it run into problems while using it, you can reply here or raise them in my original thread.
I've been rather busy lately. After some time, I will give a specific response based on the opinions of forum members and the points raised by nre.
nre is an expert, and I hope we can be friends. Contact me more when you have time, and let's discuss things together. At the same time, I also suggest to WENGIER that nre be made a moderator, to strengthen our DOS strength.


http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 6 Posted 2002-12-30 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
I've also switched to VIDE-CDD。SYS, and it's pretty good, small and fast.
By the way, a question for WENGIER: how do you use 1 or 2 commands to find the CD-ROM drive?
FINDCD -C can return the first CD-ROM drive letter, but I can't assign the returned value to a variable. Do you have any good ideas?~

Teamwork !
Floor 7 Posted 2002-12-30 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
YIYESONG, do you have detailed documentation for UMBPCI.SYS? I want to find a UMB/EMS driver to replace EMM386.EXE, because I think EMM386.EXE compatibility isn't very good, at least it conflicts with the VPC virtual machine.

Teamwork !
Floor 8 Posted 2002-12-30 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
Here is the latest download for UMBPCI. It includes detailed usage instructions and the supported motherboard situations.
Open attachment
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 9 Posted 2002-12-30 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
nre: In the introduction for FINDCD in the "script tools" section of my website, there is the following sentence:

For example: FINDCD -a|NSET CDROM=$1 will store the drive letter of the first CD in the variable CDROM.

Among them, NSET is a batch tool that can store specified screen output into a specified variable. It can be downloaded in "script tools".
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 10 Posted 2002-12-31 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
Not bad, not bad, this is great~

Teamwork !
Floor 11 Posted 2002-12-31 00:00 ·  中国 北京 263网络通信股份有限公司
银牌会员
★★★
nre
Credits 1,210
Posts 361
Joined 2002-12-28 00:00
23-year member
UID 629
Gender Male
Status Offline
wengier: what's your website URL~

Teamwork !
Floor 12 Posted 2002-12-31 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
My website's URL used to be wendos.mycool.net, but it has already been deleted. Now only the webpage mirror on newdos.yginfo.net remains.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Forum Jump: