Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reboot the system ?

15 views
Skip to first unread message

Laurent

unread,
Aug 24, 1998, 3:00:00 AM8/24/98
to
How do I reboot *cleanly* the system in real mode (f.e. in a .com
program) ?

wbinvd

unread,
Aug 24, 1998, 3:00:00 AM8/24/98
to
Laurent wrote in message <6rrn1n$m0e$1...@winter.news.erols.com>...

| How do I reboot *cleanly* the system in real mode (f.e. in a .com
|program) ?
|
|

jmp F000:FFF0

or:

db 0EAh
dw 0FFF0h,0F000h

Ari Lukumies

unread,
Aug 25, 1998, 3:00:00 AM8/25/98
to

Right... "This program violated the privilege rules of the system and
will be terminated"

If the program only runs in DOS, not in V86 mode, not in a DOS box of
something, the CPU not being switched to use extended addressing, then:
go ahead. (It should be a FAR jump, btw.) More general approach would be
to do INT 19h. This should be trapped by a V86 manager (if there happens
to be one) and should take care of things for you.

AriL
--
*DO NOT* send me email unless I ask you to.
I read the answers where I ask the questions.
This may also help some other people.

wbinvd

unread,
Aug 25, 1998, 3:00:00 AM8/25/98
to
Ari Lukumies wrote in message <6rub9a$5dg$1...@winter.news.erols.com>...

|wbinvd wrote:
|>
|> Laurent wrote in message <6rrn1n$m0e$1...@winter.news.erols.com>...
|> | How do I reboot *cleanly* the system in real mode (f.e. in a .com
|> |program) ?
|> |
|> |
|>
|> jmp F000:FFF0
|>
|> or:
|>
|> db 0EAh
|> dw 0FFF0h,0F000h
|
|Right... "This program violated the privilege rules of the system and
|will be terminated"
|
|If the program only runs in DOS, not in V86 mode, not in a DOS box of
|something, the CPU not being switched to use extended addressing, then:
|go ahead. (It should be a FAR jump, btw.) More general approach would be
|to do INT 19h. This should be trapped by a V86 manager (if there happens
|to be one) and should take care of things for you.


Don't do a int 19h if you're in real mode! The BIOS must initialize
the interrupt vectors, etc. I tried jmp F000:FFF0 in win98 and it
exited the DOS prompt (Win98 has patched F000:FFF0 with int 19h).

The "this program violated ...." is because the BIOS uses some privileged
instructions in v86 mode.

You could also try:

mov al,0FEh
out 64h,al
jmp $

It works in win98 too and probably in most v86 monitors.

Ari Lukumies

unread,
Aug 27, 1998, 3:00:00 AM8/27/98
to
wbinvd wrote:
>
> Don't do a int 19h if you're in real mode! The BIOS must initialize
> the interrupt vectors, etc. I tried jmp F000:FFF0 in win98 and it
> exited the DOS prompt (Win98 has patched F000:FFF0 with int 19h).

Using int 19h, you can do all sorts of fun things. You can, for example
set the word at 40h:72h to one of the following prior to issuing the
int:

0000 cold boot
0064 burn-in mode
1234 bypass memory test
4321 preserve memory
5678 system suspended
9abc manufacturing test mode
abcd POST loop mode

Or, you can set the register 0F value (shutdown status) in the CMOS to:

00-03 software reset
04 int 19h reboot
05 flush keyboard and jump via 40h:67h (*)
06 reset after succesfull vmode test
07 reset after failed vmode test
0a jump via 40h:67h (*)
0b iret via 40h:67h (*)
0c retf via 40h:67h (*)
0d-ff power-on reset

(*) put the far address of your routine (to be called at the beginning
of POST) at this address.

Chris Softley

unread,
Aug 27, 1998, 3:00:00 AM8/27/98
to
Hi,
One of the most interesting things someone can do with Int 19H is
intercept it. There is therefore no guarantee that an Int 19 will do a
legitimate reset. Surely the original poster knows what operating system he
will be working under? In this case he can use the appropriate technique
(which for Windows is an API call).

Anyway, isn't this one of the most FAQs?

>>--Chris-->

(In other words the original poster should probably pay a visit to
ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/....
)

Bart Zonneveld

unread,
Nov 25, 1998, 3:00:00 AM11/25/98
to
In article <6rrn1n$m0e$1...@winter.news.erols.com>, Laurent
<godzilla...@wanadoo.fr> wrote:

> How do I reboot *cleanly* the system in real mode (f.e. in a .com
> program) ?

With Int 16h.

--
Bart Zonneveld.

Email: Bart.Zo...@phil.uu.nl
Cra...@yahoo.com


James MacDonald

unread,
Nov 25, 1998, 3:00:00 AM11/25/98
to
On Wed, 25 Nov 1998, at 17:24:16, Bart Zonneveld wrote:
>With Int 16h.

Your keyboard driver must be quite buggy then ;-)

Use INT 19 if you must, but this is NOT a clean way to reboot the
system. The cleaner way has been posted to this newsgroup very recently,
and involves a far jump into BIOS code.
--
Supporting CUT: http://www.unmetered.org.uk/

We are John Cage of Borg. Assimilation troubles us;
we have to take a moment. Poughkeepsie.

Denning Langston

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to

Bart Zonneveld wrote:

