;	[]===========================================================[]
;
;	NOTICE: THIS PROGRAM BELONGS TO AWARD SOFTWARE INTERNATIONAL(R)
;	        INC. IT IS CONSIDERED A TRADE SECRET AND IS NOT TO BE 	
;	        DIVULGED OR USED BY PARTIES WHO HAVE NOT RECEIVED	
;	        WRITTEN AUTHORIZATION FROM THE OWNER.
;
; 	[]===========================================================[]
;

;   PAGE  60,132
;=============================================================================


;=============================================================================
;FILE:  DMI_MB.INC
;
;DESC:  Motherboard information for a specific motherboard
;
;BY:    Tim Markey
;DATE:  05/24/1996
;=============================================================================
;Rev  Date     Name  Description
;----------------------------------------------------------------------------
;R33A 01/20/99 KVN Display "INTEL(R) CELERON(TM)" string for cavington CPU
;R33  01/20/99 KVN Added "INTEL(R) Pentium III" for DMI CPU type
;R32  12/10/98 KVN Added some modify for SMBIOS v2.3
;R31  10/22/98 STV Fixed run LDCM3.10 before reboot in post cmos checksum 
;		   error when have post error in event log.
;R30 09/30/98 PAL Modify Type80 PC ID and revision
;R29  09/18/98 STV 1.Added Type09 slot for "AGP" info.
;		   2.Fixed Type09 slot "In Use" detect error.
;R27A 09/16/98 STV Fixed R27 SMBIOS 2.1 for LDCM3.3 in NT not work.
;R28  09/15/98 STV Fixed Type 80 string invert
;R27  09/02/98 STV Fixed SMBIOS 2.1 for LDCM3.3 in NT not work.
;R26  08/18/98 KVN Removed all build and update type subroutine to DMI_MB.INC
;		   for support OEM customer issue
;R11A 08/18/98 KVN Added serial number of type01
;R25  06/29/98 STV Added define "HP_DMI_SUPPORT"
;R24  06/16/98 STV 1.Added DMI_GPNV_Support definition(DMI func 54h).
;		   2.Fixed DMI func 55h,56h,57h.
;R23  05/13/98 STV Added Type 13 (BIOS Language Information) for LDCM.
;		   This Type (BIOS Language Information) must always affter
;		   all the other Types.
;R22  04/22/98 STV 1.Fixed Function 54h - DMI Control , we not support so 
;		   must Return code 82h (Function not supported) for 
;		   LDCM3.21 (support SMBIOS2.1) after ver.
;		   2.Remove Type15 info & mov Type04.
;R21  03/07/98 KVN Add some definition for Tulip.
;R20  02/27/98 KVN Added system information of DMI for tulip
;R19  01/19/98 MAX Added new functions (update_type08) For PS/2 Moouse
;R18  12/11/97 Stv Added SMBIOS V2.1 new functions (ifdef SMBIOS_v21_Support)
;R17  12/05/97 KVN Fixed up PCI data width to 32 bits in DMI type 9
;R16  10/01/97 KVN Added Type 15 (System Event Log) for LDCM v3.1
;R15  09/03/97 RCH Added five PCI slots	ID support.
;R14  09/02/97 RIC Add "VT586" for VIA request.
;R13  05/26/97 KVN Fix original coding mistake that cause running LDCM DMIBrow
;		   utility error in NT OS because our BIOS build a wrong NT DMI
;		   table about type 05
;R12  12/31/96 KVN Change DMI structure of BIOS date if update BIOS code
;R11  11/05/96 STV  1.Add system and system enclosure strings, rename base board strings
;		    2.Add support for more than one CPU
;		    3.New onboard device support
;		    4.Add support for more than variable memory slots
;		    5.Fixed equates for USB and PS/2 Mouse
;R10  10/04/96 KVN  Support DMI BIOS ROM size for Flash_2M_support to 2M
;R09  09/23/96 STV  Fixed bug that DMI structure PCI slot_id error
;R08  08/21/96 KVN  Added CPU brand auto detect for DMI processor component
;R07  08/16/96 KVN  Show 'Verify DMI Pool Data' during compare DMI pool data
;R06  07/23/96 TJM  Change enclosure type from 00h to 02h (unknown)
;R05  07/10/96 TJM  Fixed type05_size size equate (bug in MASM)
;R04  06/20/96 TJM  Move CPU struct to last struct, remove ifdef 
;                   (CPU MUST BE LAST AND PRESENT AS THIS IS ONLY STRUCTURE TO FLASH)
;R03  06/20/96 TJM  Added USB Port support
;R02  06/20/96 TJM  Added keyboard and ps/2 mouse support
;R01  05/24/96 TJM  Moved from dmipost.inc dmi_mb.inc
;----------------------------------------------------------------------------

;=============================================================================
; TYPE 0 - BIOS Information
;=============================================================================
;R32 start
Type00_Length	=	12h
if DMI_BIOS_REV GE 21h
Type00_Length	=	13h
elseif DMI_BIOS_REV GE 23h
  db  14h
endif	;DMI_BIOS_REV

BIOS_CHAR_EB2	=	0
;R32 end

type00_info label byte
  db  BIOS_INFORMATION                        ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18
;R32if DMI_BIOS_REV GE 21h		;R74
;R32  db  13h                                     ;R18 len
;R32else	;SMBIOS_V21_Support		      ;R18
;R32  db  12h                                     ; len
;R32endif	;SMBIOS_V21_Support		      ;R18
	db  Type00_Length			;R32length of type
  dw  00h                                     ; handle
  db  01h                                     ; vendor string index
  db  02h                                     ; version string index
  dw  0E000h                                  ; segment
  db  03h                                     ; date string index
;R10 start
ifdef Flash_2M_support
  db  03h                                     ; rom size (256K)
else ;Flash_2M_support
;R10 end
  db  01h                                     ; rom size (128K)
endif ;Flash_2M_support				;R10
ifdef PRINT_SCREEN_SUPPORTED
  dd  BIOS_CHAR+PrintScreen                   ; bios characteristics byte low
else
  dd  BIOS_CHAR                               ; bios characteristics byte low
endif
  dd  00000000h                               ; bios characteristics byte high
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  BIOS_CHAR_EB 			      ;R18 bios characteristics extension bytes
endif	;SMBIOS_V21_Support		      ;R18
;R32 start
if DMI_BIOS_REV GE 23h
  db  BIOS_CHAR_EB2
endif	;DMI_BIOS_REV
;R32 end
  db  'Award Software International, Inc.',0  ; vendor string

ifdef	HP_DMI_SUPPORT			      ;R25
  db  'LHW.00.00',0                           ;R25 version string
else					      ;R25
  db  '4.51 PG',0                             ; version string
endif	;HP_DMI_SUPPORT			      ;R25

  db  '00-00-0000',0                          ; string terminator
  db  0                                       ; string terminator
type00_size  equ  $-offset type00_info


;=============================================================================
; TYPE 01 - System Information
;=============================================================================
type01_info label byte
  db  SYSTEM_INFORMATION                      ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  19h                                     ;R18 len
else	;SMBIOS_V21_Support		      ;R18
  db  08h                                     ; len
endif	;SMBIOS_V21_Support		      ;R18
  dw  00h                                     ; handle
  db  01h                                     ; manufacture string index
  db  02h                                     ; product string index
  db  03h                                     ; version string index
  db  04h                                     ; serial no. string index
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  16 dup(0)				      ;R18 16 Byters UUID
  db  Wake_up				      ;R18 Wake_up Type
endif	;SMBIOS_V21_Support		      ;R18
  db  Sys_Manufact_String                     ; manufacturer string  R11
  db  Sys_Product_String                      ; product string       R11
  db  Sys_Version_String                      ; version string       R11
;R11  db  0                                       ; manufacture string
;R11  db  0                                       ; product string
;R11  db  0                                       ; version string
;R11A  db  0                                       ; serial no. string 
  db  Sys_Serial_String                       ;R11A serial no. string
  db  0                                       ; string terminator
type01_size  equ  $-offset type01_info

;=============================================================================
; TYPE 02 -  Base Board Information
;=============================================================================
type02_info label byte
  db  BASE_BOARD_INFORMATION                  ; type
  db  08h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; manufacture string index
  db  02h                                     ; product string index
  db  03h                                     ; version string index
  db  04h                                     ; serial no. string index
  db  MB_Manufact_String                      ; manufacturer string  R11
  db  MB_Product_String                       ; product string       R11
  db  MB_Version_String                       ; version string       R11

;R11  db  Manufact_String                         ; manufacturer string
;R11  db  Product_String                          ; product string
;R11  db  Version_String                          ; version string
  db  0                                       ; serial no. string 
  db  0                                       ; string terminator
type02_size  equ  $-offset type02_info

;=============================================================================
; TYPE 03 - Enclosure Information
;=============================================================================
;R32 start
Type03_Length	=	9
if DMI_BIOS_REV GE 21h
Type03_Length	=	0dh
elseif DMI_BIOS_REV GE 23h
Type03_Length	=	11h
endif	;DMI_BIOS_REV

