[comp.sys.ibm.pc.programmer] cold/warm boots with TASM

bdn@phobos.cis.ksu.edu (Bryan D. Nehl) (03/16/90)

I was wondering if you all might be able to help me out.  And point
out what in the world I am doing wrong.  I have worked on this for
hours and haven't been able to figure this out.  I would appreciate it
if someone could possibly send me (e-mail) a corrected copy of this code.
Thanks.  And much appreciation.  :-)

Bryan.

----8<-------8<----------------8<----------------8<-------------8<----------
TITLE   Boot.asm
;   This program should do a warm boot
DOSSEG
.MODEL  TINY
.STACK  000H
 
.DATA
.CODE
 
;   Code Starts Here  -------------------------------
 
        mov dx,        0
        mov ds, dx
        mov ax, 1234
        mov [472], ax        
 
; leave only jmp for a cold boot routine.
 
        jmp far ptr 0ffffh:00000h
        
;   Code Ends Here ----------------------------------

;/* ========== 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   _____ */
 
END ; ---------------------- End Of File ---------------------------------
--------8<---------------8<---------------------8<------------------8<-------

jrh@mustang.dell.com (James R. Howard) (03/16/90)

In article <25FFF3C1.5C41@deimos.cis.ksu.edu>, bdn@phobos.cis.ksu.edu
(Bryan D. Nehl) writes:
> 
> I was wondering if you all might be able to help me out.  And point
> out what in the world I am doing wrong.  I have worked on this for
> hours and haven't been able to figure this out.  I would appreciate it
> if someone could possibly send me (e-mail) a corrected copy of this code.
> Thanks.  And much appreciation.  :-)

How about this???


TITLE   Boot.asm
;   This program should do a warm boot
DOSSEG
.MODEL  TINY
.STACK  000H
  
.DATA
.CODE
  
;   Code Starts Here  -------------------------------
	mov	ax, 0feh		; load mask into AX
	out     64h, ax			; write reset mask value to kbd controller 
	cli				; disable interrupts
	hlt				; hlt
        
;   Code Ends Here ----------------------------------
END ; ---------------------- End Of File ---------------------------------

--------------------------------------------------------------
James Howard
..uunet!dell!mustang!jrh   or    jrh@mustang.dell.com

The opinions stated are my own, and do not necessarily 
reflect the opinions of my employer, or anyone else.
--------------------------------------------------------------

6600sirt@hub.UUCP (Mike O'Brien) (03/16/90)

From article <3015@uudell.dell.com>, by jrh@mustang.dell.com (James R. Howard):
> How about this???
[...]
> 	mov	ax, 0feh		; load mask into AX
> 	out     64h, ax			; write reset mask value to kbd controller 
[...]


I have used this method before, but it is not at all reliable.  I
know of at least two computers at my work that this method will not
work on, and they are both true-blue IBM's.

What you are doing here is telling the keyboard controller to wait
three microseconds and then reset the processor.  The problem with
this, as I understand it, is that on a 286 there is no way to get
out of protected mode without resetting the processor.  So programs
that need to switch into and out of protected mode set a flag
telling the processor where to jump after a memory reset.  Not only
are you not guaranteed that this flag will point to the boot code
in ROM at any given time, you are not even guaranteed it will point
there when the computer is first turned on.

So, while this solution doesn't work in general, it might be the
beginnings of a good solution.  Hopefully someone reading this will
point me to a book that explains in detail the flag I have referred
to, so I can set it myself to the boot code.

Michael O'Brien
6600sirt@ucsbuxa.ucsb.edu

mathrich@mthvax.cs.miami.edu (Rich Winkel) (03/16/90)

In <25FFF3C1.5C41@deimos.cis.ksu.edu> bdn@phobos.cis.ksu.edu (Bryan D. Nehl) writes:
%>I was wondering if you all might be able to help me out.  And point
%>out what in the world I am doing wrong.  I have worked on this for
%>hours and haven't been able to figure this out.  I would appreciate it
%>if someone could possibly send me (e-mail) a corrected copy of this code.
%>Thanks.  And much appreciation.  :-)
%>        mov dx,        0
%>        mov ds, dx
%>        mov ax, 1234      <<<---1234h
%>        mov [472], ax     <<<---472h
%> 
%>; leave only jmp for a cold boot routine.
%> 
%>        jmp far ptr 0ffffh:00000h

Rich