Help to Code Bootup Options in Config.sys and Autoexec.bat

Getting old software/games running on older hardware.

Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby GabrielKnight123 » 2018-2-12 @ 15:08

Hi all Ive been looking at my Dos book and an advanced boot disk that has options for things like booting up with EMS on or off or CDrom on or off and I did what I could and got it half working but when I select the option for the EMS it does that right but skips the options for which mouse program, here is what I have im using Dos 6.2 for the boot up options

Config.sys

[MENU]
menuitem=EMS, Start PC With EMS Ram.
menuitem=NOEMS, Start PC Without EMS Ram.

[COMMON]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF

[EMS]
DEVICE=C:\DOS\EMM386.EXE RAM AUTO HIGHSCAN I=B000-B7FF

[NOEMS]
DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN I=B000-B7FF

[COMMON]
DEVICE=C:\CTCM\CTCM.EXE
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\oakcdrom.sys /D:mscd001
FILES=80
BUFFERS=60

[MENU]
menuitem=MOU1, Start PC With Mouse.com
menuitem=MOU2, Start PC With BBBMouse.com

[MOU1]
[MOU2]

Autoexec.bat

Soundblaster settings as normal
PROMPT $P$G
SET PATH=C:\DOS;C:\MOUSE;C:\CDROM
SET TEMP=C:\DOS
LH C:\CDROM\MSCDEX.EXE /D:mscd001 /L:D

if %CONFIG% == MOU1 LH C:\MOUSE\MOUSE.COM
goto end

if %CONFIG% == MOU2 LH C:\MOUSE\BBBMOUSE.COM
goto end

:END

Im not very savy with programming but all help will be appreciated.
GabrielKnight123
Member
 
Posts: 305
Joined: 2017-3-03 @ 15:39

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby kixs » 2018-2-12 @ 15:14

I used to do this with only one MENU. Not sure you can have multi.
My Amibay: SALE | BUY - Updated on 2018-07-17
User avatar
kixs
l33t
 
Posts: 2099
Joined: 2013-1-31 @ 02:08
Location: Slovenia, EU

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby derSammler » 2018-2-12 @ 15:38

In autoexec.bat, use "GOTO %config%" and create jumps marks.

Also, as kixs suggested, do not use markers twice.
derSammler
Oldbie
 
Posts: 1779
Joined: 2017-4-14 @ 11:30
Location: Germany

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby konc » 2018-2-12 @ 15:47

Exactly, ditch the IF from autoexec and use labels.
For what you're asking the common approach was to create 4 different menuitems. ems+mouse1, ems+mouse2, noems+mouse1, noems+mouse2
User avatar
konc
Oldbie
 
Posts: 1019
Joined: 2013-1-14 @ 15:09
Location: Greece

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby derSammler » 2018-2-12 @ 15:57

Why two different versions of mouse drivers anyway? Use and always load cutemouse and you're probably set.
derSammler
Oldbie
 
Posts: 1779
Joined: 2017-4-14 @ 11:30
Location: Germany

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby GabrielKnight123 » 2018-2-12 @ 17:03

I have two mouse versions because one works well with all my games except one and thats for the game Kings Quest I dont remember at the moment which one, I was basing all this off of an advanced boot disk I downloaded that has the ability to choose an option from a list then more options from another list until it got to the end of options I was hoping someone could type out how to do this as I dont know what a Label is as my programming skills are at a minimum. I can make and use 4 menuitems like what konc said but I would like the way of a nice clean option 1 of 2 then option 2 of 2 type.
GabrielKnight123
Member
 
Posts: 305
Joined: 2017-3-03 @ 15:39

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby konc » 2018-2-12 @ 17:37

You're over-complicating things and introduce more keystrokes/time for every boot. We didn't use to do this back in the days for a reason. But anyway it's your call of course, find below the basic structure you need to accomplish it:

config.sys
Code: Select all
[MENU]
SUBMENU=EMS
SUBMENU=NOEMS

[EMS]
MENUITEM=MOUSE1
MENUITEM=MOUSE2