> In article <6rrn1n$m0e$1...@winter.news.erols.com>, Laurent
> <godzilla...@wanadoo.fr> wrote:
>
> > How do I reboot *cleanly* the system in real mode (f.e. in a .com
> > program) ?
>
> With Int 16h.

It's better to store 0000h (cold boot) or 1234h (warm boot) to
0040h:0072 and then make a far jump to 0F000h:0FFF0h.

--

Denning

Joel Rubin

unread,
Nov 26, 1998, 3:00:00 AM11/26/98
to
On 25 Nov 1998 17:24:16 GMT, Bart.Zo...@phil.uu.nl (Bart
Zonneveld) wrote:

>In article <6rrn1n$m0e$1...@winter.news.erols.com>, Laurent
><godzilla...@wanadoo.fr> wrote:
>
>> How do I reboot *cleanly* the system in real mode (f.e. in a .com
>> program) ?
>
>With Int 16h.

Assuming that you have at least an AT, you can emulate a ctl-alt-del
by out'ing an 0feh to port 064h.

mov al,0feh
out 064h,al

==========
It would probably NOT be a very good idea for a spammer to harvest
the following addresses:

<ro...@warez.phantom.com>
<postm...@warez.phantom.com>
<webm...@warez.phantom.com>


Denning Langston

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to

Joel Rubin wrote:

> On 25 Nov 1998 17:24:16 GMT, Bart.Zo...@phil.uu.nl (Bart
> Zonneveld) wrote:
>
> >In article <6rrn1n$m0e$1...@winter.news.erols.com>, Laurent
> ><godzilla...@wanadoo.fr> wrote:
> >
> >> How do I reboot *cleanly* the system in real mode (f.e. in a .com
> >> program) ?
> >
> >With Int 16h.
>
> Assuming that you have at least an AT, you can emulate a ctl-alt-del
> by out'ing an 0feh to port 064h.
>
> mov al,0feh
> out 064h,al
>

Unfortunately this is incorrect.

Ctrl-Alt-Del initiates a warm boot, whereas sending 0FEh to port 064h
initiates a cold boot. Two entirely different animals.

Denning

PS A correction to my previous post, the memory location is 0040h:0072h
(I left the 'h' off of the 0072).

Dr John Stockton

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
JRS: In article <73jpph$6eb$1...@winter.news.rcn.net> of Thu, 26 Nov 1998
14:49:21 in news:comp.lang.asm.x86, Joel Rubin <jmr...@ix.netcom.com>
wrote:

>
>Assuming that you have at least an AT, you can emulate a ctl-alt-del
>by out'ing an 0feh to port 064h.
>
>mov al,0feh
>out 064h,al

Item 49 of TSFAQP (see Sig) implies that one should wait for the
controller to be ready ...

UNIT Reboot;
INTERFACE
procedure DoReboot;
IMPLEMENTATION
procedure DoReboot;assembler;
asm
cli
@@WaitOutReady: { Busy-wait until 8042 is ready for new command}
in al,64h { read 8042 status byte}
test al,00000010b { Bit 1 of status indicates input buffer full }
jnz @@WaitOutReady
mov al,0FEh { Pulse "reset" = 8042 pin 0 }
out 64h,al
{ The PC will reboot now }
end;
END.

--
John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL: http://www.merlyn.demon.co.uk/> - TP/BP/&c. FAQqish topics & links.
Timo's TurboPascal <A HREF="ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip">FAQ</A>.
<A HREF="http://www.merlyn.demon.co.uk/clpb-faq.txt">Mini-FAQ</A> of c.l.p.b.


wbinvd

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Dr John Stockton wrote in message <73l1dp$asj$2...@winter.news.rcn.net>...

|JRS: In article <73jpph$6eb$1...@winter.news.rcn.net> of Thu, 26 Nov 1998
|14:49:21 in news:comp.lang.asm.x86, Joel Rubin <jmr...@ix.netcom.com>
|wrote:
|>
|>Assuming that you have at least an AT, you can emulate a ctl-alt-del
|>by out'ing an 0feh to port 064h.
|>
|>mov al,0feh
|>out 064h,al
|
|Item 49 of TSFAQP (see Sig) implies that one should wait for the
|controller to be ready ...

Because the KBC's usually slow, if you don't wait for it to process
the command, the next write will overwrite the previous command.
But if you need to RESET the CPU, you don't care if if the KBC has
read the last command before you send FEh to it.

wbinvd

unread,
Nov 27, 1998, 3:00:00 AM11/27/98
to
Denning Langston wrote in message <73l1dv$asj$2...@winter.news.rcn.net>...

|
|
|Joel Rubin wrote:
|> Assuming that you have at least an AT, you can emulate a ctl-alt-del
|> by out'ing an 0feh to port 064h.
|>
|> mov al,0feh
|> out 064h,al
|>
|
|Unfortunately this is incorrect.
|
|Ctrl-Alt-Del initiates a warm boot, whereas sending 0FEh to port 064h
|initiates a cold boot. Two entirely different animals.

No, it doesn't initate a cold or warm boot. It's the word at
40:72 that indicates to the BIOS if it should be a warm/cold boot.
Only the CPU is RESET by OUT 64,AL (AL=FE), not the memory.
The memory is still valid so the BIOS can check 40:72 after CPU RESET.

|
|Denning
|
|PS A correction to my previous post, the memory location is 0040h:0072h
|(I left the 'h' off of the 0072).

Hex is always assumed in xxxx:xxxx, it's just ugly with h's in them :)

0 new messages