1 \ Copyright (c) 2000 Daniel C. Sobral <dcs@freebsd.org>
4 \ Redistribution and use in source and binary forms, with or without
5 \ modification, are permitted provided that the following conditions
7 \ 1. Redistributions of source code must retain the above copyright
8 \ notice, this list of conditions and the following disclaimer.
9 \ 2. Redistributions in binary form must reproduce the above copyright
10 \ notice, this list of conditions and the following disclaimer in the
11 \ documentation and/or other materials provided with the distribution.
13 \ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 \ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 \ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 \ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 \ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 \ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 \ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 \ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 \ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 \ $FreeBSD: src/sys/boot/forth/pnp.4th,v 1.2 2001/12/11 00:49:34 jhb Exp $
26 \ $DragonFly: src/sys/boot/forth/pnp.4th,v 1.1 2003/11/10 06:08:34 dillon Exp $
34 ." Probing " dup @ pnph.name @ dup strlen type ." ..." cr
35 0 over @ pnph.enumerate @ ccall drop
41 ." PNP scan summary:" cr
42 pnpdevices stqh_first @
46 dup pnpi.ident stqh_first @ pnpid.ident @ dup strlen type
47 dup pnpi.desc @ ?dup if
57 : compare-pnpid ( addr addr' -- flag )
59 over c@ over c@ <> if drop drop false exit then
67 : search-pnpid ( id -- flag )
69 pnpdevices stqh_first @
73 dup pnpi.ident stqh_first @
74 begin ( pnpinfo pnpident )
75 dup pnpid.ident @ r@ compare-pnpid
78 \ XXX Temporary debugging message
79 ." Found " pnpid.ident @ dup strlen type
81 ." : " dup strlen type
87 pnpid.link stqe_next @
97 : skip-space ( addr -- addr' )
106 : skip-to-space ( addr -- addr' )
116 : premature-end? ( addr -- addr flag )
117 postpone dup postpone c@ postpone 0=
118 postpone if postpone exit postpone then
125 only forth also support-functions
131 \ Search for filename
132 skip-space premature-end?
134 \ Search for end of filename
135 skip-to-space premature-end?
137 \ Search for timestamp
138 skip-space premature-end?
140 skip-to-space premature-end?
144 skip-space premature-end?
146 skip-to-space dup c@ >r
149 filename dup strlen 1 ['] (load) catch if
151 ." Error loading " filename dup strlen type cr
162 s" /boot/pnpid.conf" O_RDONLY fopen fd !