1 /* $NetBSD: biosmca.S,v 1.4 2003/02/01 14:48:18 dsl Exp $ */
4 * Ported to boot 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
6 * Mach Operating System
7 * Copyright (c) 1992, 1991 Carnegie Mellon University
10 * Permission to use, copy, modify and distribute this software and its
11 * documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
18 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
20 * Carnegie Mellon requests users of this software to return to
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
27 * any improvements or extensions that they make and grant Carnegie Mellon
28 * the rights to redistribute these changes.
32 Copyright 1988, 1989, 1990, 1991, 1992
33 by Intel Corporation, Santa Clara, California.
37 Permission to use, copy, modify, and distribute this software and
38 its documentation for any purpose and without fee is hereby
39 granted, provided that the above copyright notice appears in all
40 copies and that both the copyright notice and this permission notice
41 appear in supporting documentation, and that the name of Intel
42 not be used in advertising or publicity pertaining to distribution
43 of the software without specific, written prior permission.
45 INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
46 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
47 IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
48 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
50 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
51 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
54 /* extracted from netbsd:sys/arch/i386/stand/bios_disk.S */
56 #include <machine/asm.h>
59 .globl _C_LABEL(biosmca_ps2model)
60 _C_LABEL(biosmca_ps2model): .long 0
64 # BIOS call "INT 0x15 Function 0xc0" to read extended sys config info on PS/2
65 # Return: no return value
67 # This function initializes biosmca_ps2model with model number as
68 # identified by BIOS, if the machine is a PS/2 box (i.e. has MCA bus
82 call _C_LABEL(prot_to_real) # enter real mode
89 movb $0xc0, %ah # subfunction
93 # check feature byte 1 if MCA bus present and replaces ISA
95 andb $0x02, %al # bit 1 set means MCA instead of ISA
96 # see also arch/i386/mca/mca_machdep.c
99 # save model and submodel bytes to %cx
100 movb %es:2(%bx), %ch # model (1 byte)
101 movb %es:3(%bx), %cl # submodel (1 byte)
104 calll _C_LABEL(real_to_prot) # back to protected mode
108 movl %ecx, _C_LABEL(biosmca_ps2model)