Q: How to reboot with TP 7.0 
Author Message
 Q: How to reboot with TP 7.0

Hi everybody!

Can somebody tell me how to reboot a PC
from within a Borland Pascal 7.0 for DOS
Program?
I need this for automatically rebooting the system
after changing the CONFIG.SYS and AUTOEXEC.BAT.

Many thanks in advance,

Guntram



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

This is a multi-part message in MIME format.
--------------E4195D8D6D13FB346512E6B9
Content-Type: text/plain; charset=iso-8859-9
Content-Type: text/plain; charset=iso-8859-9
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

Quote:

> Hi everybody!

 Hi...

Quote:
> Can somebody tell me how to reboot a PC
> from within a Borland Pascal 7.0 for DOS
> Program?
> I need this for automatically rebooting the system
> after changing the CONFIG.SYS and AUTOEXEC.BAT.

 If you are trying to do it in dos..Here is an attachment file just
simply use it. Just add it and use it..
 warmboot();
 coldboot();
 Best Regards..
 Koray

--------------E4195D8D6D13FB346512E6B9
Content-Type: text/plain; charset=iso-8859-9; name="Boot.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="Boot.txt"

Procedure Idle; inline ($CD/$28);

Procedure boot (magic:word);
begin
  memw[$40:$72] := magic;        

  mem[$40:$17] := mem[$40:$17] or 12;
  asm
    mov ax, $4F53                    
    int $15                          
  end;
  mem[$40:$17] := mem[$40:$17] and $F0;

  writeln;
  idle; idle; idle;
  write;
  delay (500);

  port [$64] := $FE;                  
  delay (500);                        

  inline ($EA/00/00/$FF/$FF);        

  asm

  end;

end;

Procedure ColdBoot; begin boot ($0000); end;
Procedure WarmBoot; begin boot ($1234); end;

--------------E4195D8D6D13FB346512E6B9--



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

Quote:

> Hi everybody!

> Can somebody tell me how to reboot a PC
> from within a Borland Pascal 7.0 for DOS
> Program?
> I need this for automatically rebooting the system
> after changing the CONFIG.SYS and AUTOEXEC.BAT.

> Many thanks in advance,

> Guntram

PROCEDURE Reboot;
VAR
 ResetFlag : Word ABSOLUTE $40 : $72;