Type03_OEM_define = 0
;R32 end

type03_info label byte
  db  ENCLOSURE_INFORMATION                   ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18
;R32if DMI_BIOS_REV GE 21h		;R74
;R32  db  0dh                                     ;R18 len
;R32else	;SMBIOS_V21_Support		      ;R18
;R32  db  09h                                     ; len
;R32endif	;SMBIOS_V21_Support    		      ;R18	
	db	Type03_Length			;R32 length
  dw  00h                                     ; handle
  db  01h                                     ; manufacture string index
  db  TYPE03_UNKNOWN                          ; unknown R06
  db  02h                                     ; version string index
  db  03h                                     ; serial no. string index
  db  04h                                     ; asset tag string index
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  TYPE03_UNKNOWN			      ;R18 bootup state
  db  TYPE03_UNKNOWN			      ;R18 power supply state
  db  TYPE03_UNKNOWN			      ;R18 thermal state
  db  TYPE03_UNKNOWN			      ;R18 security state
endif	;SMBIOS_V21_Support		      ;R18
;R32 start
if DMI_BIOS_REV GE 23h
	dd	Type03_OEM_define
endif	;DMI_BIOS_REV
;R32 end
  db  Encl_Manufact_String                    ; manufacturer string  R11
  db  Encl_Product_String                     ; product string       R11
;R11  db  0                                       ; manufacture string
;R11  db  0                                       ; product string
  db  0                                       ; serial no. string 
  db  0                                       ; asset tag string
  db  0                                       ; string terminator
type03_size  equ  $-offset type03_info

;=============================================================================
; TYPE 4 - CPU Information
;=============================================================================
type04_info label byte
  db  CPU_INFORMATION                         ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  20h                                     ;R18 len 
else	;SMBIOS_V21_Support		      ;R18
  db  1Ah                                     ; len
endif	;SMBIOS_V21_Support		      ;R18	
  dw  00h                                     ; handle
  db  01h                                     ; socket string index
  db  Central_Processor                       ; processor type0 enum
;R08  db  Pentium                                 ; processor family enum
  db  Unknown					;R08
  db  02h                                     ; manufacturer string index
  dd  00000000h                               ; processor ID
  dd  00000000h                               ; 
  db  03h                                     ; processor version string index
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  0A1h		                      ;R18 3.3 voltage for smbios v2.1
else	;SMBIOS_V21_Support		      ;R18
  db  TYPE04_VOLTAGE_3_3V                     ; voltage
endif	;SMBIOS_V21_Support		      ;R18
  dw  0000h                                   ; external clock
  dw  MAX_CPU_SPEED                           ; max_speed (fill at POST)
  dw  0000h                                   ; current speed (fill at POST) R05
  db  41h                                     ; status
ifdef	KLAMATH_CPU_ONLY		      ;R21
  db  TYPE04_UPPGRADE_SLOT1		      ;R21
else;	KLAMATH_CPU_ONLY		      ;R21
  db  TYPE04_UPGRADE                          ; processor upgrade (DMI_MB.CFG)
endif;	KLAMATH_CPU_ONLY		      ;R21
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  dw  0000h				      ;R18 primary(Level1) cache
  dw  0000h				      ;R18 secondary(Level1) cache
  dw  0000h				      ;R18 tertiary(Level1) cache
endif	;SMBIOS_V21_Support		      ;R18
ifdef	KLAMATH_CPU_ONLY		      ;R21
  db  'SLOT 1',0			      ;R21 socket string index
else;	KLAMATH_CPU_ONLY		      ;R21
  db  'Socket 7',0                            ; socket string index
endif;	KLAMATH_CPU_ONLY		      ;R21
;R08  db  'Intel',0                               ; manufacturer string index
;R08  db  'Pentium',0                             ; processor string index
  db  0						;R08
  db  0						;R08
  db  0                                       ; string terminator
type04_size  equ  $-offset type04_info

;=============================================================================
; TYPE 05 - Memory Controller Information
;=============================================================================
type05_info label byte
  db  MEM_CTLR_INFORMATION                    ; type
;R13  db  15h+ (2*NUM_MEM_SLOTS)                  ; len
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  16+ (2*NUM_MEM_SLOTS)                   ;R18  len
else	;SMBIOS_V21_Support		      ;R18
  db  15+ (2*NUM_MEM_SLOTS)                   ;R13 len
endif	;SMBIOS_V21_Support		      ;R18
  dw  00h                                     ; handle
  db  MEM_ERROR_DETECTION                     ; error detection method
  db  MEM_ERROR_CORRECTION                    ; error correction capability
  db  MEM_INTERLEAVE                          ; supported interleave
  db  MEM_INTERLEAVE                          ; current interleave
  db  MEM_MAX_SIZE                            ; max mem module size
  dw  MEM_SUPPORTED_SPEEDS                    ; supported speeds
  dw  MEM_SUPPORTED_TYPES                     ; supported mem types
  db  MEM_SUPPORTED_VOLTAGE                   ; module voltage
  db  NUM_MEM_SLOTS                           ; number of associated slots
  dw  NUM_MEM_SLOTS dup (00h)                 ; Memory Module Handle
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0					      ;R18 Enabled Error Correcting Capabilities
endif	;SMBIOS_V21_Support		      ;R18	
;R13 type05_size  equ  $-offset type05_info + (2 * (NUM_MEM_SLOTS-1))   ; R05
type05_size  equ  $-offset type05_info		;R13


;=============================================================================
; TYPE 06 - Memory Module Information
;=============================================================================
type06_info label byte
  db  MEM_MOD_INFORMATION                     ; type
  db  0Ch                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; socket designation index
  db  00h                                     ; bank connections
  db  MEM_SPEEDS_UNKNOWN                      ; current speed
  dw  MEM_TYPES_UNKNOWN                       ; current memory type
  db  MEM_SIZE_NOT_DETERMINABLE               ; installed size
  db  00h                                     ; enabled size
  db  00h                                     ; error status
  db  'A1',0                                  ; socket designation
  db  0                                       ; string terminator
type06_size  equ  $-offset type06_info

;=============================================================================
; TYPE 7 - Internal Cache Information
;=============================================================================
type07_l1_info label byte
  db  CACHE_INFORMATION                       ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  13h                                     ;R18 len
else	;SMBIOS_V21_Support		      ;R18	
  db  0Fh                                     ; len
endif	;SMBIOS_V21_Support		      ;R18	
  dw  00h                                     ; handle
  db  01h                                     ; socket designation string index
  dw  TYPE07_CACHE_CFG_INTERNAL               ; cache config (fill at POST) R05
  dw  PENTIUM_INTERNAL_CACHE_SIZE             ; max cache size
  dw  PENTIUM_INTERNAL_CACHE_SIZE             ; installed size
  dw  SRAM_SYNCRHONOUS                        ; supported SRAM type (Get from BIOS.CFG)
  dw  SRAM_SYNCRHONOUS                        ; current SRAM type (Fill at POST) - R05
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0 				      ;R18 cache speed
  db  2					      ;R18 error correction type
  db  2					      ;R18 system cache type
  db  2					      ;R18 The associaivity of the cache
endif	;SMBIOS_V21_Support		      ;R18	
  db  'Internal Cache',0                      ; reference designation
  db  0                                       ; string terminator
type07_l1_size  equ  $-offset type07_l1_info

ifdef DMI_L2_ENABLED
;=============================================================================
; TYPE 7 - External Cache Information
;=============================================================================
type07_l2_info label byte
  db  CACHE_INFORMATION                       ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  13h                                     ;R18 len
else	;SMBIOS_V21_Support		      ;R18	
  db  0Fh                                     ; len
endif	;SMBIOS_V21_Support		      ;R18
  dw  00h                                     ; handle
  db  01h                                     ; socket designation string index
  dw  TYPE07_CACHE_CFG_EXTERNAL               ; cache config (fill at POST) R05
  dw  MAX_L2_SIZE                             ; max cache size
  dw  0000h                                   ; installed size
  dw  SRAM_SYNCRHONOUS                        ; supported SRAM type (Get from BIOS.CFG)
  dw  SRAM_SYNCRHONOUS                        ; current SRAM type (Fill at POST) R05
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0 				      ;R18 cache speed
  db  2					      ;R18 error correction type
  db  2					      ;R18 system cache type
  db  2					      ;R18 The associaivity of the cache
endif	;SMBIOS_V21_Support		      ;R18
  db  'External Cache',0                      ; reference designation
  db  0                                       ; string terminator
type07_l2_size  equ  $-offset type07_l2_info
endif

ifdef DMI_ONBOARD_IDE1
;=============================================================================
; TYPE 8 - Port Information - Onboard IDE
;=============================================================================
type08_ide1_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_OB_IDE                               ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_NONE                                 ; External connector type
  db  TYPE08_FUNC_OTHER                       ; Function of port
  db  'PRIMARY IDE',0                         ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_ide1_size  equ  $-offset type08_ide1_info
endif ;DMI_ONBOARD_IDE1

ifdef DMI_ONBOARD_IDE2
;=============================================================================
; TYPE 8 - Port Information - Onboard Secondary IDE
;=============================================================================
type08_ide2_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_OB_IDE                               ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_NONE                                 ; External connector type
  db  TYPE08_FUNC_OTHER                       ; Function of port
  db  'SECONDARY IDE',0                         ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_ide2_size  equ  $-offset type08_ide2_info
endif ; DMI_ONBOARD_IDE2

ifdef DMI_ONBOARD_COM1
;=============================================================================
; TYPE 8 - Port Information - Onboard COM 1
;=============================================================================
type08_com1_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_9P_DIAL_INLINE                       ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_DB9_MALE                             ; External connector type
  db  TYPE08_FUNC_SER_16450                   ; Function of port
  db  'COM1',0                                ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_com1_size  equ  $-offset type08_com1_info
endif ; DMI_ONBOARD_COM1

ifdef DMI_ONBOARD_COM2
;=============================================================================
; TYPE 8 - Port Information - Onboard COM 2
;=============================================================================
type08_com2_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_9P_DIAL_INLINE                       ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_DB9_MALE                             ; External connector type
  db  TYPE08_FUNC_SER_16450                   ; Function of port
  db  'COM2',0                         ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_com2_size  equ  $-offset type08_com2_info
endif ; DMI_ONBOARD_COM2

ifdef DMI_ONBOARD_FDD
;=============================================================================
; TYPE 8 - Port Information - Onboard FDD
;=============================================================================
type08_fdd_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_OB_FLOPPY                            ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_NONE                                 ; External connector type
  db  TYPE08_FUNC_8251_FIFO                   ; Function of port
  db  'FDD',0                                 ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_fdd_size  equ  $-offset type08_fdd_info
endif ; DMI_ONBOARD_FDD

ifdef DMI_ONBOARD_LPT1
;=============================================================================
; TYPE 8 - Port Information - Onboard LPT 1
;=============================================================================
type08_lpt1_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_DB25_FEMALE                          ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_DB25_FEMALE                          ; External connector type
  db  TYPE08_FUNC_PAR_ECP_EPP                 ; Function of port
  db  'LPT1',0                                ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_lpt1_size  equ  $-offset type08_lpt1_info
endif ; DMI_ONBOARD_LPT1

ifdef DMI_ONBOARD_KEYB
;=============================================================================
; TYPE 8 - Port Information - Keyboard
;=============================================================================
type08_keyb_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_OTHER                                ; internal connector type
  db  02h                                     ; external ref string index
ifdef DMI_KEYBOARD_PS2
  db  CT_PS_2                                 ; External connector type
else
  db  CT_OTHER                                ; External connector type
endif
  db  TYPE08_FUNC_KEYBOARD                    ; Function of port
  db  'Keyboard',0                            ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_keyb_size  equ  $-offset type08_keyb_info
endif ; DMI_ONBOARD_KEYB

ifdef DMI_PS2M_ENABLED
;=============================================================================
; TYPE 8 - Port Information - PS/2 Mouse
;=============================================================================
type08_ps2m_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_PS_2                                 ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_PS_2                                 ; External connector type
  db  TYPE08_FUNC_MOUSE                       ; Function of port
  db  'PS/2 Mouse',0                          ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_ps2m_size  equ  $-offset type08_ps2m_info
endif ; DMI_PS2M_ENABLED

ifdef DMI_USB_ENABLED
;=============================================================================
; TYPE 8 - Port Information - PS/2 Mouse
;=============================================================================
type08_usb_info label byte
  db  PORT_CON_INFORMATION                    ; type
  db  09h                                     ; len
  dw  00h                                     ; handle
  db  01h                                     ; internal ref string index
  db  CT_NONE                                 ; internal connector type
  db  02h                                     ; external ref string index
  db  CT_OTHER                                  ; External connector type
  db  TYPE08_FUNC_USB                         ; Function of port
  db  'USB',0                                 ; internal reference
  db  0                                       ; external reference
  db  0                                       ; string terminator
type08_usb_size  equ  $-offset type08_usb_info
endif ; DMI_USB_ENABLED


ifdef mouse				;R19
DMI_PS2M_ENABLED	equ	1	;R19
endif ;mouse				;R19
ifdef DMI_ISA_ENABLED
;=============================================================================
; TYPE 9 - System Slot Information (ISA) (One for each slot)
;=============================================================================
type09_isa_info label byte
  db  SYS_SLOTS_INFORMATION                   ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0dh                                     ;R18 len
else	;SMBIOS_V21_Support		      ;R18
  db  0Ch                                     ; len
endif	;SMBIOS_V21_Support		      ;R18
  dw  00h                                     ; handle
  db  01h                                     ; slot design string
  db  TYPE09_SLOT_TYPE_ISA                    ; slot type - isa
  db  TYPE09_16BIT                            ; slot dbw - 16 bits
  db  02h                                     ; current usage - unknown
  db  TYPE09_LEN_FULL                         ; slot length - unknown
  dw  00h                                     ; slot id - 0
  db  02h                                     ; slot char - 5v
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0					      ;R18 PCI siot support Power Management Disable
endif	;SMBIOS_V21_Support		      ;R18
  db  'ISA',0
  db  0                                       ; string terminator
type09_isa_size  equ  $-offset type09_isa_info
endif ; DMI_ISA_ENABLED


ifdef DMI_PCI_ENABLED
;=============================================================================
; TYPE 9 - System Slot Information (PCI) (One for each slot)
;=============================================================================
type09_pci_info label byte
  db  SYS_SLOTS_INFORMATION                   ; type
;R74 ifdef SMBIOS_V21_Support		      ;R18	
if DMI_BIOS_REV GE 21h		;R74
  db  0dh                                     ;R18 len
else	;SMBIOS_V21_Support		      ;R18
  db  0Ch                                     ; len
endif	;SMBIOS_V21_Support		      ;R18
  dw  00h                                     ; handle
  db  01h                                     ; slot design string
  db  TYPE09_SLOT_TYPE_PCI                    ; slot type - pci
;R17  db  TYPE09_64BIT                            ; slot 64 bits
  db  TYPE09_32BIT                            ;R17 slot 32 bits
  db  02h                                     ; current usage - unknown
  db  TYPE09_LEN_FULL                         ; slot length - unknown
  dw  0000h                                   ; slot id - 0
  db  TYPE09_VOLTS_5                          ; slot char - 5v
;R74 ifdef SMBIOS_V21_Support		      ;R18
if DMI_BIOS_REV GE 21h		;R74
  db  0					      ;R18 PCI siot support Power Management Disable
endif	;SMBIOS_V21_Support		      ;R18
  db  'PCI',0
  db  0                                       ; string terminator
type09_pci_size  equ  $-offset type09_pci_info
endif

;R29 start
ifdef AGP_SLOTID
;=============================================================================
; TYPE 9 - System Slot Information (AGP) (One for each slot)
;=============================================================================
type09_agp_info label byte
  db  SYS_SLOTS_INFORMATION                   ; type
if DMI_BIOS_REV GE 21h
  db  0dh                                     ; len
else	;DMI_BIOS_REV GE 21h
  db  0Ch                                     ; len
endif	;DMI_BIOS_REV GE 21h
  dw  00h                                     ; handle
  db  01h                                     ; slot design string
  db  TYPE09_SLOT_TYPE_AGP                    ; slot type - agp
  db  TYPE09_32BIT                            ; slot 32 bits
  db  02h                                     ; current usage - unknown
  db  TYPE09_LEN_FULL                         ; slot length - unknown
  dw  0000h                                   ; slot id - 0
  db  TYPE09_VOLTS_5                          ; slot char - 5v
if DMI_BIOS_REV GE 21h
  db  0					      ; PCI slot support Power Management Disable
endif	;DMI_BIOS_REV GE 21h
  db  'AGP',0
  db  0                                       ; string terminator
type09_agp_size  equ  $-offset type09_agp_info
endif ;AGP_SLOTID
;R29 end

;;;R11 start
ifdef NUM_ONBOARD_DEVS 

STRING_INDEX  = 1
;=============================================================================
; TYPE 10 - Onboard Information
;=============================================================================
type10_info label byte
  db  ONBOARD_INFORMATION           ; type
  db  4+(NUM_ONBOARD_DEVS*2)        ; structure length
  dw  00h                           ; handle (filled in at POST)

ifdef DMI_ONBOARD_OTHER             ; device type other
  db  ONBOARD_OTHER
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_VIDEO             ; Video
  db  ONBOARD_VIDEO
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_SCSI              ; Onboard SCSI
  db  ONBOARD_SCSI
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_ETHERNET          ; Onboard Ethernet
  db  ONBOARD_ETHERNET
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_TOKEN_RING        ; Onboard Token Ring
  db  ONBOARD_TOKEN_RING
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_SOUND             ; Onboard Sound
  db  ONBOARD_SOUND
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_UNKNOWN             ; device type other
  db  ONBOARD_UNKNOWN
  db  STRING_INDEX
  STRING_INDEX = STRING_INDEX + 1
endif

ifdef DMI_ONBOARD_OTHER             ; device type other
  db  onboard_other_str
endif

ifdef DMI_ONBOARD_VIDEO             ; Video
  db  onboard_video_str
endif

ifdef DMI_ONBOARD_SCSI              ; Onboard SCSI
  db  onboard_scsi_str
endif

ifdef DMI_ONBOARD_ETHERNET          ; Onboard Ethernet
  db  onboard_ethernet_str
endif

ifdef DMI_ONBOARD_TOKEN_RING        ; Onboard Token Ring
  db  onboard_token_ring_str
endif

ifdef DMI_ONBOARD_SOUND             ; Onboard Sound
  db  onboard_sound_str
endif

  db  0                                       ; string terminator

type10_size  equ  $-offset type10_info
endif

;R11 end

;R23 start
;=============================================================================
; TYPE 13 - BIOS Language Information
;=============================================================================
type13_info label byte
	db	BIOS_Language		; type
	db	16h			; len
	dw	00h			; handle
;R27	db	03h			; three languages available
;R27A	db	01h			;R27; one languages available
	db	03h			;R27A; three languages available
;R74 ifdef SMBIOS_V21_Support
if DMI_BIOS_REV GE 21h		;R74
	db	0h			; fiags
	db	15 dup (0)		; reserved
else
	db	16 dup (0)		; reserved
endif	;SMBIOS_V21_Support
	db	01h			; current language
;R27A	db	'en|US|iso8859-1',0	; langeuage 1 is US English
;R27	db	'fr|CA|iso8859-1',0	; langeuage 2 is French Canadian
;R27	db	'ja|JP|unicode',0	; langeuage 3 is Japanese
;R27A start
	db	'n|US|iso8859-1',0	; langeuage 1 is US English
	db	'r|CA|iso8859-1',0	; langeuage 2 is French Canadian
	db	'a|JP|unicode',0	; langeuage 3 is Japanese
;R27A end
	db      0                       ; string terminator
type13_size  equ  $-offset type13_info
;R23 end

;R22 ;R16 start
;R22 ;=============================================================================
;R22 ; TYPE 15 - System Event Log
;R22 ;=============================================================================
;R22 type15_info label byte
;R22 	db	SYSTEM_EVENT_LOG	; type
;R22 	db	14h			; len
;R22 	dw	00h			; handle
;R22 	dw	0h			; log area length
;R22 	dw	0h			; log header start offset
;R22 	dw	0h			; log data start offset
;R22 	db	4			; access method
;R22 	db	3			; log status
;R22 	dd	0			; log change token
;R22 	dd	0			; access method address
;R22 type15_size  equ  $-offset type15_info
;R22 ;R16 end

;R24 start
ifdef	DMI_GPNV_support
;=============================================================================
; TYPE 15 - System Event Log
;=============================================================================
type15_info label byte
	db	SYSTEM_EVENT_LOG	; type
if DMI_BIOS_REV GE 21h				;R31
	db	17h				;R31
else						;R31
	db	14h			; len
endif ;DMI_BIOS_REV GE 21h			;R31
	dw	00h			; handle
	dw	GPNV_BLOCK_SIZE*2	; log area length
	dw	0h			; log header start offset
;R31	dw	0h			; log data start offset
	dw	10h			;R31 log data start offset
	db	3			; access method
	db	1			; log status
	dd	0			; log change token
;R31	dd	0FFFFCE00h		; access method address
	dd	0FFFF0E02h		;R31 access method address
;R31 start
if DMI_BIOS_REV GE 21h
	db	1			; log header format
	db	0			; number of support log type (X)
	db	2			; number of support log type (Y)
endif ;DMI_BIOS_REV GE 21h
;R31 end
type15_size  equ  $-offset type15_info
endif	;DMI_GPNV_support
;R24 end

;R25 start
ifdef	HP_DMI_SUPPORT
;=============================================================================
; TYPE 11 - OEM String
;=============================================================================
type11_info label byte
	db	11			; type
	db	05h			; len
	dw	00h			; handle
	db	01			; Count string
	db	0			; Count string
	db	0
type11_size  equ  $-offset type11_info

;=============================================================================
; TYPE 80h - Hewlett-Packard Identification structure ID
;=============================================================================
type80_info label byte
	db	80h			; type
	db	0fh			; len
	dw	00h			; handle
;R28	dw	'HP'			; Signature
	dw	'PH'			; Signature	;R28
;R30	db	90			; PC ID
	db	90h			; PC ID		;R30
;R28	dw	'HW'			; BIOS Letter	
	dw	'WH'			; BIOS Letter	;R28
	dd	0			; HPPE Address
;R30	dw	0103h			; Spec revision
	dw	Type80_Ver		; Spec revision	;R30
type80_size  equ  $-offset type80_info
endif	;HP_DMI_SUPPORT
;R25 end

;=============================================================================
; DMI struct table
;
;    Bios information
;    System information
;    Base board information
;    Enclosure information
;    Cpu information
;    Memory controller information
;    Memory module information
;    Cache information
;    Port connector information
;    Slot information
;    Onboard information
;
;=============================================================================


dmi_tbl  label dmi_entry
;---------------------------------------------------------------------------------------------
;         Num            Structure        Structure Size      Build Function   Update Function
;---------------------------------------------------------------------------------------------
ifdef BIOS_INFO_ENABLE
;R12 dmi_entry {1,            type00_info,      type00_size,       build_type00,    0}
dmi_entry {1,            type00_info,      type00_size,       build_type00,    update_type00}	;R12
endif

ifdef SYSTEM_INFO_ENABLE
;R20 start
ifdef	BCPOEM_Table
dmi_entry {1,            type01_info,      type01_size,       0,               update_type01}
else	;BCPOEM_Table
;R20 end
dmi_entry {1,            type01_info,      type01_size,       0,               0}
endif	;BCPOEM_Table			;R20
endif

ifdef MB_INFO_ENABLE
dmi_entry {1,            type02_info,      type02_size,       0,               0}
endif

ifdef ENCLOSURE_INFO_ENABLE
dmi_entry {1,            type03_info,      type03_size,       0,               0}
endif

dmi_entry {NUM_CPU,      type04_info,      type04_size,       0,               update_type04}	;R22

ifdef DMI_MEM_CTLR_ENABLED
dmi_entry {1,            type05_info,      type05_size,       build_type05,    update_type05}
endif

ifdef DMI_MEM_MOD_ENABLED
dmi_entry {NUM_MEM_SLOTS,type06_info,      type06_size,       build_type06,    update_type06}
endif

ifdef DMI_L1_ENABLED
dmi_entry {1,            type07_l1_info,   type07_l1_size,    0,               update_type07_l1}
endif

ifdef DMI_L2_ENABLED
dmi_entry {1,            type07_l2_info,   type07_l2_size,    0,               update_type07_l2}
endif

ifdef DMI_ONBOARD_IDE1
dmi_entry {1,            type08_ide1_info, type08_ide1_size,  0,               0}
endif

ifdef DMI_ONBOARD_IDE2
dmi_entry {1,            type08_ide2_info, type08_ide2_size,  0,               0}
endif

ifdef DMI_ONBOARD_FDD
dmi_entry {1,            type08_fdd_info,  type08_fdd_size,   0,               0}
endif

ifdef DMI_ONBOARD_COM1
dmi_entry {1,            type08_com1_info, type08_com1_size,  0,               0}
endif

ifdef DMI_ONBOARD_COM2
dmi_entry {1,            type08_com2_info, type08_com2_size,  0,               0}
endif

ifdef DMI_ONBOARD_LPT1
dmi_entry {1,            type08_lpt1_info, type08_lpt1_size,  0,               0}
endif

ifdef DMI_ONBOARD_KEYB
dmi_entry {1,            type08_keyb_info, type08_keyb_size,  0,               0}
endif

ifdef DMI_PS2M_ENABLED
dmi_entry {1,            type08_ps2m_info, type08_ps2m_size,  0,               update_type08}
endif

ifdef DMI_ISA_ENABLED
dmi_entry {NUM_ISA,      type09_isa_info,  type09_isa_size,   0,               0}
endif

ifdef DMI_PCI_ENABLED
dmi_entry {NUM_PCI,      type09_pci_info,  type09_pci_size,   0,               update_type09_pci}
endif

;R29 start
ifdef AGP_SLOTID
dmi_entry {NUM_AGP,      type09_agp_info,  type09_agp_size,   0,               update_type09_agp}
endif ;AGP_SLOTID
;R29 end

;R11 start
ifdef NUM_ONBOARD_DEVS GE 1
dmi_entry {1,            type10_info,      type10_size,        0,              0}
endif

ifdef DMI_USB_ENABLED
dmi_entry {1,            type08_usb_info, type08_usb_size,  0,               0}
endif

;R11 end

;R11 start
;ifdef DMI_ONBOARD
;dmi_entry {0,            type10_info,     type10_size,        0,               0}
;endif
;R11 end

; R04
; NOTE CPU SUPPORT SHOULD ALWAYS BE LAST AS THIS IS THE ONLY UPDATE CODE
; WHICH IS SET TO ACTUALLY REFLASH THE BIOS IN ORDER TO SPEED UP THE BOOT
; PROCESS
;R11  dmi_entry {1,            type04_info,      type04_size,       0,               update_type04}
;R22 dmi_entry {NUM_CPU,      type04_info,      type04_size,       0,               update_type04}    ;R11

;R22 dmi_entry {1,            type15_info,     type15_size,        0,               0}	;R16


;R23 start
;; ************ This Type (BIOS Language Information) must always affter
;; ************ all the other Types.
dmi_entry {1,            type13_info, type13_size,  0,               0}
;R23 end

;R24 start
ifdef	DMI_GPNV_support
dmi_entry {1,            type15_info,     type15_size,        0,               0}
endif	;DMI_GPNV_support
;R24 end

;R25 start
ifdef	HP_DMI_SUPPORT
dmi_entry {1,            type11_info,     type11_size,        0,               0}

dmi_entry {1,            type80_info,     type80_size,        0,               0}
endif	;HP_DMI_SUPPORT	
;R25 edn

dmi_entry {0,            0FFFFh,          0FFFFh,             0,               0}
;---------------------------------------------------------------------------------------------


;---------------------------------------------------------------------------------------------
mem_bank_connection_table label byte
  db  MEM_BANK_CONNECT01            ; SIMM 01 banks
  db  MEM_BANK_CONNECT02            ; SIMM 02 banks
  db  MEM_BANK_CONNECT03            ; SIMM 03 banks
  db  MEM_BANK_CONNECT04            ; SIMM 04 banks

;R11 start
if NUM_MEM_SLOTS GE 6
  db  MEM_BANK_CONNECT05            ; SIMM 05 banks
  db  MEM_BANK_CONNECT06            ; SIMM 06 banks
endif
if NUM_MEM_SLOTS GE 8
  db  MEM_BANK_CONNECT07            ; SIMM 07 banks
  db  MEM_BANK_CONNECT08            ; SIMM 08 banks
endif

;R11 end


;=============================================================================
; Slot Device Number Equates.
;=============================================================================
slot_id_tbl label byte
;R09  db (SLOT1_ID SHL 3)       ; (upper 5 bits)
;R09  db (SLOT2_ID SHL 3)       ; (upper 5 bits)
  db SLOT1_ID       		; R09
ifndef ONE_PCI_SLOT_ONLY
  db SLOT2_ID        		; R09
ifndef TWO_PCI_SLOT_ONLY
;R09  db (SLOT3_ID SHL 3)       ; (upper 5 bits)
  db SLOT3_ID               ; R09
ifndef THREE_PCI_SLOT_ONLY
;R09  db (SLOT4_ID SHL 3)       ; (upper 5 bits)
  db SLOT4_ID               ; R09
endif ;THREE_PCI_SLOT_ONLY
endif ;TWO_PCI_SLOT_ONLY
endif ;ONE_PCI_SLOT_ONLY

ifdef	FIVE_PCI_SLOTS				;R15
	db	SLOT5_ID			;R15
endif;	FIVE_PCI_SLOTS				;R15			

;R29 start
ifdef AGP_SLOTID
agp_id_tbl label byte
  db  AGP_SLOTID
endif ;AGP_SLOTID
;R29 end

;=============================================================================
; Memory string table
;=============================================================================
mem_string_table label byte
  dw mem_module_str1
  dw mem_module_str2
  dw mem_module_str3
  dw mem_module_str4

;R11 start
if NUM_MEM_SLOTS GE 6               
  dw mem_module_str5
  dw mem_module_str6
endif

if NUM_MEM_SLOTS GE 8               
  dw mem_module_str7
  dw mem_module_str8
endif

;R11 end

  dw 0
ifdef	VT586		;VIA chipset	;R14 - start
mem_module_str1  db  'BANK_0',0
mem_module_str2  db  'BANK_1',0
mem_module_str3  db  'BANK_2',0
mem_module_str4  db  'BANK_3',0

if NUM_MEM_SLOTS GE 6               
mem_module_str5  db  'BANK_4',0
mem_module_str6  db  'BANK_5',0
endif

if NUM_MEM_SLOTS GE 8               
mem_module_str7  db  'BANK_6',0
mem_module_str8  db  'BANK_7',0
endif
else;	VT586				;R14 - end
;R21 start
ifdef	mem_module_str
mem_module_str1	db	mem_module_str,'1',0
mem_module_str2	db	mem_module_str,'2',0
mem_module_str3	db	mem_module_str,'3',0
mem_module_str4	db	mem_module_str,'4',0

if NUM_MEM_SLOTS GE 6               
mem_module_str5	db	mem_module_str,'5',0
mem_module_str6	db	mem_module_str,'6',0
endif

if NUM_MEM_SLOTS GE 8               
mem_module_str7	db	mem_module_str,'7',0
mem_module_str8	db	mem_module_str,'8',0
endif

else	;mem_module_str
;R21 end
mem_module_str1  db  'A0',0
mem_module_str2  db  'A1',0
mem_module_str3  db  'A2',0
mem_module_str4  db  'A3',0

;R11 start
if NUM_MEM_SLOTS GE 6               
mem_module_str5  db  'A4',0
mem_module_str6  db  'A5',0
endif

if NUM_MEM_SLOTS GE 8               
mem_module_str7  db  'A6',0
mem_module_str8  db  'A7',0
endif
endif	;mem_module_str			;R21
endif;	VT586				;R14
 

;R11 end

