Checking for Micro Channel Bus

Introduction
Assembly Routine

Content by David L. Beem (original HERE) and Tomáš Slavotínek.
Last update: 03 Mar 2022 (more code corrections)


Introduction

In many of the PS/2 routines you may need to check if the system is a Micro Channel computer. This routine does that check, setting the Carry flag if the system does not have the Micro Channel bus. If it is a Micro Channel system, the Carry flag is clear and the AL register holds the number of Micro Channel 'slots'. Be aware that some of the system planar resources may be identified as a 'slot'.

This routine becomes harder in BASIC or QB (the version included with MS-DOS) with the lack of the CALL INTERRUPT statement. IBM moved the "Get Configuration" table on some of the PS/2s (it started at F000:E6F5h on older IBM systems), otherwise a PEEK at the the particular bit in BIOS could be used. One possible way around this is to POKE an Assembly routine into memory and then execute it.


Assembly Routine

;----------------------------------------------
; CheckMCA Assembly routine
;
; This routine checks whether the system has a
; Micro Channel (MCA) bus.
;
; Returns:
;     CF clear if Micro Channel bus
;         AL = Number of MCA slots (0 for 7552)
;     CF set on failure or if not Micro Channel bus
;         AL = 0
;
; Destroys AX,BX,ES,FLAGS
;----------------------------------------------

CheckMCA proc near
; Check for MCA system
	mov	AH, C0h
	int	15h
	mov	AL, 0    ; default to 0 slots
	jc	Failure  ; Leave if call unsupported
	test	byte ptr ES:[BX+5], 2  ; MCA flag bit?
	jz	Failure  ; Leave if not MCA system
; Detect 7552 (non-standard MCA)
	cmp	byte ptr ES:[BX+2], FCh  ; IBM 286?
	jne	Slots
	cmp	byte ptr ES:[BX+3], 6  ; 7552 Gearbox?
	je	Success  ; Report MCA w/ zero slots on 7552
; Get slot count
Slots:
	cli  ; mask interrupts
	mov	AL, 1
	out	75h, AL  ; NVRAM index high
	out	4Fh, AL  ; delay (dummy I/O op.)
	mov	AL, 8Eh
	out	74h, AL  ; NVRAM index high
	out	4Fh, AL  ; delay (dummy I/O op.)
	in	AL, 76h  ; NVRAM data from index 18Eh
	sti  ; allow interrupts
	cmp	AL, 8    ; # of slots must be <= 8
	jbe	Success
	mov	AL, 4    ; default to 4 slots
Success:
	clc
	retn
Failure:
	stc
	retn
CheckMCA endp

Notes:

  • The PS/2 Model 50, 50Z, and 55SX, as well as the Industrial Models 7541/7542 (because both are based on a Model 50Z planar) lack the 2 KB Extended CMOS RAM ("NVRAM") that is used for a Micro Channel configuration of more than four adapters.
  • The IBM 7552 "Gearbox" (BIOS Model FCh, Submodel 06h) has Micro Channel adapter interposers that can be installed, but implements the Micro Channel configuration by a different method from later designs, therefore it is excluded by this detection routine.

Content created and/or collected by:
Louis F. Ohland, Peter H. Wendt, David L. Beem, William R. Walsh, Tatsuo Sunagawa, Tomáš Slavotínek, Jim Shorney, Tim N. Clarke, Kevin Bowling, and many others.

Ardent Tool of Capitalism is maintained by Tomáš Slavotínek.
Last update: 24 Mar 2024 - Changelog | About | Legal & Contact