BEGIN
  ResetFlag := $1234;                    {Emulate BIOS Kbd reset routin
  INLINE($EA / $00 / $00 / $FF / $FF);   {JMP $FFFF:$0000 VarmBot no
memory testing etc}
  (*INLINE($EA / $F0 / $FF / $00 / $F0); {JMP $F000:$FFF0 Coldstart}*)
END


Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

: Can somebody tell me how to reboot a PC
: from within a Borland Pascal 7.0 for DOS
: Program?
: I need this for automatically rebooting the system
: after changing the CONFIG.SYS and AUTOEXEC.BAT.

First remember that this is dangerous if your program does this
on a PC of someone else. It may have a disk cache program installed
that does not flush before you reboot.

Then read http://www.brain.uni-freiburg.de/~klaus/pascal/sources/boot.html
and use it with caution.

Klaus
--
Klaus Hartnegg, Institut fuer Biophysik, Hansa-Strasse 9a, D-79104 Freiburg



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0



Quote:

>> Can somebody tell me how to reboot a PC
>> from within a Borland Pascal 7.0 for DOS
>> Program?

>PROCEDURE Reboot;
>VAR
> ResetFlag : Word ABSOLUTE $40 : $72;
>BEGIN
>  ResetFlag := $1234;                    {Emulate BIOS Kbd reset routin
>  INLINE($EA / $00 / $00 / $FF / $FF);   {JMP $FFFF:$0000 VarmBot no

The following does not work. For a *cold* reset (including memory test
etc.) just set ResetFlag to $0000 in the code above.

Quote:
>memory testing etc}
>  (*INLINE($EA / $F0 / $FF / $00 / $F0); {JMP $F000:$FFF0 Coldstart}*)
>END

Note also that some systems do not acknowledge the *warm* reboot using
ResetFlag=$1234 and start from cold.

--

In principle,   is there uncertainty that
Heisenberg was working his best in chaos?



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

Quote:

> Hi everybody!

> Can somebody tell me how to reboot a PC
> from within a Borland Pascal 7.0 for DOS
> Program?
> I need this for automatically rebooting the system
> after changing the CONFIG.SYS and AUTOEXEC.BAT.

This should work:

Procedure Reboot;
Begin
  InLine(&EA/$00/$00/$FF/$FF); { JMP FFFF:0000 }
end;

Martyn



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0



Quote:



>>> Can somebody tell me how to reboot a PC
>>> from within a Borland Pascal 7.0 for DOS
>>> Program?

>>PROCEDURE Reboot;
>>VAR
>> ResetFlag : Word ABSOLUTE $40 : $72;
>>BEGIN
>>  ResetFlag := $1234;                    {Emulate BIOS Kbd reset routin
>>  INLINE($EA / $00 / $00 / $FF / $FF);   {JMP $FFFF:$0000 VarmBot no

>The following does not work. For a *cold* reset (including memory test
>etc.) just set ResetFlag to $0000 in the code above.
>>memory testing etc}
>>  (*INLINE($EA / $F0 / $FF / $00 / $F0); {JMP $F000:$FFF0 Coldstart}*)
>>END

>Note also that some systems do not acknowledge the *warm* reboot using
>ResetFlag=$1234 and start from cold.

And some systems crash if you set $1234 there. That is because the memory
manager sets it to something else so that the bootup will be cold. I say
it is better to leave the value alone. Normally it should already be
$1234 and if it is not then maybe there is a reason for it.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

This procedure does NOT work with SOME systems (e.g. Compaq Prolinea 575)
and causes a GPF. I have seen a reboot unit (don't know where) that
simulates a ctrl-alt-del.
This generates a warm boot and flushes all disk cache buffers!!! It's
important! I've lost some data rebooting before buffers were written back.
I don't recommend the direct jump.

BandiT

Quote:
>>>  ResetFlag := $1234;                    {Emulate BIOS Kbd reset routin
>>>  INLINE($EA / $00 / $00 / $FF / $FF);   {JMP $FFFF:$0000 VarmBot no

(x)
Get PR-Tracker -- tracks problem reports, defects, bugs
INFORMATION:  http://www.prtracker.com/info.html
DOWNLOAD:     http://www.prtracker.com/download.html


Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0


Quote:
>> Can somebody tell me how to reboot a PC
>> from within a Borland Pascal 7.0 for DOS
>> Program?

here, a one byte reset rutine.. works like a charm in dos/4dos.. Might
not be very good in windows. :)

Asm
        pop ss
End;



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

Quote:
>Subject: Re: Q: How to reboot with TP 7.0

>Date: Thu, Oct 9, 1997 20:25 EDT


>>> Can somebody tell me how to reboot a PC
>>> from within a Borland Pascal 7.0 for DOS
>>> Program?

>here, a one byte reset rutine.. works like a charm in dos/4dos.. Might
>not be very good in windows. :)

>Asm
>    pop ss
>End;

Let me guess how it works...it forces the computer to crash so that the user
 will have no choice but to reset the computer?  ;-)


Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0

Quote:
>Subject: Re: Q: How to reboot with TP 7.0

>Date: Fri, Oct 10, 1997 00:13 EDT

> 117975 Jul 12 1997 ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip
> tsfaqp.zip Common Turbo Pascal Questions and Timo's answers

>-Subject: How can a program reboot my PC?

>49. *****
> Q: How is the code for rebooting the PC written in Turbo Pascal?

> A:  <snip code on resetting by simulating Ctrl-Alt-Del>

>downloaded the FAQ for this newsgroup, and studied the code for
>rebooting a PC. The problem with that code (calling FFFF:0000) is
>that it will not work in protected mode programs such as those
>compiled for Windows or BP7 DPMI, or even in a DOS program run in a
>Windows DOS session. The solution provided has been tested on
>various COMPAQ PC:s, but I think it will work on any AT-class
>machine. It involves using the 8042 keyboard controller chip output
>pin 0, which is physically connected to the reset pin of the CPU.
>There is unfortunately no way to perform a "warm" reboot this way,

Why not?  The BIOS differentiates between warm and cold boots by the word store
 at $0040:$0072.  A $0000 is a cold boot and a $1234 is a warm boot.  Resetting
 the CPU does not erase memory.

- Show quoted text -

Quote:
>and the warnings about disk caches etc apply to this code, too (see
>FAQ). The code is written in BP7 assembly lingo, because that's what
>I normally write code in, but anyone could rewrite it in C or high
>level Pascal.
>  UNIT Reboot;
>  INTERFACE
>    procedure DoReboot;
>  IMPLEMENTATION
>    procedure DoReboot;assembler;
>    asm
>      cli

>      in al,64h         { read 8042 status byte}
>      test al,00000010b { Bit 1 of status indicates input buffer full }

>      mov al,0FEh       { Pulse "reset" = 8042 pin 0 }
>      out 64h,al
>      { The PC will reboot now }
>    end;
>  END.
>--------------------------------------------------------------------

>   All the best, Timo

>....................................................................

>Moderating at ftp:// & http://garbo.uwasa.fi/ archives 193.166.120.5
>Department of Accounting and Business Finance  ; University of Vaasa

>Spam foiling in effect.  My email filter autoresponder will return a
>required email password to users not yet in the privileges database.



Wed, 18 Jun 1902 08:00:00 GMT  
 Q: How to reboot with TP 7.0


Quote:

>>here, a one byte reset rutine.. works like a charm in dos/4dos.. Might
>>not be very good in windows. :)

>>Asm
>>        pop ss
>>End;
>Let me guess how it works...it forces the computer to crash so that the user
> will have no choice but to reset the computer?  ;-)

Actually it will _reset_ the computer. I havent debuged it and checked
the values it gets when it tries to pop back the info it pushed before
it executed my program. Im afraid I might jinx it :) .. hmm.. I'll
have to take the chance and look at it.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

 "How do you shoot the devil in the back?"
 "What if you miss?" -Verbal Kint
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Reboot with TP 5.5 - Help needed

2. Question: Backward compatibility TP 7.0 & TP 6.0

3. Q: Incompatibilities between TP 6.0 and TP 7.0

4. Differences Between TP 5.0 & TP 7.0

5. TP 6.0 Source -> TP 7.0 Error

6. Translating TP 3.0 to TP 7.0

7. qs?.mb files and lost data

8. Database link'n'joining Qs

9. generate .COM Files with TP 7.0?

10. To stop program which is running in TP 7.0

11. program problem with tp 7.0

12. TP 7.0

 

 
Powered by phpBB® Forum Software