| In order to make your Freesco box
start up itself, even after a power outage, we must make steps into the DOS world. During startup, the first step in the DOS world is to look for config.sys. It's purpose is to prepare the environment for the next step. When config.sys is finished DOS looks for autoexec.bat. The autoexec.bat calls different programs to set up the work parameters you have chosen. This procedure is excuted at every startup and we can customize this procedure to whatever we want * a menu with choices. * a scandisk after a power outage. * still, an automatic startup. To make this possible requires DOS v6 or higher and an already running Freesco. In config.sys we make the menu options with a default choice. Yeah, I know, but I'm not finished migrating my addons from v027. That's why it still is a choice. [menu] menuitem=router3 ;Freesco 0.3.router menuitem=router2 ;Freesco 0.2.router menuitem=special ;DOS work menudefault=router3,7 Each option doesn't have to have complex set ups. We're going to enter Linux land, remember? [router3] SHELL=C:\DOS\command.com C:\DOS\ /P We engage the common tasks last. Choose a country to make the displayed characters readable to our eyes. [common] COUNTRY=046,850,C:\DOS\country.sys DEVICE=C:\DOS\display.sys CON=(EGA,,1) DEVICE=C:\DOS\ansi.sys Next case is the autoexec.bat file. We choose a country to make the keyboard behave as we are used to. @ECHO OFF rem Long live DOS! :-) REM common C:\DOS\mode CON CP PREP=((850) C:\DOS\ega.cpi) C:\DOS\mode CON CP SEL=850 C:\DOS\keyb SV,,C:\DOS\keyboard.sys PROMPT $p$g PATH C:\DOS;C:\UTILS GOTO %config% The last command is the glue between first and second phase in the start up procedure. DOS remembers our choice from the menu in config.sys and will jump to the proper label. It's also possible to make some maintenance in DOS from here by tapping any key but N. Beware of cats near the keyboard when booting! Empirical knowledge. :router3 D: SET TEMP=D:\TEMP echo. echo Freesco3 in sight. echo Want to do something else first? echo. echo You have 7 seconds... echo. :omStart3 CHOICE /N /C:nABCDEFGHIJKLMOPQRSTUVWXYZ No (=default) /T:n,7 if errorlevel 255 goto omStart3 if errorlevel 2 goto end if errorlevel 1 goto Drouter3 if errorlevel 0 goto omStart3 :Drouter3 D:\ROUTER\router.bat GOTO end Make yourself proud of your work. Finish up the DOS way. :end No, you're not finished yet. Move in to router territory. D:\>cd \router Make 2 copies of the router.bat file. D:\ROUTER>copy router.bat *.n D:\ROUTER>copy router.bat *.c These new files needs to be edited. In both files remove the line beginning with if and from label :S to the end. Also, in the router.c file, insert a complete new line before the router start. This to make a scandisk only when there has been an abrupt ending
before. c:\dos\scandisk /all /autofix /nosummary Being here doing one modification, maybe it's appropriate to a little study of another page offering some advice to liberate the power in the cpu driving the Freesco box. Finish up by making a replacement for the original router.bat. D:\ROUTER>copy /y router.n *.bat OBS! Remember all previous files exists in DOS land, so when editing use an editor that speaks DOS. Well, about half-way through. Maybe it's time for a rest before entering Linux land? Then start your Freesco. Freesco 027 Start from the point where we are assumed to begin. [Lin ux] cd /mnt/router Look around and you'll recognize the router.bat file and its sisters, don't you? [Linux] ls -l -r--r--r-- 1 root root 0 Nov 5 2002 v_0_2_7 -rw-r--r-- 1 root root 10546 Nov 5 2002 loadlin.exe -rw-r--r-- 1 root root 703923 Nov 5 2002 ramdisk -rw-r--r-- 1 root root 276 Sep 15 10:13 router.bat -rw-r--r-- 1 root root 276 Mar 23 2003 router.n -rw-r--r-- 1 root root 312 Mar 23 2003 router.c -rw-r--r-- 1 root root 9586 Mar 17 2004 report.txt drwxr-xr-x 2 root root 2048 Nov 5 2002 drv drwxr-xr-x 2 root root 2048 Jul 3 2003 optPut the proper name on these new files. [Linux ] mv router.n router.norm [Linu x] mv router.c router.crsh Now for the last part, the commands that make use of the new files. Move to another directory. [Linux] cd /rc Bring the always userobedient file into edit position. [Linu x] edit rc_user In the stop/restart section insert one line. cp /mnt/router/router.norm /mnt/router/router.bat # normal exit In the start section insert this line. cp /mnt/router/router.crsh /mnt/router/router.bat # prep 4 disaster That's it. Nothing more, and you don't have to reboot, of course. OBS! Remember to remove any backup file(s) in the rc directory. In my wereabouts there isn't a lot of power outages, sometimes when thunder and after a company party. But one time, thunder, I know because I was next to the box, and the router recovered as it should. As I was curious, I did take a look into my Freesco. The scandisk had unlinked a Seti WU with over 92% calculation done :-( I then considered, for a moment, to withdraw the automatic execution of scandisk. But as my blood pressure began to slide I did see that would be another suboptimization. A very bad one, at that. Ces't la vie. This page is the ameliorated work of an idea by TiGeR. Whatever wrong is added by me. "Did anyone see my lost carrier?" |
hansmade | 10-7-6 |