[NOEMS]
MENUITEM=MOUSE1
MENUITEM=MOUSE2

[MOUSE1]
[MOUSE2]


autoexec.bat
Code: Select all
GOTO %CONFIG%

:MOUSE1
load mouse driver1
GOTO EXIT

:MOUSE2
load mouse driver2
GOTO EXIT

:EXIT


Since you're already familiar with the [COMMON] block in config.sys and the use of labels in batch files is demonstrated, you should be able now to tweak it to your needs.
But do you see the trade-off for such a menu? In autoexec you end up only with the final selection. In your rather simple case it doesn't really pose a problem, but imagine having to deal with different autoexec lines for the initial [EMS] / [NOEMS] choice ;)
User avatar
konc
Oldbie
 
Posts: 1019
Joined: 2013-1-14 @ 15:09
Location: Greece

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby tpowell.ca » 2018-2-12 @ 20:01

I had a similar situation where I needed more control over options from my config.sys file.
Like, say you also use the boot menu to run things like softMPU which only works if EMM386 is loaded, or conversely MXK6OPT which can only run if it isn't.

You can use SET xxx=yyy as early as config.sys in the boot process.


Not the greatest example, but once you start adding a CD-ROM, EMS, noEMS, XMS, Windows98 (boot to gui disabled) to the list of possibilities, managing your autoexec can get very messy.
Especially when some drivers are dependent on some of the conditions above.

So you can have something like this:

Config.sys

[MENU]
menuitem=EMS, Start PC With EMS Ram.
menuitem=NOEMS, Start PC Without EMS Ram.
menuitem=XMS, Start PC With XMS Ram.

[COMMON]

[EMS]
SET MEM=EMS
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE RAM AUTO HIGHSCAN I=B000-B7FF

[NOEMS]
SET MEM=EMS
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN I=B000-B7FF

[XMS]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
SET MEM=XMS


Autoexec.bat

Soundblaster settings as normal
PROMPT $P$G
SET PATH=C:\DOS;C:\MOUSE;C:\CDROM
SET TEMP=C:\DOS
LH C:\CDROM\MSCDEX.EXE /D:mscd001 /L:D

if %MEM% == XMS c:\k6\mxk6opt.exe
if NOT %MEM% == XMS LH C:\MIDI\softMPU.exe

:END
    Merlin: MS-4144, AMD5x86-160, 32MB, 16GB CF, ZIP100, ESS688, GUS, S3 VirgeGX 2MB, HardMPU
    Newton: K6XV3+/66, AMD K6-III+500, 256MB, 32GB SSD, AWE32, GUS 16MB, Voodoo3-3k
    Einstein: P8P400, P4-3GHz HT, 1.5GB, Quadro4 980XGL, Live!
User avatar
tpowell.ca
Member
 
Posts: 306
Joined: 2017-12-13 @ 21:57
Location: Montreal

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby derSammler » 2018-2-12 @ 20:04

Completely pointless, as %config% contains the name of the selected menu item automatically.
derSammler
Oldbie
 
Posts: 1779
Joined: 2017-4-14 @ 11:30
Location: Germany

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby tpowell.ca » 2018-2-12 @ 20:21

derSammler wrote:Completely pointless, as %config% contains the name of the selected menu item automatically.


I thought so too initially but could not find a clean way of managing the wide range of different configurations I had.


How would you handle different configs such as:
- Conventional memory
- XMS
- EMM386 noems
- EMM386
- CD-ROM with any of the above
- Windows98

In autoexec:
Only load a mouse driver if not conventional memory only.
Only load the CD-ROM driver if one of the four CD-ROM configs was selected.
Only load the setmul (K6+ multiplier utility) if NOT using any form of EMM386 or loading windows.
Only load softMPU if EMM386 or EMM386 noems is loaded.
...

