Re: RE-BOOT

 BBS: Inland Empire Archive
Date: 02-25-93 (22:31)             Number: 176
From: ROB MCKEE                    Refer#: NONE
  To: ZACK JONES                    Recvd: NO  
Subj: Re: RE-BOOT                    Conf: (2) Quik_Bas
--> Note:
Moved (from: NETMAIL) by Rob McKee using timEd.

Hello Zack!
   You wrote to Rob Mckee:

 RM> ' Warm Reboot

 ZJ> Neat little routine.  Here's an idea for a program I've
 ZJ> thought about writing Using a routine like yours to reboot
 ZJ> the machine - but also have it check to see how many times
 ZJ> it's rebooted.  I used to have Front Door exit with an
 ZJ> errorlevel that called BOOT.COM if it couldn't initialize
 ZJ> the modem - well that normally worked until one day when it
 ZJ> got hung really bad - FD sat in a Boot...Can't initialize
 ZJ> modem....Boot loop for about 2 hours - lots of unwanted wear
 ZJ> and tear on the ole 'puter.  Anyway - it'd be nice to have a
 ZJ> program that can reboot the system a set number of times.
 ZJ> Interested in working on one?  Here's a very rough flow
 ZJ> chart:

 ZJ> 1 -Open a file and write the number of times the system has
 ZJ> been booted    (eg 1)
 ZJ> 2 - reboot
 ZJ> 3 - modem hung still - FD exits calling reboot
 ZJ> 4 - check file to get number of times rebooted if greater
 ZJ> than 3 don't     reboot the machine - blank the screen so we
 ZJ> don't burn anyhing in     to the monitor.

 ZJ> Whatta ya say - wanna write one?

 |---------| Slash Here |-------------8<------------>8-----------------|

 DECLARE SUB Boot (ColdBoot%)

 DEFINT A-Z
 BBSDir$ = ENVIRON$(UCASE$(RTRIM$(COMMAND$)))
 ' Uses any Enviroment Variable that points to a Directory
 ' I use my %BINK% variable
 IF RIGHT$(BBSDir$, 1) <> "\" THEN BBSDir$ = BBSDir$ + "\"
 CountFile$ = BBSDir$ + "Booted.cnt"
 OPEN CountFile$ FOR BINARY AS 1
 DO
 LOOP UNTIL INKEY$ = ""
 CurrentTime$ = TIME$      ' Get alittle fancy
     La = LOF(1)
     IF LOF(1) THEN
         a$ = SPACE$(La)
         Nu$ = ""
         GET #1, , a$
         FOR t = 1 TO La       ' Keep it compatible with QB
And PDS             pa = ASC(MID$(a$, t, 1))
            SELECT CASE pa
                CASE 48 TO 57
                    Nu$ = Nu$ + CHR$(pa)
            END SELECT
         NEXT
         booted = VAL(Nu$)
     ELSE
         Booted = 0
     END IF
     IF booted > 3 THEN
        CLS
        CLOSE
        KILL CountFile$     ' This Makes Booted = 0
        RANDOMIZE TIMER   ' Brain dead routine to have the
Message Hop         DO
            r! = RND(TIMER) * 25! + 1   ' around the screen
            c% = FIX(RND(TIMER) * 50! + 1)
            IF FIX(RND(8) * 25) = 20 THEN
                LOCATE r2 + 1, c2 + 1, 0
                PRINT SPACE$(29);
                LOCATE FIX(r!), c%, 0
                PRINT "Boot Failed At " + CurrentTime$;
                r2 = FIX(r!) - 1
                c2 = c% - 1
            END IF
         LOOP WHILE INKEY$ = ""
     ELSE
         a$ = "Booted " + STR$(Booted + 1) + " Times" +
CHR$(13) + CHR$(10)          PUT #1, 1, a$
         CLOSE
         Boot 0
     END IF
 END

 SUB Boot (ColdBoot)
     DEF SEG = 0
     IF NOT ColdBoot THEN
         POKE &H473, &H12
         POKE &H472, &H34
     END IF
     DEF SEG = &HFFFF
     CALL Absolute(0)
 END SUB


 |---------| Slash Here |-------------8<------------>8-----------------|

 Kludgy but it works...  Didn't feel like writing the boot into a Function.

     SysOp 1:125/411 PVT - Rob

--- timEd/B6


--- Squish v1.01
 * Origin: Flyer_Proof_Computer_Svs,Richmond_CA,MO,V32B (1:125/411)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET