biosreboot.S revision 1.3
11.3Sjunyoung/* $NetBSD: biosreboot.S,v 1.3 2005/07/06 19:29:50 junyoung Exp $ */ 21.1Sperry 31.1Sperry/* 41.1Sperry * Copyright (c) 1997 51.1Sperry * Perry E. Metzger. All rights reserved. 61.1Sperry * 71.1Sperry * Redistribution and use in source and binary forms, with or without 81.1Sperry * modification, are permitted provided that the following conditions 91.1Sperry * are met: 101.1Sperry * 1. Redistributions of source code must retain the above copyright 111.1Sperry * notice, this list of conditions and the following disclaimer. 121.1Sperry * 2. Redistributions in binary form must reproduce the above copyright 131.1Sperry * notice, this list of conditions and the following disclaimer in the 141.1Sperry * documentation and/or other materials provided with the distribution. 151.1Sperry * 3. All advertising materials mentioning features or use of this software 161.1Sperry * must display the following acknowledgements: 171.1Sperry * This product includes software developed for the NetBSD Project 181.1Sperry * by Perry E. Metzger. 191.1Sperry * 4. The names of the authors may not be used to endorse or promote products 201.1Sperry * derived from this software without specific prior written permission. 211.1Sperry * 221.1Sperry * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 231.1Sperry * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 241.1Sperry * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 251.1Sperry * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 261.1Sperry * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 271.1Sperry * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 281.1Sperry * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 291.1Sperry * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 301.1Sperry * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 311.1Sperry * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 321.1Sperry * 331.1Sperry */ 341.3Sjunyoung 351.1Sperry 361.1Sperry#include <machine/asm.h> 371.1Sperry 381.1Sperry .text 391.1Sperry 401.1Sperry/* Call INT 19 to do the equivalent of CTL-ALT-DEL */ 411.1Sperry 421.1SperryENTRY(reboot) 431.1Sperry pushl %ebp 441.1Sperry movl %esp,%ebp 451.1Sperry pushl %ebx 461.1Sperry push %esi 471.1Sperry push %edi 481.1Sperry 491.1Sperry call _C_LABEL(prot_to_real) 501.2Sdsl .code16 511.1Sperry 521.1Sperry int $0x19 531.1Sperry 541.1Sperry /* NOTE: We should never even get past this point. */ 551.3Sjunyoung 561.2Sdsl calll _C_LABEL(real_to_prot) 571.2Sdsl .code32 581.1Sperry 591.1Sperry movl %ebx, %eax 601.1Sperry 611.1Sperry pop %edi 621.1Sperry pop %esi 631.1Sperry popl %ebx 641.1Sperry popl %ebp 651.1Sperry ret 66