home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!ira.uka.de!news.belwue.de!sun1.ruf.uni-freiburg.de!hartnegg
- From: hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg)
- Subject: Re: rebooting computers in programs
- Message-ID: <1992Nov8.120722.4072@sun1.ruf.uni-freiburg.de>
- Keywords: reboot
- Organization: Rechenzentrum der Universitaet Freiburg, Deutschland
- References: <1992Nov5.051656.27711@galileo.cc.rochester.edu>
- Date: Sun, 8 Nov 92 12:07:22 GMT
- Lines: 52
-
- ma1cs181@troi.cc.rochester.edu (jeff gramowski) writes:
-
- > I need to find a way to have my computer reboot at the end of one
- >of my programs. I have tried to use the Intr($19,regs) comand in turbo
- >pascal 6.0 and it only caused the computer to freeze up. I need the
- >computer to act like the Ctrl-alt-del keys have been pushed.
-
- First try to simulate a ctrl-alt-del to cause disk caches
- to flush their buffer. Then have the keyboard controller to do
- a hard reset of the cpu. This is more reliable than the
- jump $ffff:0000. Intr 19 is known to cause lots of problems.
-
- Procedure boot (magic:word);
- begin
- memw[$40:$72] := magic; { set boot type }
-
- { let BIOS boot or flush write cache }
- mem[$40:$17] := mem[$40:$17] or $F; { press ctrl + shift + alt }
- asm
- mov ax, $4F53 { press del }
- int $15
- end;
- mem[$40:$17] := mem[$40:$17] xor $F;{ release ctrl + shift + alt }
-
- { if we come here: allow cache to become active }
- writeln;
- idle; idle;
-
- { reset CPU }
- port [$64] := $FE; { tell keyboard controller to reset CPU }
- delay (500); { wait until it has an effect }
-
- { if it didn't work, try this: }
- inline ($EA/00/00/$FF/$FF); { jump FFFF:0000 }
-
- { we had no luck, so go into an endless loop }
- asm
- @0: jmp @0
- end;
-
- end;
-
-
- Procedure ColdBoot; begin boot ($0000); end;
- Procedure WarmBoot; begin boot ($1234); end;
-
- --
- ------------------------------------------------------------------------------
- Klaus Hartnegg, Kleist-Str. 7, D-7835 Teningen, Germany | This text reflects
- Internet : hartnegg@ibm.ruf.uni-freiburg.de | MY opinion, not that
- Bitnet : hartnegg@dfrruf1 or hartnegg@cernvm | of my employer !
-