1 1.1 jdolecek REM >testboot 2 1.1 jdolecek REM $NetBSD: TestBoot,v 1.1.1.1 2002/05/09 20:03:57 jdolecek Exp $ 3 1.1 jdolecek REM 4 1.1 jdolecek REM Copyright (c) 1995 Mark Brinicombe 5 1.1 jdolecek REM All rights reserved 6 1.1 jdolecek REM 7 1.1 jdolecek REM Redistribution and use in source and binary forms, with or without 8 1.1 jdolecek REM modification, are permitted provided that the following conditions 9 1.1 jdolecek REM are met: 10 1.1 jdolecek REM 1. Redistributions of source code must retain the above copyright 11 1.1 jdolecek REM notice, this list of conditions and the following disclaimer. 12 1.1 jdolecek REM 2. Redistributions in binary form must reproduce the above copyright 13 1.1 jdolecek REM notice, this list of conditions and the following disclaimer in the 14 1.1 jdolecek REM documentation and/or other materials provided with the distribution. 15 1.1 jdolecek REM 3. All advertising materials mentioning features or use of this software 16 1.1 jdolecek REM must display the following acknowledgement: 17 1.1 jdolecek REM This product includes software developed by Mark Brinicombe. 18 1.1 jdolecek REM 4. The name of the company nor the name of the author may be used to 19 1.1 jdolecek REM endorse or promote products derived from this software without specific 20 1.1 jdolecek REM prior written permission. 21 1.1 jdolecek REM 22 1.1 jdolecek REM THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23 1.1 jdolecek REM IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24 1.1 jdolecek REM OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 1.1 jdolecek REM IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 1.1 jdolecek REM INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 1.1 jdolecek REM BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 28 1.1 jdolecek REM OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 29 1.1 jdolecek REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 1.1 jdolecek REM OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 31 1.1 jdolecek REM THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 32 1.1 jdolecek REM DAMAGE. 33 1.1 jdolecek REM 34 1.1 jdolecek REM NetBSD kernel project 35 1.1 jdolecek REM 36 1.1 jdolecek REM testboot 37 1.1 jdolecek REM 38 1.1 jdolecek REM Sets the FastBoot flag as required 39 1.1 jdolecek REM 40 1.1 jdolecek REM Created : 12/05/95 41 1.1 jdolecek REM Last updated : 03/09/95 42 1.1 jdolecek REM 43 1.1 jdolecek 44 1.1 jdolecek *Set NetBSD$FastBoot 0 45 1.1 jdolecek 46 1.1 jdolecek REM Test for either ALT keys 47 1.1 jdolecek 48 1.1 jdolecek IF (INKEY(-3) <> 0) THEN 49 1.1 jdolecek alt% = TRUE 50 1.1 jdolecek *Set NetBSD$FastBoot 1 51 1.1 jdolecek ELSE 52 1.1 jdolecek alt% = FALSE 53 1.1 jdolecek ENDIF 54 1.1 jdolecek 55 1.1 jdolecek REM Get byte 80 from the CMOS RAM. This is a RiscIX byte that we are using. 56 1.1 jdolecek REM bits are as follows : 57 1.1 jdolecek REM bit 0 - configure bootNetBSD 58 1.1 jdolecek REM bit 1 - automatic reboot required. 59 1.1 jdolecek 60 1.1 jdolecek SYS "OS_Byte", 161, 80 TO ,,value% 61 1.1 jdolecek 62 1.1 jdolecek REM Has the user configured a NetBSD boot ? 63 1.1 jdolecek REM If a NetBSD boot has been configured ALT can be used to 64 1.1 jdolecek REM select a RISC OS boot 65 1.1 jdolecek 66 1.1 jdolecek IF (value% AND &01) THEN 67 1.1 jdolecek *Set NetBSD$FastBoot 2 68 1.1 jdolecek ENDIF 69 1.1 jdolecek 70 1.1 jdolecek REM Did the kernel request a automatic reboot ? 71 1.1 jdolecek 72 1.1 jdolecek IF (value% AND &02) THEN 73 1.1 jdolecek *Set NetBSD$FastBoot 3 74 1.1 jdolecek 75 1.1 jdolecek REM Clear the automatic reboot flag 76 1.1 jdolecek 77 1.1 jdolecek SYS "OS_Byte", 162, 80, value% AND &fd 78 1.1 jdolecek ENDIF 79 1.1 jdolecek 80 1.1 jdolecek REM If the CMOS bits dictate a reboot then allow ALT to override. 81 1.1 jdolecek IF (value% AND &03) THEN 82 1.1 jdolecek IF (alt% = TRUE) THEN 83 1.1 jdolecek *Set NetBSD$FastBoot 0 84 1.1 jdolecek ENDIF 85 1.1 jdolecek ENDIF 86 1.1 jdolecek 87 1.1 jdolecek 88 1.1 jdolecek REM Test for CTRL key - This does a fastconf and will override a reboot 89 1.1 jdolecek 90 1.1 jdolecek IF (INKEY(-2) <> 0) THEN 91 1.1 jdolecek *Set NetBSD$FastBoot 4 92 1.1 jdolecek ENDIF 93 1.1 jdolecek 94 1.1 jdolecek ON ERROR END 95 1.1 jdolecek 96 1.1 jdolecek *If <NetBSD$FastBoot> > 0 then RMLoad <BtNetBSD$Dir>.Banner 97