Hi Jim,

> On Feb 2, 2024, at 8:07 PM, Jim Hall via Freedos-devel 
> <freedos-devel@lists.sourceforge.net> wrote:
> 
> Here's my second pass at cleaning up my FDAUTO.BAT file. If you like
> it, feel free to use it. This does a lot of streamlining from the
> "stock" FDAUTO.BAT in T2402.

Great idea. They can defiantly use simplification. The originals were made 
through the process of build, test, fix, build, text, fix, repeat and move on. 
They contained a lot of spaghetti and were long overdue for improvement. 

Just a couple notes for you while you work on them. 

1) The initial reason behind the separation of the IF and actual CALLS to 
external batch files was based on command line file length restrictions. During 
the early days, if the user would install FreeDOS to a non-standard and longer 
%DOSDIR% issues could occur. However with later improvements, I don’t thing it 
is necessary any longer. Take the longest call out as an example:

>> if exist %DOSDIR%\bin\cdrom.bat call %DOSDIR%\bin\cdrom.bat display

When the OS is installed to it’s default directory expands to:

if exist C:\FREEDOS\bin\cdrom.bat call C:\FREEDOS\bin\cdrom.bat display
(71 characters)

If the OS is installed to a non-standard directory, like C:\OS\DOS\FREEDOS\1.3\ 
(which I’ve done on multi-boot DOS systems), expands to:

if exist C:\OS\DOS\FREEDOS\1.3\bin\cdrom.bat call 
C:\OS\DOS\FREEDOS\1.3\bin\cdrom.bat display
(93 characters)

So, it is still fine and has room for about 15 more characters in the %DOSDIR%.

2) Your changes have things loading after the WELCOME message. I think that the 
WELCOME message (and TEST BUILD warning) should be the last thing shown.

3) These are not the only possible config files that may be installed. At 
present, there are 3 different FDAUTO files and 6 different FDCONFIG files that 
are installed based on various hardware platforms. 

Those can be found at: https://github.com/shidel/FDI/tree/master/FDISETUP/SETUP 
<https://github.com/shidel/FDI/tree/master/FDISETUP/SETUP>

There naming scheme is straight forward. AUTOEXEC.* becomes FDAUTO. CONFIG.* 
becomes FDCONFIG.SYS. There file extensions are based on the hardware platform.

*.DBX when installing to DOSBox.
*.VBX when installing to VirtualBox.
*.086 when installing to a 8086/8088 only.
*.186 when installing to a 80186 only.
*.286 when installing to a 20826 only.
*.DEF default file when no specific exact configuration file is 
required/provided.

Those files are used by both the Normal and Floppy Edition for installation. 

They also contain numerous simple macros that are processed by the installers 
during installation. 

Your changes will eventually need updated and ported and updated to these 
files. 

4) See embedded comment(s) below.


> I've pared it down to just a few jump
> points that are more readable to me: HIGH, LOW, and LOCALCFG. At a
> high level, it's organized this way:
> 
> 1. "Global" settings
> 2. Test the CPU
> 3. If we can support it, use HIGH
> 4. If we can't, use LOW
> 5. Local settings
> 
> This doesn't really change the free memory (maybe a tiny savings, due
> to order) but the most important is that I think it's easier to read.
> See the REM blocks at the top to see what's changed from the "stock"
> FDAUTO.BAT from T2402: the first REM block is from my first pass, the
> second block is from my second pass.
> 
> I decided to remove the hard-coded AUTOFILE and CFGFILE entries, since
> a user could rename their FDCONFIG.SYS to CONFIG.SYS (but the
> hard-coded values would still show the old FDCONFIG.SYS). The boot-up
> welcome message expects these values when it prints them out, but
> that's an easy fix.
> 
>> @ECHO OFF
>> 
>> REM - updated FDAUTO boot file
>> 
>> REM - changes: all command names are lowercase, all env vars uppercase,
>> REM - all "REM" are uppercase, all goto labels are uppercase.
>> REM - "mem" moved to end. All empty "echo." statements removed.
>> REM - streamline INITCDROM (only needs to be one line).
>> REM - streadmline SUPPORT386 (move test to top).
>> REM - moved local settings to FINAL.
>> REM - streamlined the LFN test (REM'd out anyway).
>> REM - streamlined the network test (user adds their own stuff anyway).
>> REM - removed unneeded ONLY8086 section (prev now jumps to FINAL).
>> 
>> REM - moved ctmouse to the end (local settings)
>> REM - moved DIRCMD and CPYCMD to the end (local settings)
>> REM - moved init cdrom to FINAL, removed INITCDROM goto label
>> REM - renamed FINAL to LOCALCFG
>> REM - removed hard-coded AUTOFILE and CFGFILE entries, and REM'd aliases
>> REM -   ..this breaks the welcome message, but fix that later
>> REM - moved aliases to LOCALCFG
>> REM - renamed SUPPORT286 and SUPPORT386 to SIMPLE and HIGH clearer)
>> REM - renamed SUPPORT386LOW to LOW
>> REM - actually, SIMPLE is not needed (same as LOW) so changed vinfo goto
>> REM -   ..and removed SIMPLE block
>> REM - expanded MEM /C /N to MEM /C /NOSUMMARY
>> REM - added vinfo tests for 101-104
>> REM - moved config 4 test up, next to config 5 test, don't need to test cpu
>> REM - fixed (not) loading FDAPM twice .. high and low
>> REM - if vinfo doesn't exist, jump to LOW instead of LOCALCFG
>> REM - if vinfo test 3-6, goto HIGH, otherwise goto LOW
>> REM - changed vinfo test from /m to /p (if VM, reports "6")
>> 
>> set DOSDRV=C:
>> set DOSDIR=C:\FreeDOS
>> 
>> set OS_NAME=FreeDOS
>> set OS_VERSION=T2402
>> 
>> set PATH=%DOSDIR%\BIN
>> if exist %DOSDIR%\LINKS\NUL set PATH=%path%;%DOSDIR%\LINKS

