[comp.sys.ibm.pc.programmer] How to do a warm-boot from ASM

bdn@phobos.cis.ksu.edu (Bryan D. Nehl) (02/20/90)

In article <P#$#92_@rpi.edu> mcintyre@turing.cs.rpi.edu (David McIntyre) writes:

>jimmy writes:
>>Does anyone know how to do a boot from a C program?

>Yes, just do an Interrupt 25 (which is 19h).  That will do it nicely.

I am trying do the same thing from assembler but when I call
int 19h it acts like its going to reboot, seems like it's rebooting
and then just hangs.  I know the format of the rest of the program is
good because it's just a shell that I use to stick bios calls into.
For instance I use the same skeleton and set the video mode and cursor size.

Any ideas?  I am thinking maybe I need to change some register values 
since the description of int19h that I read says that it preserves memory.

Bryan.

/* ========== kodiak%kodiakpc.uucp@phobos.cis.ksu.edu =============+
[   Big Bad Bear Beasties Inc.    ][   Bryan Nehl                  ]
[   kodiak@ksuvm.ksu.edu          ][   bdn@phobos.cis.ksu.edu      ]
+___ ...!{rutgers|texbell}!ksuvax1!phobos.cis.ksu.edu!bdn   _____ */

mcintyre@turing.cs.rpi.edu (David McIntyre) (02/20/90)

Bryan D. Nehl writes:
>I write:
>>jimmy writes:
>>>Does anyone know how to do a boot from a C program?
>>Yes, just do an Interrupt 25 (which is 19h).  That will do it nicely.
>I am trying do the same thing from assembler but when I call
>int 19h it acts like its going to reboot, seems like it's rebooting
>and then just hangs.

Well, you had me scared.  I wrote the following CHASM program:

------------------------- cut here -----------------------------
;=====================================;
;WARMBOOT     Version 1.00            ;
;          1990 by David McIntyre     ;
;                                     ;
; Source file for CHASM.              ;
;=====================================;

	INT 19H
------------------------- cut here -----------------------------

Well, one nice thing about CHASM is that you don't need a bunch of
garbage.  Anyway, this program, compiled into boot.com, reboots my
computer.  A warm boot, actually.  

				-Dave


Dave "mr question" McIntyre     |      "....say you're thinking about a plate
mcintyre@turing.cs.rpi.edu      |       of shrimp.....and someone says to
office : 518-276-8633		|	you 'plate,' or 'shrimp'......"

bir7@portia.Stanford.EDU (Ross Biro) (02/20/90)

In article <25E0BD4E.35EB@deimos.cis.ksu.edu> bdn@phobos.cis.ksu.edu (Bryan D. Nehl) writes:
>In article <P#$#92_@rpi.edu> mcintyre@turing.cs.rpi.edu (David McIntyre) writes:
>
>>Yes, just do an Interrupt 25 (which is 19h).  That will do it nicely.
>
>I am trying do the same thing from assembler but when I call
>int 19h it acts like its going to reboot, seems like it's rebooting
>and then just hangs.

The problem is that int 19h just reexecutes the boot loader.  It does not
reset all the interrupt vectors etc, so when dos is trashed by the new
copy that is loading; the system hangs.  The only way I know of to do a
reliable warm boot is to talk to the keyboard and tell it to reset the
system, something like out 64h,0f1h when the keyboard input buffer
is empty should do it.  But I have to agree with the earlier posting;
resetting the computer is probably a very bad idea.

	Ross Biro bir7@portia.stanford.edu

CMH117@psuvm.psu.edu (Charles Hannum) (02/21/90)

You need a "JMP FAR FFFF:0000" instruction to do a cold boot.  To do a warm
boot, you need to set some value in memory to "1234h".  If anyone can remember
the address of this value, please post.  I've forgotten.  (I think it's in the
BIOS data area.)


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117@psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h@psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."

jrh@mustang.dell.com (James R. Howard) (02/21/90)

This is amazing,.. anyway see the earlier posting 
concerning this.  To do a real reset from assembly, do this:

mov 	al, 0feh
out	64, al
cli
hlt



--------------------------------------------------------------
James Howard
..cs.utexas.edu!dell!mustang!jrh   or    jrh@mustang.dell.com

"I've got a firm policy on gun control, if there's a gun       
around, I want to be the one controlling it."          
-- Clint Eastwood 
--------------------------------------------------------------

markg@yoda.chips.com (Mark Gorlinsky) (02/23/90)

In article <2238@uudell.dell.com> jrh@mustang.dell.com (James R. Howard) writes:
>This is amazing,.. anyway see the earlier posting 
>concerning this.  To do a real reset from assembly, do this:
>
>mov 	al, 0feh
>out	64, al   Hey!!! This should be 64h. 
>cli
>hlt
>

--------

balaji@nsc.nsc.com (Balaji Pitchaikani) (02/27/90)

In article <25E0BD4E.35EB@deimos.cis.ksu.edu> bdn@phobos.cis.ksu.edu (Bryan D. Nehl) writes:
>In article <P#$#92_@rpi.edu> mcintyre@turing.cs.rpi.edu (David McIntyre) writes:
>
>>jimmy writes:
>>>Does anyone know how to do a boot from a C program?
>
>>Yes, just do an Interrupt 25 (which is 19h).  That will do it nicely.
>
>I am trying do the same thing from assembler but when I call
>int 19h it acts like its going to reboot, seems like it's rebooting
>and then just hangs.  I know the format of the rest of the program is

   Int 19h is actually used to activate the code in the Extra EPROM 
   provided. Mostly this EPROM contains BASIC. Your system may be having
   problem accessing this EPROM.
      If you are using C, you can make a setjmp to F000:E05B and then
   do a longjmp to this location. THIS WILL REBOOT YOUR SYSTEM!
      For Assembly programs just do a jmp far to F000:E05B.

>Bryan.

balaji
(balaji@nsc.nsc.com)