reboot pc under DOS - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

reboot pc under DOS

edridiledridil Posts: 14Member
What I have to do is reboot the pc working under DOS (not with CTRL-ALT-DEL!!) and using MASM (I have to use MASM..)

How can I do?
I found int 19h, is this all?

Comments

  • ASHLEY4ASHLEY4 Posts: 254Member
    Here's some info:
    [code]
    30.1 WARM AND COLD REBOOT

    Within DOS, there are two types of rebooting. There is the warm reboot
    that is evoked by pressing the "Ctrl-Alt-Del" key combination. During
    this reboot, all Power On System Tests, POSTs, are performed with the
    exception of the memory tests. In addition to the POSTs, interrupt
    vectors are reinitialized and system timers reinitialized. In other
    words, the BIOS code initializes the computer system to such a state
    that the computer system is ready for loading the operating system.
    Issuing an interrupt 19h does the loading of the operating system.

    The second type of rebooting is a cold reboot that occurs when the
    system is turned on. The only difference between a cold reboot and a
    warm reboot is the performing of the memory tests.

    30.2 PERFORMING A REBOOT FROM SOFTWARE

    Whether a cold or warm reboot is performed depends upon the value if the
    reset flag in the ROM BIOS data area. If this flag is set to 1234h, a
    warm reset is performed. Any other value results in a cold reboot.
    Usually a zero is loaded for the cold reboot. Code snippets to do this
    are:

    ROMBIOS_DATA segment at 0400h
    org 72h
    ResetFlag dw ?
    ROMBIOS_DATA ends

    ROMBIOS segment at 0f000h
    org 0fff0h
    Reset label far
    ROMBIOS ends

    In your code:

    mov ax, seg ROMBIOS_DATA
    mov ds, ax
    ASSUME ds:ROMBIOS_DATA
    mov ResetFlag, 1234h ; or 0 if cold reset is desired
    jmp Reset

    30.3 WARNINGS!

    Neither the warm nor the cold boot flushes buffers, system, smartdrv,
    and EMM386, or notifies TSRs. This can lead to lost of data. The best
    source code that considers most of this is:

    ftp://ftp.simtel.net/pub/simtelnet/msdos/bootutil/reboot33.zip

    Full source code is available.

    30.4 JUST USING INT 19H

    Using this interrupt alone will only reload the operating system onto a
    computer system that may not be initialized properly for it. The
    interrupt vectors are not reset but the TSRs that have hooks into the
    interrupt table may be overwritten. Obviously, this can lead to the
    system hanging if one of these hooked and overwritten interrupts is
    called. Other problems can be timers not reset or add-on cards not
    reinitialized properly. So, do NOT use Int 19h to reboot the computer.

    30.5 USING F000:E05B INSTEAD OF F000:FFF0 AS THE JUMP ADDRESS

    In the original IBM ROM BIOS, the instruction at f000:fff0 was a long
    jump to f000:e05b. Some programs skipped the jump at f000:fff0 and went
    directly to the second address which is the start of the reset procedure
    in ROM BIOS. I checked my 386 with non-IBM BIOS, and the start of the
    reset procedure is at the same address. I believe that using the second
    address is dangerous because there is not any guarantee that it will
    stay the same. In addition, if you are rebooting the computer what is
    the reason in saving a few cycles! Stay with the address f000:fff0 as
    the jump there always will take the execution path to the correct code.

    Contributor: Raymond Moon, [email protected]
    Last changed: 20 Dec 96

    [/code]

    \\||////
    (@@)
    ASHLEY4.
  • CPU MasterCPU Master Posts: 48Member
    : What I have to do is reboot the pc working under DOS (not with CTRL-ALT-DEL!!) and using MASM (I have to use MASM..)
    :
    : How can I do?
    : I found int 19h, is this all?
    :
    Why do you have to use MA$M? Just wondering...
  • edridiledridil Posts: 14Member
    :
    : Why do you have to use MA$M? Just wondering...
    :

    It's for an exam, and this is what the prof. wants, that's all
  • Luke7Luke7 Posts: 156Member
    : What I have to do is reboot the pc working under DOS (not with CTRL-ALT-DEL!!) and using MASM (I have to use MASM..)
    :
    : How can I do?
    : I found int 19h, is this all?
    :

    Are you aware that the code won't work in a DOS box.
  • edridiledridil Posts: 14Member
    : : What I have to do is reboot the pc working under DOS (not with CTRL-ALT-DEL!!) and using MASM (I have to use MASM..)
    : :
    : : How can I do?
    : : I found int 19h, is this all?
    : :
    :
    : Are you aware that the code won't work in a DOS box.
    :

    I know, thanks ;)
  • theresajaynetheresajayne Posts: 3Member
    I have not done it for a while but int 19 would sometimes crash the machine so we moved to the following code which programatically performs a reboot

    MOV AL,0Fh
    OUT 64H,AL

    4 bytes to rule them all and in the darkness Reboot them....

    We saved this as reboot.com :)

    Theresa
  • theresajaynetheresajayne Posts: 3Member
    I have not done it for a while but int 19 would sometimes crash the machine so we moved to the following code which programatically performs a reboot

    MOV AL,0Fh
    OUT 64H,AL

    4 bytes to rule them all and in the darkness Reboot them....

    We saved this as reboot.com :)

    Theresa
  • theresajaynetheresajayne Posts: 3Member
    I have not done it for a while but int 19 would sometimes crash the machine so we moved to the following code which programatically performs a reboot

    MOV AL,0Fh
    OUT 64H,AL

    4 bytes to rule them all and in the darkness Reboot them....

    We saved this as reboot.com :)

    Theresa
Sign In or Register to comment.