;R26 start
;=============================================================================
; FUNC: BUILD_TYPE00 - (BIOS Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
build_type00 proc uses ds 

  pusha                             ; save all general registers

  mov   cx,0                        ; instance of information
  mov   bh,BIOS_INFORMATION         ; BIOS information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  jc    build_type00_exit           ; quit if structure not found

;R32 start
if DMI_BIOS_REV GE 23h
	F000_call	F000_Shadow_W		; Enable F000 shadow writeable
	mov	si,0f000h			
	mov	ds,si
	mov	si,0ec71h
	mov	bl,10		;date string length
	call	Fill_Zstring	;
	mov	bl,ofs type00.bios_date     ; date string index
	call	update_dmi_string           ; change word in structure
	shr	esi,16		
	pop	word ptr ds:[si]
else ;DMI_BIOS_REV
;R32 end
  mov   si,0f000h			
  mov   ds,si
  mov   si,DATE_STRING_OFFSET       ; add date string
  mov   bl,ofs type00.bios_date     ; date string index

  call  update_dmi_string           ; change word in structure
endif ;DMI_BIOS_REV			;R32

build_type00_exit:

  popa                              ; restore all general registers

  ret                               ; 

build_type00 endp


;=============================================================================
; FUNC: BUILD_TYPE05 - (Memory Controller Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
;       DX    - handle of current structure + 1
; OUT:  NONE
;=============================================================================
build_type05 proc uses ds 

  pusha                             ; save all general registers

  mov   ax,dx                       ; save handle in AX

  mov   cx,0                        ; instance of information
  mov   bh,MEM_CTLR_INFORMATION     ; Memory Controller information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  jc    build_type05_exit           ; quit if structure not found

  mov   cx,NUM_MEM_SLOTS            ; number of memory slots

  mov   bl,ofs type05.mem_mod_hndl_list  ; offset

  .repeat
    mov   bh,DMI_CHANGE_WORD          ; Change single WORD
    call  update_dmi_component        ; change word in structure
    inc   ax                          ; AX = next handle
    add   bl,2                        ; set BL to next handle location
  .untilcxz

build_type05_exit:

  popa                              ; restore all general registers

  ret                               ; 

build_type05 endp


;=============================================================================
; FUNC: BUILD_TYPE06 - (Memory Module Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
;       DX    - handle of current structure + 1
; OUT:  NONE
;=============================================================================
build_type06 proc uses ds es

  pusha                             ; save all general registers

  mov   ax,dx                       ; save handle in AX
  push  cs                          ; set DS to CS
  pop   ds
  xor   cx,cx                       ; clear memory module count in CX


  lea   si,mem_bank_connection_table

  .repeat

    mov   bh,MEM_MOD_INFORMATION    ; Memory Module information
    mov   bl,0                      ; no other match required
    call  get_struct_hdr            ; get DMI structure in EDX
    jc    build_type06_exit         ; quit if structure not found

    push  edx
    mov   al,[si]
    mov   bh,DMI_CHANGE_BYTE        ; Change single BYTE
    mov   bl,ofs type06.bank_connection ; offset
    call  update_dmi_component      ; change word in structure
    inc   si                        ; point SI to next bank connection

    push  si
    movzx bx,cl
    shl   bx,1                      ; word table
    lea   si,mem_string_table       ; get start of mem string table
    mov   si,wptr [si+bx]           ; get pointer to string
    mov   bl,ofs type06.socket_designation ; date string index
    call  update_dmi_string         ; change word in structure
    pop   si
    pop   edx

    inc   cl                        ; get next instance

  .until cl >= NUM_MEM_SLOTS

build_type06_exit:


  popa                              ; restore all general registers

  ret                               ; 

build_type06 endp

;=============================================================================
; FUNC: UPDATE_TYPE00 - (BIOS Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type00	proc	near
	jmp	build_type00
update_type00 endp

ifdef	BCPOEM_Table
;=============================================================================
; FUNC: UPDATE_TYPE01 - (System Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type01	proc	near
  pusha                             ; save all general registers

  mov   cx,0                        ; instance of information
  mov   bh,SYSTEM_INFORMATION       ; SYSTEM information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  jc    build_type01_exit           ; quit if structure not found

  F000_call	F000_Shadow_W		; Enable F000 shadow writeable
  mov   si,0f000h
  mov   ds,si
  mov   si,offset System_Manu
	mov	bl,20h		; string length
	call	Fill_Zstring	;
  mov   bl,ofs type01.Manufacturer
  call  update_dmi_string           ; change word in structure
	shr	esi,16		
	pop	word ptr ds:[si]

  mov   si,offset System_Name
	mov	bl,20h		; string length
	call	Fill_Zstring	;
  mov   bl,ofs type01.Product_Name
  call  update_dmi_string           ; change word in structure
	shr	esi,16		
	pop	word ptr ds:[si]

  mov   si,offset System_Ser
	mov	bl,10		; string length
	call	Fill_Zstring	;
  mov   bl,ofs type01.Serial_Number
  call  update_dmi_string           ; change word in structure
	shr	esi,16		
	pop	word ptr ds:[si]
  F000_call	F000_Shadow_R		; Enable F000 shadow readonly

build_type01_exit:

  popa                              ; restore all general registers

  ret                               ; 
update_type01 endp
endif	;BCPOEM_Table			;R32
;Input : BL = counter
;Input : SI = point offset
Fill_Zstring:
		push	si		;store original SI
		cld
@@:
		lodsb			;load value of string
		cmp	al,0ffh		;Is 0FFh?
		je	short @F	;Yes,found it
		dec	bl		;decrease counter
		jnz	short @B	;Not over then continue
		inc	si		;next point
@@:
		dec	si		;set correct point
		mov	ax,ds:[si]	;store original value
		mov	byte ptr ds:[si],0	;fill to zero
		shl	esi,16		;store to high word of ESI
		pop	si		;restore original SI
		pop	bx
		push	ax		;push original value to stack
		jmp	bx
;R32endif	;BCPOEM_Table

;=============================================================================
; CPU speed conversion table used for update_type04 function
;=============================================================================
cpu_speed_table label byte
cpu_entry {CPU100, 100}             ;R49 100Mhz
cpu_entry {CPU83, 83}               ; 83 Mhz
cpu_entry {CPU75, 75}               ; 75 Mhz
cpu_entry {CPU66, 66}               ; 66 Mhz
cpu_entry {CPU60, 60}               ; 60 Mhz
cpu_entry {CPU50, 50}               ; 50 Mhz
cpu_entry {CPU40, 40}               ; 40 Mhz
cpu_entry {CPU33, 33}               ; 33 Mhz
cpu_entry {CPU25, 25}               ; 25 Mhz
cpu_entry {CPU20, 20}               ; 20 Mhz
cpu_entry {CPU16, 16}               ; 16 Mhz
cpu_entry {0, 0}                    ; Table Terminator

null_str	db	0	
Intel_str	db	'Intel',0

;CPU information for P6 platform
ifdef	P6_BIOS_ONLY
PentiumPro_str:
		db	'Pentium Pro',0	
PentiumII_str:	db	'Pentium II',0			
PentiumII_Celeron_str:	db	"INTEL(R) CELERON(TM)",0	;R50
PentiumIII_str:	db	'Pentium III',0				;R33
else;	P6_BIOS_ONLY
;CPU information for P5 platform
Pentium_str	db	'Pentium',0
PentiumMMX_str	db	'Pentium-MMX',0		
Cyrix_str	db	'Cyrix',0
Cy6x86_str	db	'6x86',0
Cy6x86MX_str	db	'6x86MX',0		
AMD_str		db	'AMD',0
AMD_K5_str	db	'AMD-K5',0
AMD_K6_str	db	'AMD-K6',0		
IDT_str		db	'IDT',0
IDT_C6_str	db	'IDT WinChip C6',0
endif;	P6_BIOS_ONLY

;=============================================================================
; FUNC: UPDATE_TYPE04 - (Processor Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type04 proc uses ds

	push	es	
  pusha                             ; save all general registers

ifdef	P6_BIOS_ONLY
	mov	ecx,2AH			;Power on Config. Reg.
	RDMSR
	test	eax,080000H		;bit 19 on (100Mhz) ?
					;1=100Mhz
	jz	short Not_100MHZ
	mov	al,100			;external clock (100MHZ)
	jmp	ut04_speed_found
Not_100MHZ:
endif	;P6_BIOS_ONLY

  mov   ax,G_RAM                    ; point DS to BIOS data area (40:)
  mov   ds,ax                       ; 
	xor	bx,bx	
	mov	es,bx	
  mov   ah,byte ptr ds:CPU_CLOCK    ; read CPU clock speed into AH
  and   ah,CPU_CLOCK_MASK           ; 
                                     
  push  cs                          ; point DS:SI to cpu_speed_table
  pop   ds                          ; 
  lea   si,cpu_speed_table          ; 
  assm  si:ptr cpu_entry            ; assume SI points to cpu_entry struct

  .repeat
    .if   ah == [si].actual_speed   ; if speed matches entry in table
      mov   al,[si].display_speed   ;  then set AL to display speed
      jmp   ut04_speed_found        ; jmp as we are done
    .endif                          ; 
    add   si,sizeof cpu_entry       ; Add size of cpu_entry to SI 
  .until  [si].actual_speed == 0    ; repeat until terminator found

ut04_speed_found:

  mov   cx,0                        ; instance of information
  .repeat	
  mov   bh,CPU_INFORMATION          ; cpu information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  jc    ut04_exit                   ; quit if structure not found

  push	ax	
  push	cx	
  xor   ah,ah                       ; clear upper byte of external clock field
  mov   bl,ofs type04.external_clock  ; offset
  mov   bh,DMI_CHANGE_WORD          ; Change single WORD
  call  update_dmi_component        ; change word in structure

      mov   ax,CPU_INT_CLOCK[bp]        ; get internal clock speed from table

  mov   bl,ofs type04.current_speed ; offset
  mov   bh,DMI_CHANGE_WORD          ; Change single WORD
  call  update_dmi_component        ; change word in structure

	mov	al,41h		;assume CPU enable
	cmp	byte ptr es:[500H],0AAH ;2 CPUs plugged
	je	short @F
	pop	cx
	push	cx
	or	cl,cl
	jz	short @F
	mov	al,42h		;CPU disable by user
@@:
  mov   bl,ofs type04.status		; offset
  mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
  call  update_dmi_component        ; change word in structure

	call  ct_get_processor_id_lo      ; get CPU ID (step/model/family)
	cmp	byte ptr es:[500H],0AAH ;2 CPUs plugged
	je	short @F
	pop	cx
	push	cx
	or	cl,cl
	jz	short @F
	xor	eax,eax
@@:
  mov   bl,ofs type04.lo_processor_id ; offset
  mov   bh,DMI_CHANGE_DWORD         ; Change single WORD
  call  update_dmi_component        ; change word in structure

  push  bx
  mov   bh,SET_INFO_MASK             ; and                            
  mov   bl,LAST_SET                 ; or  - flash                     
  call  update_dmi_state            ; set state variable for updates  
  pop   bx

  call  ct_get_processor_id_hi      ; get CPU id hi (feature flags)
	cmp	byte ptr es:[500H],0AAH ;2 CPUs plugged
	je	short @F
	pop	cx
	push	cx
	or	cl,cl
	jz	short @F
	xor	eax,eax
@@:
  mov   bl,ofs type04.hi_processor_id ; offset
  mov   bh,DMI_CHANGE_DWORD         ; Change single WORD
  call  update_dmi_component        ; change word in structure

	cmp	byte ptr es:[500H],0AAH ;2 CPUs plugged
	je	short @F
	pop	cx
	push	cx
	or	cl,cl
	jz	short @F
	mov	al,Unknown
	lea	di,null_str
	mov	si,di
	jmp	Update_CPU_Brand	
@@:
ifdef	P6_BIOS_ONLY					
	pushad						
	post_func_call	Read_CpuID		;get CPU ID  
	cmp	al,30h			;klamath ?	
	popad						
	mov	al,PentiumII		;yes		
	lea	di,PentiumII_str			
ifdef	KLAMATH_CPU_ONLY		;R50
	jae	short P_II_Yes				
else	;KLAMATH_CPU_ONLY		;R50
	jae	short Exit_PCU_str	;R50
endif	;KLAMATH_CPU_ONLY		;R50

	mov	al,PentiumPro			
	lea	di,PentiumPro_str		
;R50 P_II_Yes:					
;R50 start
ifdef	KLAMATH_CPU_ONLY
P_II_Yes:
	pushad						
	post_func_call	Read_CpuID		;get CPU ID  
	and	al,11110000b		;mask stepping
;R33 start
	cmp	al,70H			;067XH ?
	jb	short Below_Pentium_III
	popad
	mov	al,PentiumII
	lea	di,PentiumIII_str
	jmp	short Fill_CPU_String
Below_Pentium_III:
;R33 end
	cmp	al,60H			;066XH ?

;R33A start
	je	short Is_Celeron
        mov     ecx,11EH	        ; L2 control register 3 (CTL3).
	RDMSR
        test	eax,00800000h           ; CTL3, hardware disable bit 23.
        jnz      short Is_Celeron	;if cavington CPU then jump
	popad
	jmp	short Exit_PCU_str
Is_Celeron:
;R33A end

	popad

;R33A	jne	short Exit_PCU_str
	mov	al,PentiumII		;yes
	lea	di,PentiumII_Celeron_str
endif	;KLAMATH_CPU_ONLY
Exit_PCU_str:
;R50 end
else	;P6_BIOS_ONLY				
	mov	al,Pentium
	lea	di,Pentium_str
endif	;P6_BIOS_ONLY				
Fill_CPU_String:			;R33
	lea	si,Intel_str
	mov	bh,CPU_BRAND[bp]
	cmp	bh,CPU_BRAND_INTEL
ifdef	P6_BIOS_ONLY				
	je	short Update_CPU_Brand
else	;P6_BIOS_ONLY
	jne	short @F

	Post_func_call	Check_IdtCpu		;is IDT C6 CPU ?
	jne	short Not_IdtCpu
	mov	al,Other
	lea	si,IDT_str
	lea	di,IDT_C6_str
	jmp	short Update_CPU_Brand
Not_IdtCpu:

	pushad
	post_func_call	Read_CpuID		;get CPU ID
	bt	edx,23				;test MMX ?
	popad
	jnc	short Update_CPU_Brand
	lea	di,PentiumMMX_str		;set to MMX string
	jmp	short Update_CPU_Brand
@@:
	cmp	bh,CPU_BRAND_AMD
	jne	short @F
	Post_func_call	Check_K6_Cpu
	mov	al,K5_CPU
	lea	si,AMD_str
	lea	di,AMD_K5_str
	jnz	short Update_CPU_Brand
	lea	di,AMD_K6_str
	jmp	short Update_CPU_Brand
@@:
	cmp	bh,CPU_BRAND_CYRIX
	jne	short @F
	call	Check_M2		
	mov	al,M1_CPU
	lea	si,Cyrix_str
	lea	di,Cy6x86_str
	jnz	short Update_CPU_Brand
	lea	di,Cy6x86MX_str
	jmp	short Update_CPU_Brand
@@:
endif;	P6_BIOS_ONLY				


	jmp	short Next_CPU	

Update_CPU_Brand:
	mov	bl,ofs type04.processor_family
	mov	bh,DMI_CHANGE_BYTE          ; Change single WORD
	call	update_dmi_component        ; change word in structure
	mov	bl,ofs type04.processor_manufacturer
	call	update_dmi_string           ; change stringin structure
	mov	bl,ofs type04.processor_version
	mov	si,di
	call	update_dmi_string           ; change stringin structure
Next_CPU:
	pop	cx
	pop	ax
	inc	cx
  
	.until cx >= NUM_CPU
ut04_exit:

  popa                              ; restore all general registers
	pop	es	
  assm  si:ptr nothing              ; assume SI points to nothing

  ret                               ; 

update_type04 endp

;Input : None
;Output: ZF = M2
;	 NZ = M1
Check_M2:
	mov	al,0feh			;DIR 0
	out	22h,al
	in	al,23H			;read CPU device ID
	and	al,0f0h
	cmp	al,50h
	ret

;=============================================================================
; FUNC: UPDATE_TYPE05
;
; DESC: Update the following information:
;       1.  Current Interleave
;
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type05 proc uses ds 

  pusha                             ; save all general registers
  assm  bx:ptr  dmi_entry         ; assume BX points to dmi_entry
  xor   cx,cx

    mov   bh,MEM_CTLR_INFORMATION     ; Memory Controller information
    mov   bl,0                        ; no other match required
    call  get_struct_hdr              ; get DMI structure in EDX
    jc    ut05_exit		      ; quit if structure not found

    ;==========================================================================
    ; Set Current Interleave
    ;==========================================================================
    call  ct_get_dmi_mem_interleave   ; get the memory current interleave for this chipset
    mov   bl,ofs type05.current_interleave ; offset
    mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
    call  update_dmi_component        ; change structure

    ;==========================================================================
    ; Set Error Detecting Method
    ;==========================================================================
    call  ct_get_dmi_mem_error_detecting   ; get the memory current interleave for this chipset
    mov   bl,ofs type05.error_detecting ; offset
    mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
    call  update_dmi_component        ; change structure

ut05_exit:
  assm  bx:ptr nothing              ; assume BX points to nothing
  popa                              ; restore all general registers

  ret                               ; 

update_type05 endp
 
;=============================================================================
; FUNC: UPDATE_TYPE06
;
; DESC: Update the following information:
;       1.  Current Memory Type
;       2.  Current Installed Size
;       3.  Current Enabled Size
;       4.  Current Speed
;
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type06 proc uses ds

  pusha                             ; save all general registers

  assm  bx:ptr  dmi_entry         ; assume BX points to dmi_entry
  xor   cx,cx

  .repeat

    push  cx

    mov   bh,MEM_MOD_INFORMATION      ; memory module information
    mov   bl,0                        ; no other match required
    call  get_struct_hdr              ; get DMI structure in EDX

    .if   carry?
      pop   cx
      jmp   ut06_exit                   ; quit if structure not found
    .endif

    ;==========================================================================
    ; Set Memory Type
    ;==========================================================================
    call  ct_get_dmi_memory_type      ; get the memory type for this chipset
    mov   bl,ofs type06.current_mem_type ; offset
    mov   bh,DMI_CHANGE_WORD          ; Change single WORD
    call  update_dmi_component        ; change structure

    ;==========================================================================
    ; Set Installed Size
    ;==========================================================================
    call  ct_get_dmi_mem_size         ; get the memory type for this chipset
    mov   bl,ofs type06.installed_size ; offset
    mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
    call  update_dmi_component        ; change structure

    ;==========================================================================
    ; Set Enabled Size
    ;==========================================================================
    mov   bl,ofs type06.enabled_size  ; offset
    mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
    call  update_dmi_component        ; change structure

    ;==========================================================================
    ; Set Memory Speed
    ;==========================================================================
    call  ct_get_dmi_mem_speed        ; get the memory speed for this chipset
    mov   bl,ofs type06.current_speed ; offset
    mov   bh,DMI_CHANGE_BYTE          ; Change single BYTE
    call  update_dmi_component        ; change structure
    pop   cx

    inc   cx

  .until cx >= NUM_MEM_SLOTS

ut06_exit:

  popa                              ; restore all general registers
  assm  bx:ptr nothing              ; assume BX points to nothing

  ret                               ; 

update_type06 endp

;=============================================================================
; FUNC: UPDATE_TYPE07_L1 - (Internal Cache Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type07_l1 proc uses ds

  pusha                             ; save all general registers

  post_func_call  IntCache_Status             ; get internal cache status in AL
  mov   al,80h                      ; assume that cache is on
  .if   zero?
    xor   al,al                     ; Cache is OFF
  .endif
  or    al,TYPE07_CACHE_CFG_INTERNAL ; Internal cache config
  mov   ah,01				

  mov   cx,0                        ; instance of information
  mov   bh,CACHE_INFORMATION        ; cache information
  mov   bl,0                        ; has to be an internal cache
  call  get_struct_hdr              ; get DMI structure in EDX

  .if  !carry?
    mov   bl,ofs type07.cache_config ; offset
    mov   bh,DMI_CHANGE_WORD         ; Change single WORD
    call  update_dmi_component       ; change word in structure
  .endif

ifdef	P6_BIOS_ONLY
	pushad
	post_func_call	Read_CpuID		;get CPU ID
	cmp	al,30h				;Pentium II?
	popad
	mov	ax,32				;Pentium II L1 cache size = 32K
	jae	short Update_Cache_Size		;Yes,jump
	mov	ax,16				;Pentium Pro L1 cache size = 16K
else	;P6_BIOS_ONLY
	mov	bh,CPU_BRAND[bp]
	cmp	bh,CPU_BRAND_INTEL
	jne	short Not_Intel_CPU
	pushad
	post_func_call	Read_CpuID		;get CPU ID
	bt	edx,23				;test MMX ?
	popad
	mov	ax,32				;Pentium-MMX L1 cache size = 32K
	jc	short Update_Cache_Size		;Yes,jump
	mov	ax,16				;Pentium L1 cache size = 16K
	jmp	short Update_Cache_Size
Not_Intel_CPU:
	cmp	bh,CPU_BRAND_AMD
	jne	short Not_AMD_CPU
	Post_func_call	Check_K6_Cpu		;Is K6?
	mov	ax,16				;AMD-K5 L1 cache size = 16K
	jnz	short Update_Cache_Size		;No,jump
	mov	ax,64				;AMD-K6 L1 cache size = 64K
	jmp	short Update_Cache_Size
Not_AMD_CPU:
	call	Check_M2
	mov	ax,16				;Cyrix-M1 L1 cache size = 16K
	jnz	short Update_Cache_Size		;No,jump
	mov	ax,64				;Cyrix-M2 L1 cache size = 64K
endif	;P6_BIOS_ONLY

Update_Cache_Size:
	push	ax
	mov	bl,ofs type07.install_size	; offset
	mov	bh,DMI_CHANGE_WORD		; Change single WORD
	call	update_dmi_component		; change word in structure
	pop	ax
	mov	bl,ofs type07.max_size		; offset
	mov	bh,DMI_CHANGE_WORD		; Change single WORD
	call	update_dmi_component		; change word in structure

  popa                              ; restore all general registers

  ret

update_type07_l1 endp

;=============================================================================
; FUNC: UPDATE_TYPE07_02 - (External Cache Information)
;
; DESC: Update the structure with current information from POST
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type07_l2 proc uses ds

  pusha                             ; save all general registers

  post_func_call  ExtCache_Status             ; get external cache status in zero flag
  mov   al,80h                      ; assume Cache is ON
  jnz   short @F                    ; if zero than cache is ON
  xor   al,al                       ; Cache is OFF
@@:
  or    al,TYPE07_CACHE_CFG_EXTERNAL ; External cache config
  mov   ah,1                         ; Unknown operational mode

  mov   cx,1                        ; instance of information
  mov   bh,CACHE_INFORMATION        ; cache information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  jc    ut07_l2_exit                ; quit if structure not found

  call	ct_get_dmi_cache_config	    
  mov   bl,ofs type07.cache_config  ; offset
  mov   bh,DMI_CHANGE_WORD          ; Change single WORD
  call  update_dmi_component        ; change word in structure

ifdef	P6_BIOS_ONLY
	mov	eax,2			;read cache isze
	db	0Fh,0A2h		;OP code: CPUID
	post_func_call	Convert_P6L2_Cache	;convert cache size
else;	P6_BIOS_ONLY

  F000_call  Get_Cache_Size         ; get cache size AL
endif;	P6_BIOS_ONLY					
  xor   ah,ah                       ; 
  or    al,al                       ; 
  .if   !zero?
    mov   cl,al                     ; 
    mov   al,8                      ; 
    shl   ax,cl                     ; 
  .endif
  push  cx
  push  bx
  mov   cx,1                        ; instance of information
  mov   bh,CACHE_INFORMATION        ; cache information
  mov   bl,0                        ; no other match required
  call  get_struct_hdr              ; get DMI structure in EDX
  pop   bx
  pop   cx
  jc    ut07_l2_exit                ; quit if structure not found

  mov   bl,ofs type07.install_size  ; offset
  mov   bh,DMI_CHANGE_WORD          ; Change single WORD
  call  update_dmi_component        ; change word in structure

  mov	ax,MAX_L2_SIZE
  mov   bl,ofs type07.max_size  ; offset
  mov   bh,DMI_CHANGE_WORD          ; Change single WORD
  call  update_dmi_component        ; change word in structure

ut07_l2_exit:                       ; 

  popa                              ; restore all general registers

  ret

update_type07_l2 endp

;=============================================================================
; FUNC: BUILD_TYPE08 - (Port Connector Information For PS/2 Mouse)
;
; DESC: Update the structure with current port connector information from POST
;					  (     For PS/2 Mouse     )
;          
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
		 
ifdef DMI_PS2M_ENABLED
mouse_no_detect_string   	db  'No '
mouse_detect_string		db  'Detected',0

update_type08	proc  near
       pusha
       xor        cx,cx
       push       ds
Scan_ps2_mouse_Loop:
       mov        bh,PORT_CON_INFORMATION       ; BIOS information
       mov        bl,0                  	; no other match required
       call       get_struct			; get DMI structure in EDX
     .if   !carry?
       mov        edx,dptr[si]			; put structure header in EDX
       cmp        byte ptr ds:[si].type08.port_type,TYPE08_FUNC_MOUSE ;compare port type == mouse
       jne	short @F			
       cmp        byte ptr ds:[si].type08.internal_connector,ct_ps_2  ;compare internal connector == ps2 
       je	short ps2_mouse_mode
@@:
       inc        cx
       jmp	short Scan_ps2_mouse_Loop	;Scan ps2 mouse subroutine
     .else
       pop      ds 
       jmp      update_type08_exit 
ps2_mouse_mode:
     .endif
       pop	ds

       mov        si,ofs mouse_detect_string	;si == 'Detected'
       mov        bl,type08.external_ref        ; date string index
       PUSH       gs
       push       0f000h			;SYSTEM1_BYTE start address 
       pop	  gs
       test       byte ptr gs:[SYSTEM1_BYTE],04h;PS2 mouse ?
       jnz        short @F			;Yes 
       mov        si,ofs mouse_no_detect_string ;si == 'No'
@@:
       POP        gs

       call       update_dmi_string             ; change word in structure
update_type08_exit: 
       popa                                     ; restore all general registers
        
       ret                                      ; 
             
  update_type08 endp
            
endif ;DMI_PS2M_ENABLED
;=============================================================================
; FUNC: UPDATE_TYPE09_PCI
;
; DESC: Update the following information:
;       1.  Current Usage
;       2.  Slot ID = slot number field of PCI interupt routing option
;
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
update_type09_pci proc uses ds
; local route_buffer[IRQ_BUF_SIZE]:byte

  pusha                             ; save all general registers

  push  cs
  pop   es
  lea   di,slot_id_tbl              ; load slot ID table into ES:DI

  xor   cx,cx                       ; clear count in CX

  .repeat

    mov   bh,SYS_SLOTS_INFORMATION  ; pci slot information
    mov   bl,ofs type09.slot_type   ; no other match required
    mov   al,TYPE09_SLOT_TYPE_PCI   ; has to be a PCI slot
    call  get_struct_hdr            ; get DMI structure in EDX
    jc    ut09_pci_exit             ; quit if structure not found

    push  cx
    mov   al,byte ptr es:[di]                ; get device number
    xor   ah,ah                     ; slot id offset 0AH set to zero
    mov   bl,ofs type09.slot_id     ; offset
    mov   bh,DMI_CHANGE_WORD        ; Change single WORD
    call  update_dmi_component      ; change word in structure

    shl   al,3			    ;R29
    mov   bl,al                     ; put slot usage  into BL
    mov   bh,0                      ;R29 put slot usage bus into BH (PCI)
    call  ct_get_pci_slot_usage     ; return whether slot is used or not
    mov   bl,ofs type09.current_usage ; offset
    mov   bh,DMI_CHANGE_BYTE        ; Change single BYTE
    call  update_dmi_component      ; change word in structure


    inc   di                        ; get next slot id
    pop   cx
    inc   cx
  
  .until cx >= NUM_PCI              ; instance of information

ut09_pci_exit:                      ; quit

  popa                              ; restore all general registers

  ret

update_type09_pci endp
;R26 end

;R29 strat
;=============================================================================
; FUNC: UPDATE_TYPE09_AGP
;
; DESC: Update the following information:
;       1.  Current Usage
;       2.  Slot ID = slot number field of PCI interupt routing option
;
; IN:   DS:BX - Table Entry
; OUT:  NONE
;=============================================================================
ifdef AGP_SLOTID
update_type09_agp proc uses ds
; local route_buffer[IRQ_BUF_SIZE]:byte

  pusha                             ; save all general registers

  push  cs
  pop   es
  lea   di,agp_id_tbl          ; load AGP slot ID table into ES:DI

  xor   cx,cx                       ; clear count in CX

  .repeat

    mov   bh,SYS_SLOTS_INFORMATION  ; pci slot information
    mov   bl,ofs type09.slot_type   ; no other match required
    mov   al,TYPE09_SLOT_TYPE_AGP   ; has to be a PCI slot
    call  get_struct_hdr            ; get DMI structure in EDX
    jc    ut09_agp_exit             ; quit if structure not found
    push  cx
    mov   al,byte ptr es:[di]       ; get device number
    xor   ah,ah                     ; slot id offset 0AH set to zero
    mov   bl,ofs type09.slot_id     ; offset
    mov   bh,DMI_CHANGE_WORD        ; Change single WORD
    call  update_dmi_component      ; change word in structure

    mov   bl,al                     ; put slot usage  into BL
    mov   bh,1                      ; put slot usage bus into BH (AGP)
    call  ct_get_pci_slot_usage     ; return whether slot is used or not
    mov   bl,ofs type09.current_usage ; offset
    mov   bh,DMI_CHANGE_BYTE        ; Change single BYTE
    call  update_dmi_component      ; change word in structure


    inc   di                        ; get next slot id
    pop   cx
    inc   cx
  
  .until cx >= NUM_AGP              ; instance of information

ut09_agp_exit:                      ; quit

  popa                              ; restore all general registers

  ret
update_type09_agp endp
endif ;AGP_SLOTID
;R29 end

