FreeDOS config.sys and batch menu example: My fdconfig.sys, fdauto.bat
Eric Auer <[email protected]> Sat, 9 Nov 2002 03:10:37 +0100 (MET)
| Newsgroups | gmane.os.freedos.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, some menu example for you. Kind of an howto. The "!" means "even exec when the user tries to bypass or single step fdconfig.sys", as far as I know. MENU 1 Standard UMBPCI MENU 2 Standard EMS MENU 3 DPMI MENU 4 Flexible Multiple Choice rem those lines will just be displayed (the "MENU" itself not), and rem the digits are used to define choice options. MENUDEFAULT=1,5 rem the user will be prompted to type a digit in [01234] or F5 or F8, rem (0 is always there) and after 5 seconds (,5...) FreeDOS assumes 1 (1,...). 1234?DEVICE=C:\bin\bootrand.sys make the world a bit blue (and antiviral) !break=on 12?DEVICE=C:\freedos\bin\FDXXMS.SYS BIOS NUMHANDLES=64 4?DEVICE?=C:\freedos\bin\FDXXMS.SYS BIOS NUMHANDLES=64 rem If configuration 4 is chosen, the user gets asked (...?=...) if he wants rem to load FDXXMS. If config 1 or 2 are chosen, FDXXMS is installed without rem prompting, and if config 3 is chosen, it is not installed, nor offered. rem ... I have removed most 4? lines and rem lines from the following ... 1?DEVICE=c:\bin\umbpci.sys 4?DEVICE?=c:\freedos\bin\emm386.exe 2?DEVICE=c:\bin\dremm386.exe VERBOSE 4?DEVICE?=c:\bin\dremm386.exe VERBOSE rem PIC=ON setting of DREMM386 makes Descent work - activate from autoexec !VERSION=6.20 124?DOS=HIGH,UMB rem for 3, DPMI: DOS=???,??? !buffers=20,0 rem 2nd arg is ignored anyway, and 1st arg is maximized if HMA space is rem left. Use -20 to force to exactly 20 buffers. !FILES=50 !lastdrive=Z !FCBS=4,0 rem FCBS are not needed for FreeDOS: It simulates them, using handles. rem I just write FCBS=... because I am used to doing so :-). rem COUNTRY=049,850 rem not supported by FreeDOS :-(. !stacks=0,0 rem disable stack wrappers for interrupts (dos kernel thing) 12?DEVICEHIGH=C:\bin\lbacache.sys buf 6 drv cd flop stak 4?DEVICEHIGH?=C:\bin\lbacache.sys buf 6 drv cd flop stak 1234?DEVICEHIGH=C:\freedos\bin\nansi.sys rem interprets ANSI esc sequences (<esc>[blabla) 1234?DEVICE=C:\bin\syseecho.sys $[0;1;33;44m Color by Erics SysEEcho :-) rem to send the ansi sequence for yellow text on blue background rem info: freedos upcases command line args, sigh... 1234?DEVICE=C:\bin\DRIVERS\DOS\DWCFGMG.SYS rem PnP driver for activating ISA PnP soundcard (includes many files) rem I spare you from my "option 3" part (trying to run dremm386.exe DPMI=ON rem with all kinds of options, none works - MULTI=ON/OFF, VERBOSE, with rem NOEMS NOVCPI or NOXMSUMB, and so on. With or without FDXMS or HIMEM). rem By the way: use EXCLUDE=c000-c800,f000-ffff - probably better than rem EXCLUDE=c000-c800 EXCLUDE=f000-ffff rem DEVICEHIGH?=C:\freedos\bin\tdsk.exe 15000 512 144 1 rem resizeable and can be > 32 MB, but not compatible enough :-(. 12?DEVICEHIGH?=C:\freedos\bin\bitdisk.exe 15000 512 144 124?DEVICEHIGH?=C:\bin\SSCDROM.SYS /D:CD001 /V /S:170,15,1 rem I almost never use CDs, so not activating this will lead rem to SHSUCDX to fail loading automatically and to double RAM savxings :-) 1234?DEVICEHIGH=C:\bin\KBD-EA.SYS rem tiny QWERTY->QWERTZ wrapper. If you need a .com one, use Toms MKEYB rem (my .com version is for "loading after F5" only and not optimized for size) SHELL=c:\freedos\bin\command.com c:\freedos\bin /e:512 /p=c:\fdauto.bat Okay, got the point? Then here you go with an extract from my FDAUTO.BAT: @echo off prompt $p$g path C:\FREEDOS\BIN;C:\BIN;C:\BATCHES;C:\BIN\KOMM set HELPPATH=C:\FREEDOS\HELP set LANG=DE set NLSPATH=C:\FREEDOS\NLS rem need to format bitdisk before using it... rem will fail without loading in config.sys anyway, so no conditional needed echo Formatting BITDISK if any... c:\freedos\bin\bitdisk 15000 512 144 > nul rem exist testing 10/02, because some programs crash on n/a temp dir rem G: would be the ramdisk if it is loaded... mkdir g:\temp >nul if exist e:\temp\nul set TEMP=E:\TEMP if exist g:\temp\nul SET TEMP=G:\TEMP SET TMP=%TEMP%\ SET RAM=A: if exist g:\nul SET RAM=G: echo Enabling PIC=ON if DR-DOS emm386 loaded, to run Descent... c:\bin\dremm386.exe PIC=ON > nul SET _=$[7m SET x=$[0;1;33;44m c:\bin\eecho %x% rem NEW 10/2001: the eecho helper displays $ as ESC, nice for ANSI :-) SET BLASTER=A220 I5 D1 H5 P330 E620 T6 SET SOUND=C:\bin SET MIDI=SYNTH:1 MAP:E MODE:0 cd \bin c:\bin\tomcheck.com rem checks if we have "640k installed" - otherwise warn, possible virus rem or lowlevel disk swapping driver installation sign! c:\bin\MIXERSET.exe /P /Q rem load volume settings from file, enable sound c:\bin\XREFRESH 70kHz VGAHIGH rem higher framerates at text mode, looks better if x%CONFIG%==x1 goto loadmore if x%CONFIG%==x2 goto loadmore c:\freedos\bin\choice /c:jn Lade CD,Mouse,Share? (27k) IF errorlevel 2 GOTO vielram :loadmore echo Now loading CD-ROM, mouse and share drivers... lh c:\freedos\bin\shsucdx.exe /D:CD001,N rem 11k - FreeDOS replacement for MS MScdEX /D:CD001 /E /V /M:10 /L:N c:\freedos\bin\ctm-de.exe /V /3 /R3 rem LHs itself, /V means serial, /3 three button, /R3 medium speed. 3k. LH c:\freedos\bin\share.exe /L:20 /F:2048 rem (13k) - had this on 64/4096 or even 500/5100 decades ago for MS DOS + Win 3 c:\bin\eecho To spend 10k in taking screenshots, do %_%LH c:\bin\grab.exe g:\%x% :vielram c:\bin\DIAGNOSE /S rem verify that BLASTER and hardware settings match, activate SB AWE32 ISA PnP c:\bin\vga30.com 4/98 derived from Linux 2.0.0 Kernel Source by EA... c:\bin\getcpu.com Cyrix-CPUID-enable c:\bin\tune_cx.com Cyrix-Minituning (added 10/99) c:\bin\eecho ***### %_%SET and VOLINFXLL:%x% ###*** SET c:\bin\volinfxl.exe ver /r c:\bin\eecho Hallo Eric! Check out %_%MENU%x%.bat and this %_%FreeDos .8%x% I hope this was somewhat educating and fun for you :-) In case you did not know, you can also do this in .bat files with FreeCOM: ? c:\freedos\bin\ctm-de.exe /V /3 /R3 This is a shorthand syntax for "prompt user whether to execute this line". And you can use %ERRORLEVEL% and %_CWD%: if the%ERRORLEVEL%==the2 echo errorlevel is exactly two echo current drive and working directory are %_CWD% This saves you from the nasty "at least at" behaviour of "if errorlevel 2" and allows you to do things that would not be possible at all without %_CWD% (implemented in FreeCOM 0.83 beta 50) :-)). PS: Feel free to technote-ify this or to use it for the kernel documentation. Cheers, Eric.