I found no way to do the above and still have a clean autoexec.bat file without using the extra environment variables.
    Merlin: MS-4144, AMD5x86-160, 32MB, 16GB CF, ZIP100, ESS688, GUS, S3 VirgeGX 2MB, HardMPU
    Newton: K6XV3+/66, AMD K6-III+500, 256MB, 32GB SSD, AWE32, GUS 16MB, Voodoo3-3k
    Einstein: P8P400, P4-3GHz HT, 1.5GB, Quadro4 980XGL, Live!
User avatar
tpowell.ca
Member
 
Posts: 306
Joined: 2017-12-13 @ 21:57
Location: Montreal

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby konc » 2018-2-13 @ 07:05

@tpowell.ca, derSammler is right. What you're doing is pointless. You can just use the labels in autoexec as it is expected and documented. Let's examine one of your requirements: "Only load softMPU if EMM386 or EMM386 noems is loaded."

Code: Select all
GOTO %CONFIG%
:EMS
LH C:\MIDI\softMPU.exe
GOTO EXIT
:NOEMS
LH C:\MIDI\softMPU.exe
GOTO EXIT
:XMS
GOTO EXIT
:EXIT


You might argue that I'm duplicating lines and you're keeping autoexec clean, but I doubt IFs make it cleaner. Plus the wasted environmental variables space. Anyway, of course what you did works fine, I'm only showing the intended way and that SETs aren't necessary.
User avatar
konc
Oldbie
 
Posts: 1019
Joined: 2013-1-14 @ 15:09
Location: Greece

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby dr_st » 2018-2-13 @ 08:14

In general, Config.sys boot options is one of these things where I found that people mess way too much with them. It seems that people get into the mindset that if a feature exists, then it must be good for something and so should be used gratuitously.

I used to do this myself, and then I found out that 99% of games/apps will run with a single rounded configuration, which includes HIMEM, EMM, CDROM, mouse and audio drivers.

The esoteric thing that does not run with EMM386 - can be solved by putting just a single extra option that does not load EMM386. Optionally, if you still need the other drivers and lots of conventional memory, you can try use UMBPCI in that case. Apparently I never needed to run such games/utilities, so I didn't even need this second configuration option.

Even if you do, a lot of times you will find that in such an environment you don't need any extra drivers, so you can just reboot (which you need to do anyways to select a different configuration), and hit F5 to skip startup files altogether, and there you go - the barest, purest DOS environment.

You may think something like - I want this config to load the SETMUL automatically, and that config to load WIN automatically, so I suddenly need 10 more options... Horseshit. For the 1 game out of 100 that requires SETMUL, just load it before you start the game. When you need to run Windows, just type WIN and be done with it. ASOASF.
User avatar
dr_st
Oldbie
 
Posts: 1432
Joined: 2015-4-09 @ 07:18

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby tpowell.ca » 2018-2-13 @ 17:16

dr_st wrote:In general, Config.sys boot options is one of these things where I found that people mess way too much with them. It seems that people get into the mindset that if a feature exists, then it must be good for something and so should be used gratuitously.

I used to do this myself, and then I found out that 99% of games/apps will run with a single rounded configuration, which includes HIMEM, EMM, CDROM, mouse and audio drivers.

The esoteric thing that does not run with EMM386 - can be solved by putting just a single extra option that does not load EMM386. Optionally, if you still need the other drivers and lots of conventional memory, you can try use UMBPCI in that case. Apparently I never needed to run such games/utilities, so I didn't even need this second configuration option.

Even if you do, a lot of times you will find that in such an environment you don't need any extra drivers, so you can just reboot (which you need to do anyways to select a different configuration), and hit F5 to skip startup files altogether, and there you go - the barest, purest DOS environment.

You may think something like - I want this config to load the SETMUL automatically, and that config to load WIN automatically, so I suddenly need 10 more options... Horseshit. For the 1 game out of 100 that requires SETMUL, just load it before you start the game. When you need to run Windows, just type WIN and be done with it. ASOASF.