This should probably be broken into two lines. 

If the user adds custom paths to the PATH variable, it can easily exceed the 
126 character line limit during expansion. 


>> 
>> set LANG=EN
>> set TZ=UTC
>> 
>> set NLSPATH=%DOSDIR%\NLS
>> set HELPPATH=%DOSDIR%\HELP
>> 
>> set TEMP=%DOSDIR%\TEMP
>> set TMP=%TEMP%
>> 
>> if "%CONFIG%"=="5" goto END
>> if "%CONFIG%"=="4" goto LOW
>> 
>> if not exist %DOSDIR%\bin\vinfo.com goto LOW
>> 
>> vinfo /p
>> if errorlevel 6 goto HIGH
>> if errorlevel 5 goto HIGH
>> if errorlevel 4 goto HIGH
>> if errorlevel 3 goto HIGH

Since IF ERRORLEVEL is really a >= test, maybe just a comment a ERRORLEVEL 3 
test will be needed. 
Or, a NOT ERRORLEVEL 3 GOTO LOW.

>> 
>> goto LOW
>> 
>> :HIGH
>> 
>> lh fdapm APMDOS
>> REM lh share
>> 
>> REM if not exist %DOSDIR%\BIN\DOSLFN.COM goto LOCALCFG
>> REM lh %DOSDIR%\BIN\DOSLFN.COM
>> REM set DIRCMD=%DIRCMD% /LFN
>> 
>> goto LOCALCFG
>> 
>> :LOW
>> 
>> fdapm APMDOS
>> 
>> :LOCALCFG
>> 
>> if exist %DOSDIR%\bin\cdrom.bat call %DOSDIR%\bin\cdrom.bat
>> 
>> if exist %DOSDIR%\bin\fdnet.bat call %DOSDIR%\bin\fdnet.bat start

Hmmm, you removed the test that networking was successful started. 
That may not be a good idea. For instance, I have a system here that on
occasion the network driver does not initialize correctly. Attempting to start
additional software that depends on it can have unpredictable results. 

>> REM - add your own networking commands here: (if any)
>> 
>> if exist %DOSDIR%\bin\fdassist.bat call %DOSDIR%\bin\fdassist.bat

Just a side note. FDASSIST.BAT does not normally exist. It is not installed with
any of the Official FreeDOS release media. It is a call out provided for custom 
builds of the OS to load user assistance software. It eliminates the need for
distributions based on FreeDOS to try and manually revise the system config 
files.

There is at least one offshoot of FreeDOS that uses this callout to load 
software
to load screen reader software for the visually impaired. 

He also use the Release Build Environment to create current versions of FreeDOS 
quickly and easily. Occasionally, I will get messages from him when I improve 
the
RBE or critical packages that breaks something. :-)

>> if exist %DOSDIR%\bin\cdrom.bat call %DOSDIR%\bin\cdrom.bat display
>> if exist %DOSDIR%\bin\welcome.bat call %DOSDIR%\bin\welcome.bat

I think these should appear later in the batch file (see below).

>> 
>> REM - add your own settings here: (here are some examples)
>> 
>> REM nlsfunc %DOSDIR%\BIN\COUNTRY.SYS
>> REM display CON=(EGA,858,2)
>> REM mode CON CP PREP=((858) %DOSDIR%\CPI\EGA.CPX)
>> REM keyb US,858,%DOSDIR%\bin\keyboard.sys
>> REM chcp 858
>> REM mkeyb UK
>> 
>> set DIRCMD=/P /OGN /Y
>> set COPYCMD=/-Y
>> set BLASTER=A220 I5 D1 H5 P330
>> 
>> ctmouse
>> mem /C /NOSUMMARY

You are loading drivers after the WELCOME to FreeDOS message. 

Other than the Interim Test Build Warning Message, I think the WELCOME message 
should be the last thing displayed to the user.

>> 
>> alias reboot=fdapm warmboot
>> alias reset=fdisk /reboot
>> alias shutdown=fdapm poweroff
>> 
>> echo.
>> echo Warning: This is a FreeDOS development build and is for testing 
>> purposes.
>> echo It may exhibit behavior vary different from a release build and may not 
>> be
>> echo suitable for regular use. For general use, please consider using the 
>> latest
>> echo release build available at http://freedos.org
>> 
>> :END

The WELCOME and WARNING messages are not displayed with option 5.

> 
> _______________________________________________
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel 
> <https://lists.sourceforge.net/lists/listinfo/freedos-devel>

There are also the release media config files that could be improved. But, 
those are far less cluttered. 

:-)

Jerome
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to