home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6401 < prev    next >
Encoding:
Text File  |  1992-11-08  |  2.2 KB  |  63 lines

  1. Newsgroups: comp.lang.pascal
  2. 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
  3. From: hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg)
  4. Subject: Re: rebooting computers in programs
  5. Message-ID: <1992Nov8.120722.4072@sun1.ruf.uni-freiburg.de>
  6. Keywords: reboot
  7. Organization: Rechenzentrum der Universitaet Freiburg, Deutschland
  8. References: <1992Nov5.051656.27711@galileo.cc.rochester.edu>
  9. Date: Sun, 8 Nov 92 12:07:22 GMT
  10. Lines:       52
  11.  
  12. ma1cs181@troi.cc.rochester.edu (jeff gramowski) writes:
  13.  
  14. >     I need to find a way to have my computer reboot at the end of one
  15. >of my programs.  I have tried to use the Intr($19,regs) comand in turbo   
  16. >pascal 6.0 and it only caused the computer to freeze up.  I need the 
  17. >computer to act like the Ctrl-alt-del keys have been pushed.
  18.  
  19. First try to simulate a ctrl-alt-del to cause disk caches
  20. to flush their buffer. Then have the keyboard controller to do
  21. a hard reset of the cpu. This is more reliable than the
  22. jump $ffff:0000. Intr 19 is known to cause lots of problems.
  23.  
  24. Procedure boot (magic:word);
  25. begin
  26.   memw[$40:$72] := magic;             { set boot type }
  27.  
  28.   { let BIOS boot or flush write cache }
  29.   mem[$40:$17] := mem[$40:$17] or $F; { press ctrl + shift + alt }
  30.   asm
  31.     mov ax, $4F53                     { press del }
  32.     int $15
  33.   end;
  34.   mem[$40:$17] := mem[$40:$17] xor $F;{ release ctrl + shift + alt }
  35.  
  36.   { if we come here: allow cache to become active }
  37.   writeln;
  38.   idle; idle;
  39.  
  40.   { reset CPU }
  41.   port [$64] := $FE;                  { tell keyboard controller to reset CPU }
  42.   delay (500);                        { wait until it has an effect }
  43.  
  44.   { if it didn't work, try this: }
  45.   inline ($EA/00/00/$FF/$FF);         { jump FFFF:0000 }
  46.  
  47.   { we had no luck, so go into an endless loop }
  48.   asm
  49.   @0: jmp @0
  50.   end;
  51.  
  52. end;
  53.  
  54.  
  55. Procedure ColdBoot; begin boot ($0000); end;
  56. Procedure WarmBoot; begin boot ($1234); end;
  57.  
  58. -- 
  59. ------------------------------------------------------------------------------
  60. Klaus Hartnegg, Kleist-Str. 7, D-7835 Teningen, Germany | This text reflects  
  61. Internet : hartnegg@ibm.ruf.uni-freiburg.de             | MY opinion, not that
  62. Bitnet : hartnegg@dfrruf1 or hartnegg@cernvm            | of my employer !     
  63.