When you mix DOS4GW (or other DOS extenders) games with older games that require stupid amounts of conventional memory with EMS, some using a mouse and others not...
And using F5 isn't an option since you lose all the environment setup from autoexec.bat, unless you run it manually after.
Also, I'm using literally 2 environment variables (CD and MEM). Now everything works, and my autoexec.bat is easy to maintain. One entry for each of the options.

To each their own, but I wish it were true for the array of games I play.
    Merlin: MS-4144, AMD5x86-160, 32MB, 16GB CF, ZIP100, ESS688, GUS, S3 VirgeGX 2MB, HardMPU
    Newton: K6XV3+/66, AMD K6-III+500, 256MB, 32GB SSD, AWE32, GUS 16MB, Voodoo3-3k
    Einstein: P8P400, P4-3GHz HT, 1.5GB, Quadro4 980XGL, Live!
User avatar
tpowell.ca
Member
 
Posts: 306
Joined: 2017-12-13 @ 21:57
Location: Montreal

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby dr_st » 2018-2-13 @ 18:02

tpowell.ca wrote:When you mix DOS4GW (or other DOS extenders) games with older games that require stupid amounts of conventional memory with EMS, some using a mouse and others not...
You are envisioning problems that are not actual problems.

My single config gives me XMS, EMS, mouse, CDROM, audio and SMARTDRV (+DOSKey, a personal favorite of mine), with 621KB of free conventional memory (624KB if IFSHLP/DBLBUFF are excluded). That's literally the highest amount you can get; no game requires more than that. It also uses rather conservative EMM386 switches, which very few games conflict with. I don't remember the last time I had a game that conflicted, but they do exist.

