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. 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
>
> 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
>
> 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
> REM - add your own networking commands here: (if any)
>
> if exist %DOSDIR%\bin\fdassist.bat call %DOSDIR%\bin\fdassist.bat
> if exist %DOSDIR%\bin\cdrom.bat call %DOSDIR%\bin\cdrom.bat display
> if exist %DOSDIR%\bin\welcome.bat call %DOSDIR%\bin\welcome.bat
>
> 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
>
> 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


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

Reply via email to