Solved

detecting boot option?

Posted on 1998-01-05
18
169 Views
Last Modified: 2013-12-16
When Win95 boots, it presents a menu with several choices.  The "Normal" option runs the Win95 GUI and the "Command Prompt Only" stays at the DOS 7.1 prompt (I run OSR2).  The other options are not relevant to the question.

Now here is what I want to accomplish:

I would like to load real-mode drivers if the "Command Prompt Only" option is selected but not if the "Normal" option is selected.

Problem is, how do I detect the boot option from CONFIG.SYS?

Before you answer, there are several methods that I've already tried and rejected.  So unless you think I overlooked something, please don't bother repeating them:

* Use the "Previous DOS Version" setting.
I already use it for a previous version of (DOS 6.22).  I need to make the distinction under DOS 7.1 (that comes as a part of Win95/OSR2).

* Use the [menu] options in GONFIG.SYS.
I don't want to have *two* menus (I need the first one to boot to DOS 6.22 or for "Safe Mode").

* Buy a program that accomplishes it.
No thanks.

Any suggestions?
0
Comment
Question by:alexo
  • 7
  • 6
  • 5
18 Comments
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
Virtual drivers are necessary for certain function of windows.
Can you tell me which drivers you want to load.

One for instance is vcache.vxd.
95 is not going to run very well without it.
the same with   vmm32.
0
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
alexo,
take a look at the bootstrap at;
http://premium.microsoft.com/support/kb/articles/q174/0/18.asp
-----here's an excerpt.
Real-mode VxDs can be loaded into memory in any of the following ways:

- Real-mode device drivers or TSRs that respond to the Windows 95
INT2F broadcast load their embedded VxDs when Windows 95 starts.

- Drivers internal to the Vmm32.vxd file that are not "marked" are
loaded from the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD

If the real-mode virtual device driver loader finds a "marked"
driver, it changes its registry entry from a VxD (a driver preceded
with an asterix "*") to a file with a .vxd extension so that the
external driver is found in the Windows\System\Vmm32 folder. When
the external driver is found, it is loaded into memory.

- VxDs that are not already loaded by the Vmm32.vxd file are loaded
from the [386 Enh] section of the Windows\System.ini file.

- Some VxDs are required for Windows 95 to run properly. These
required VxDs are loaded automatically and do not require a registry
entry. The following VxDs are required by Windows 95:

*BIOSXLAT   *CONFIGMG    *DYNAPAGE
*DOSMGR     *EBIOS       *IFSMGR
*INT13      *IOS         *PAGESWAP
*SHELL      *V86MMGR     *VCD
*VCACHE     *VCOMM       *VCOND
*VDD        *VDMAD       *VFAT
*VKD        *VMCPD       *VPICD
*VTD        *VTDAPI      *VWIN32
*VXDLDR


5.The real-mode virtual device driver loader checks that all required VxDs loaded sucessfully. If not, it attempts
to load the drivers again.

6.Once the real-mode virtual device driver loading is logged, driver initialization occurs. If there are any VxDs
that require real-mode initialization, they begin their process in real-mode.

7.Vmm32 switches the computer's processor from real-mode to
protected- mode.

8.A three-phase VxD initialization process occurs in which
the drivers are loaded according to their InitDevice
instead of the order in which they are loaded into memory.
The VxDs are carried out in the following
sequence:

a. SYS_CRITICAL_INIT (SYSCRITINIT):

Interrupts are disabled during this phase. This gives VxDs
time to prepare for device initialization without being
interrupted by the system. No file I/O is allowed during
SYSCRITINIT, so all SYSCRITINITs are not written to the
Bootlog.txt file until after SYSCRITINIT is complete for
all VxDs.

b. SYS_DEVICE_INIT (DEVICEINIT)

The bulk of the VxD initialization takes place during this phase. File I/O is allowed during DEVICEINIT, so each
VxD's DEVICEINIT is logged as it occurs. The one exception is during Ifsmgr's DEVICEINIT. Ifsmgr takes over the
real-mode file system, and disk I/O is not allowed until Ifsmgr's DEVICEINIT succeeds. For this reason, Ifsmgr does
not appear in the DEVICEINIT phase.

When a DevLoader VxD is called, it loads other drivers it is responsible for, regardless of their InitDevice order. The
DevLoader examines the Registry and finds drivers (for example, portdrivers [such as.mpd files]) and any associated
support drivers. It then initializes the device associated with these drivers. During this phase, if a VxD failed to
initialize, it was unable to properly communicate with the hardware or service it drives. Typically, this is due to
incorrect hardware settings or the service not being installed.

The remaining static VxDs continue with the initialization phase. Also, dynamic VxDs may begin initializing during
this phase. They do not have a SYSCRITINIT phase. However, a dynamic VxD may also load anytime after Windows
95 has started.

c. SYS_INIT_COMPLETE (INITCOMPLETE)

VxDs that successfully pass the InitComplete phase should be working properly. If a VxD was listed in one of the
previous phases but is not successful in this phase, that VxD is unloaded from memory.

GUI Components:

After all the static VxDs are loaded, the Krnl32.dll, Gdi.exe, User.exe, and Explorer.exe (the default Windows 95
shell) files are loaded.

Network Environment and Multi-User Profiles:

The next step in the startup process is to load the network environment. Once this occurs, the user is prompted to log
on to the network that is installed.

Windows 95 allows multiple users to save their custom desktop settings. When a user logs on to Windows 95, their
desktop settings are loaded from the registry. If the user does not log on, the desktop configuration uses a default
desktop.

StartUp Group and RunOnce Programs:

Programs in the StartUp group and the RunOnce registry key are run during the last phase of the startup process.
After each program in the RunOnce registry key is started, the program is removed from the key.
===========
That's a lot of [Real mode Virtual] drivers. Sounds rather paradoxical don't you think:)

However, your [386 Enh] section of the Windows\System.ini file
seem to be the KEY here, rather than your config.sys.

I'd be tickled to help you work on this as it's a new one on me.


0
 
LVL 11

Author Comment

by:alexo
Comment Utility
Smeebud, thanx for the detailed explanation.
However it is irrelevant to the question.

I am asking about real-mode *DOS* drivers, not Windows VxDs.

Again:

If the user selects "command prompt only", I'd like to load a DOS ASPI driver, a DOS SCSI CD-ROM driver and (later, in autoexec) MSCDEX.

Otherwise, If the user selects "normal", I know that Win95 will handle the devices and I don't need DOS-level drivers.

0
 
LVL 14

Accepted Solution

by:
smeebud earned 100 total points
Comment Utility
OK. it took a while for that to sink in but here's what I do as i boot with a menu also;
See if this is acceptable.
You make a batch/.bat file. for instance, i named this one
O.bat
===
ECHO OFF
C:\ANKO\MOUSE.COM
====
When I boot to prompt and need my mouse i only have to type
O then {enter)

One extra stroke of the key.
Let me know if one extra key stroke is acceptable and I'll proceed.
0
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
I'm brainstorming. Think with me alexo.
Take a look at the properties of your "win.com".
1st. We can run "without a extra keystroke" a .bat file
Or at.
Program Tab/Advanced/Specify a new MSDOS configuration.

0
 
LVL 25

Expert Comment

by:dew_associates
Comment Utility
Why not boot through to Windows 95 and use a Dos pif (shortcut) with dedicated autoexec.bat and config.sys files to do as you require in real mode. It would be so much easier than re-inventing the wheel! In this manner you could move easily back and forth between Win95 and Dos 7.1.
Dennis
0
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
I think we are talking about the same thing aren't we Dennis.
I'm speaking of the win.com pif.
0
 
LVL 11

Author Comment

by:alexo
Comment Utility
The batch file approach is not acceptable since I have yet to find a way to load a SCSI driver from a batch file.

About the WIN.COM properties - I don't understand the suggestion.  Please give more details.

The basic requirement is:

* When I'm in DOS 7.1, I need some real-mode drivers loaded.
* When I'm in Win95 GUI, none of the above drivers shall be in memory.
* Both modes also have different EMM386 switches, etc.

Now, about Dennis'es suggestion:

If I have a DOS-mode PIF with dedicated startup files, what happens when I return to Win95 GUI?
My guess is that the drivers and TSRs loaded by the dedicated startup files will remain resident, which is unacceptable.

Alex.

0
 
LVL 25

Expert Comment

by:dew_associates
Comment Utility
Alex. Not true, when you establish dedicated files to be used with a windows 95 dos session, windows loads them for that session and unloads them when the session is completed.

Bud, actually no, there is a difference. Your moving to a dos session then implementing the batch. I'm talking about a dos session implemented through a pif that has dedicated files such as a dedicated config.sys and autoexec.bat associated with it to alter the real mode state of the machine while in Dos which can then be unloaded when the Dos session terminates.
Dennis
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 11

Author Comment

by:alexo
Comment Utility
I'll try that and get back to you.
0
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
Dennis,
If not a Win.com Advanced section where alexo can define his
example, C:\xxx\autoexec and config.
Then where. I know I'm missing something here???
0
 
LVL 25

Expert Comment

by:dew_associates
Comment Utility
Bud: Create a simple batch file, it doesn't have to have anything really in it other than maybe a simple parameter or nothing at all. Create a shortcut to it, Windows 95 creates the Dos pif for it. Open the properties of the Dos pif, go to the Programs Tab and you can add an additional batch file if need be, and/or click Advanced and add a batch specific autoexec.bat and config.sys. The eliminates the need to make any changes in Win.com that may prove to be a problem later. Also, this will permit Windows to unload anything loaded by the batch, the config.sys and autoexec.bat.
0
 
LVL 11

Author Comment

by:alexo
Comment Utility
Is there a URL when the mechanism details are documented in depth?
I'm not talking about "how-to" stuff.  I want to get technical.
0
 
LVL 25

Expert Comment

by:dew_associates
Comment Utility
Pardon me?
0
 
LVL 11

Author Comment

by:alexo
Comment Utility
Never mind, I found an answer at http://www.orca.bc.ca/win95/faq12.htm#b12_11
Wouldn't mind a pointer to something that goes deeper in detail but that'll suffice.

I'll try it on the Win95 machine when I have some free time (might take a few days).

That leaves open the question of 100 points.  Who should get it?
Smeebud's comment came first, Dennis'es was more detailed.

Be back sunday.
0
 
LVL 14

Expert Comment

by:smeebud
Comment Utility
I don't mind leaving this hang until you have you problem fixed
alexo. But you do what you heart tells you. If I'm to get a poor grade, well I'd rather not have it.
0
 
LVL 25

Expert Comment

by:dew_associates
Comment Utility
I'm not concerned about the points issue either. I rather the issue be resolved.
0
 
LVL 11

Author Comment

by:alexo
Comment Utility
Poor grade?  Nahhh...  I won't ruin your reputation.
Although the original question remains unanswered (I still think it is possible), this is an interesting solution.  Thus, I think, a B.
(BTW, got a bunch of "autograded" C's lately.  Yuck!).

Bye.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now