For the others, you would typically be fine with a similar config excluding EMM386 (and if it's also a game that requires 'stupid amount of conventional memory', which is an even less common scenario, use UMBPCI to enable upper memory without EMM386). Nothing even remotely sane conflicts with the presence of a mouse driver or a CDROM driver. You would be fine with just two options.

tpowell.ca wrote:And using F5 isn't an option since you lose all the environment setup from autoexec.bat, unless you run it manually after.
I agree with you, but if your workflow has only 1-2 rare cases that don't work with the standard config, it may be a simple workaround.

tpowell.ca wrote:Also, I'm using literally 2 environment variables (CD and MEM). Now everything works, and my autoexec.bat is easy to maintain. One entry for each of the options.

To each their own, but I wish it were true for the array of games I play.
True, to each his own, but as was pointed out to you, just using %CONFIG% with no auxiliary variables can cover all your options.
Last edited by dr_st on 2018-2-13 @ 21:44, edited 1 time in total.
User avatar
dr_st
Oldbie
 
Posts: 1432
Joined: 2015-4-09 @ 07:18

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby Azarien » 2018-2-13 @ 18:22

You can also add MENUDEAULT to your [MENU] section to setup timeout so that you don't have to select an option manually each time.

[MENU]
...
MENUDEFAULT=YOUR_BEST_OPTION,3

and, if I remember correctly, it is possible to have SUBMENU=MENU as a way to go back to the main menu from a submenu.
Azarien
Oldbie
 
Posts: 579
Joined: 2015-5-14 @ 07:14

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby konc » 2018-2-13 @ 18:35

@dr_st, I agree with every word you wrote. Including the horseshit thing.
Guys that's an actual/practical/realistic approach. Back in the days no one ever had 10 different configs resulting in +- a few KBs of conventional memory, as if anything ever required it.
User avatar
konc
Oldbie
 
Posts: 1019
Joined: 2013-1-14 @ 15:09
Location: Greece

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby tpowell.ca » 2018-2-13 @ 20:09

dr_st wrote:
tpowell.ca wrote:My single config gives me XMS, EMS, mouse, CDROM and audio (+DOSKey, a personal favorite of mine), with 621KB of free conventional memory (624KB if IFSHLP/DBLBUFF are excluded).


How did you get that much free memory with MSCDEX loaded?
As for cases where EMM386 is an issue is when I need to be able to use MXK6OPT on my K6-III+ to run newer DOS games (improves video throughput massively) or some old DOS demos.
    Merlin: MS-4144, AMD5x86-160, 32MB, 16GB CF, ZIP100, ESS688, GUS, S3 VirgeGX 2MB, HardMPU
    Newton: K6XV3+/66, AMD K6-III+500, 256MB, 32GB SSD, AWE32, GUS 16MB, Voodoo3-3k
    Einstein: P8P400, P4-3GHz HT, 1.5GB, Quadro4 980XGL, Live!
User avatar
tpowell.ca
Member
 
Posts: 306
Joined: 2017-12-13 @ 21:57
Location: Montreal

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby dr_st » 2018-2-13 @ 21:37

tpowell.ca wrote:How did you get that much free memory with MSCDEX loaded?
I posted my startup files here before. Check viewtopic.php?p=635201#p635201

Wow, almost forgot it includes SMARTDRV too. Yes, that's very important.

tpowell.ca wrote:As for cases where EMM386 is an issue is when I need to be able to use MXK6OPT on my K6-III+ to run newer DOS games (improves video throughput massively) or some old DOS demos.
I never used MXK6OPT myself, but I acknowledged that EMM386 can be an issue that justifies a config.sys menu option without it.
User avatar
dr_st
Oldbie
 
Posts: 1432
Joined: 2015-4-09 @ 07:18

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby GabrielKnight123 » 2018-2-13 @ 21:54

Azarien was right I found a good way to make a menu after a menu and I used GOTO %CONFIG% in the Autoexec.bat see below:

Autoexec.bat

PROMPT $p$g
SET PATH=C:\DOS;C:\MOUSE;C:\CDROM
SET TEMP=C:\DOS
LH C:\CDROM\MSCDEX.EXE /D:mscd001 /L:D

GOTO %CONFIG%

:1MOUSE
LH C:\MOUSE\MOUSE.COM
goto end

:1BMOUSE
LH C:\MOUSE\BBBMOUSE.COM
goto end

:2MOUSE
LH C:\MOUSE\MOUSE.COM
goto end

:2BMOUSE
LH C:\MOUSE\BBBMOUSE.COM
goto end

:end


Config.sys

[MENU]
submenu=EMS, Start PC With EMS Ram.
submenu=NOEMS, Start PC Without EMS Ram.

[EMS]
menuitem=1MOUSE, Start PC With Mouse.Com
menuitem=1BMOUSE, Start PC With BBBMouse.Com

[1MOUSE]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE RAM AUTO HIGHSCAN I=B000-B7FF
DEVICE=C:\CTCM\CTCM.EXE
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\oakcdrom.sys /D:mscd001
FILES=80
BUFFERS=60

[1BMOUSE]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE RAM AUTO HIGHSCAN I=B000-B7FF
DEVICE=C:\CTCM\CTCM.EXE
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\oakcdrom.sys /D:mscd001
FILES=80
BUFFERS=60

[NOEMS]
menuitem=2MOUSE, Start PC With Mouse.Com
menuitem=2BMOUSE, Start PC With BBBMouse.Com

[2MOUSE]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN I=B000-B7FF
DEVICE=C:\CTCM\CTCM.EXE
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\oakcdrom.sys /D:mscd001
FILES=80
BUFFERS=60

[2BMOUSE]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE NOEMS HIGHSCAN I=B000-B7FF
DEVICE=C:\CTCM\CTCM.EXE
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\oakcdrom.sys /D:mscd001
FILES=80
BUFFERS=60

[COMMON]
GabrielKnight123
Member
 
Posts: 305
Joined: 2017-3-03 @ 15:39

Re: Help to Code Bootup Options in Config.sys and Autoexec.bat

Postby dr_st » 2018-2-14 @ 08:09

Yep, that's much more elegant.

But why don't you just use CuteMouse like everyone else? It's likely you will not need the different mouse driver configs.
User avatar
dr_st
Oldbie
 
Posts: 1432
Joined: 2015-4-09 @ 07:18

Next

Return to Software

Who is online

Users browsing this forum: No registered users and 2 guests