Hi everyone

The new T2403 release prompted me to finish updating the FDAUTO.BAT file.

Quick background: This started because I was looking to prevent the
CTMOUSE driver from loading .. but it was a bit hard to read the
FDAUTO file. So I simplified it on my end.

This should do everything the previous FDAUTO did - I just moved
things around. Interestingly, I also freed up a tiny amount (160
bytes) of memory. Here's the MEM output from a fresh boot before I
made changes:

> Memory Type        Total       Used       Free
> ----------------  --------   --------   --------
> Conventional          639K        33K       606K
> Upper                   0K         0K         0K
> Reserved              385K       385K         0K
> Extended (XMS)     31,616K       433K    31,183K
> ----------------  --------   --------   --------
> Total memory       32,640K       851K    31,789K
>
> Total under 1 MB      639K        33K       606K
>
> Total Expanded (EMS)                8,816K (9,027,584 bytes)
> Free Expanded (EMS)                 8,192K (8,388,608 bytes)
>
> Largest executable program size       605K (619,552 bytes)
> FreeDOS is resident in the high memory area.

And here's the MEM output from a fresh boot with the new FDAUTO file:

> Memory Type         Total      Used       Free
> ----------------  --------   --------   --------
> Conventional          639K        33K       606K
> Upper                   0K         0K         0K
> Reserved              385K       385K         0K
> Extended (XMS)     31,616K       433K    31,183K
> ----------------  --------   --------   --------
> Total memory       32,640K       851K    31,789K
>
> Total under 1 MB      639K        33K       606K
>
> Total Expanded (EMS)                8,816K (9,027,584 bytes)
> Free Expanded (EMS)                 8,192K (8,388,608 bytes)
>
> Largest executable program size       605K (619,712 bytes)
> FreeDOS is resident in the high memory area.

160 bytes isn't much, but I thought it was interesting. :-)

The original FDAUTO was 98 lines, my cleaned up FDAUTO file is 101
lines but I think it's easier to read. The general idea is to put
"system" stuff at the top, and "user" stuff at the end. In summary, it
sets a few env variables, then loads CPU-specific configs (for
example: LFN and CDROM on 386+, ..) then loads the "supporting" BAT
files if they are there. I moved the user's local settings (BLASTER,
DIRCMD, aliases, ..) to the end of the file:

> @ECHO OFF
> REM - Updated AUTOEXEC file
>
> REM - set basic environment
>
> set DOSDRV=C:
> set DOSDIR=%DOSDRV%\FREEDOS
>
> path %DOSDIR%\BIN
> if not exist %DOSDIR%\LINKS\NUL goto NOLINKS
> path %PATH%;%DOSDIR%\LINKS
> :NOLINKS
>
> set NLSPATH=%DOSDIR%\NLS
> set HELPPATH=%DOSDIR%\HELP
>
> set TEMP=%DOSDIR%\TEMP
> set TMP=%TEMP%
>
> if "%CONFIG%"=="5" goto END
>
> set OS_NAME=FreeDOS
> set OS_VERSION=T2403
>
> REM - cfgfile and autofile might be deprecated in future
>
> set CFGFILE=%DOSDRV%\FDCONFIG.SYS
> set AUTOFILE=%DOSDRV%\FDAUTO.BAT
> alias cfg=edit %CFGFILE%
> alias auto=edit %AUTOFILE%
>
> REM - detect CPU, load CPU-specific configs
>
> if not exist %DOSDIR%\BIN\VINFO.COM goto ENDCPU
> %DOSDIR%\BIN\VINFO.COM /m
> if errorlevel 3 goto CPU386
> if errorlevel 2 goto CPU286
> goto ENDCPU
>
> :CPU286
>
> fdapm APMDOS
> ctmouse
>
> goto ENDCPU
>
> :CPU386
> if "%CONFIG%"=="4" goto CPU286
>
> lh fdapm APMDOS
> lh ctmouse
> REM lh share
>
> if not exist %DOSDIR%\BIN\DOSLFN.CON goto NOLFN
> lh %DOSDIR%\BIN\DOSLFN.CON
> REM - Add other stuff here once LFN is loaded..
> :NOLFN
>
> if not exist %DOSDIR%\BIN\CDROM.BAT goto NOCDROM
> call %DOSDIR%\BIN\CDROM.BAT
> REM - Add other stuff here once CDROM is loaded..
> :NOCDROM
>
> :ENDCPU
>
> REM - load other configs using external BAT files
>
> if not exist %DOSDIR%\BIN\FDNET.BAT goto NONET
> call %DOSDIR%\BIN\FDNET.BAT
> REM - Add other stuff here once FDNET is loaded..
> :NONET
>
> if not exist %DOSDIR%\BIN\FDASSIST.BAT goto NOASSIST
> call %DOSDIR%\BIN\FDASSIST.BAT
> :NOASSIST
>
> if not exist %DOSDIR%\BIN\WELCOME.BAT goto NOHELLO
> call %DOSDIR%\BIN\WELCOME.BAT
> :NOHELLO
>
> MEM /C /N
>
> REM - local settings
>
> set BLASTER=A220 I5 D1 H5 P330
> set DIRCMD=/O:GNE /Y
> set COPYCMD=/-Y
>
> 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
>
> alias reset=fdisk /reboot
> alias reboot=fdapm warmboot
> alias halt=fdapm poweroff
> alias shutdown=fdapm poweroff
>
> :END



Personally, I'm not a fan of cfgfile and autofile since the user could
always rename FDCONFIG.SYS in favor of using CONFIG.SYS .. but FDAUTO
will still report "Done processing startup files C:\FDCONFIG.SYS and
C:\FDAUTO.BAT" (this is actually printed in WELCOME.BAT). So I've left
a comment in the updated FDAUTO that "cfgfile and autofile might be
deprecated in future".
:-)


Jim


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

Reply via email to