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