biosreboot.S revision 1.2
11.2Sdsl/* $NetBSD: biosreboot.S,v 1.2 2003/02/01 14:48:18 dsl 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.1Sperry 351.1Sperry 361.1Sperry#include <machine/asm.h> 371.1Sperry 381.1Sperry#define data32 .byte 0x66 391.1Sperry 401.1Sperry .text 411.1Sperry 421.1Sperry/* Call INT 19 to do the equivalent of CTL-ALT-DEL */ 431.1Sperry 441.1SperryENTRY(reboot) 451.1Sperry pushl %ebp 461.1Sperry movl %esp,%ebp 471.1Sperry pushl %ebx 481.1Sperry push %esi 491.1Sperry push %edi 501.1Sperry 511.1Sperry call _C_LABEL(prot_to_real) 521.2Sdsl .code16 531.1Sperry 541.1Sperry int $0x19 551.1Sperry 561.1Sperry /* NOTE: We should never even get past this point. */ 571.1Sperry 581.2Sdsl calll _C_LABEL(real_to_prot) 591.2Sdsl .code32 601.1Sperry 611.1Sperry movl %ebx, %eax 621.1Sperry 631.1Sperry pop %edi 641.1Sperry pop %esi 651.1Sperry popl %ebx 661.1Sperry popl %ebp 671.1Sperry ret 68