⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.inc

📁 AMI 主板的BIOS源码。
💻 INC
📖 第 1 页 / 共 2 页
字号:
	mov	ax,Q_MARK_DMI_EVENTS_AS_READ	;set to 'No' if new event happen
	call	set_cmos_item_checksum
	jmp	logging_event_end

log_space_full:
	mov	(LOG_BUFFER ptr [si]).log_capacity,1; space full

logging_event_end:
	popad
	pop	ds
	ret
logging_event	endp
;-----------------------------------------------------------------------;
;			LOGGING_DATE_TIME				;
;-----------------------------------------------------------------------;
; This routine will read the current date/time from CMOS and put into	;
; the event log buffer. 						;
; input :								;
;	DS:DI = event log to be updated 				;
; output:								;
;	none								;
; register usage : can be all except ES 				;
;-----------------------------------------------------------------------;
logging_date_time	proc	near
	add	di,LOG_RECORD.year	;offset of date/time field
	mov	bx,offset cs:date_time_cmos_reg
	mov	cx,(offset cs:date_time_cmos_reg_end - offset cs:date_time_cmos_reg)
set_date_time_field:
	mov	al,cs:[bx]
	call	read_cmos_date_time
	mov	[di],al
	inc	bx
	inc	di
	loop	set_date_time_field
	ret
logging_date_time	endp
;-----------------------------------------------------------------------;
;			READ_CMOS_DATE_TIME				;
;-----------------------------------------------------------------------;
; This routine will read the date/time field from CMOS. 		;
; input :								;
;	AL	index							;
; output:								;
;	AL	data							;
; register usage : none 						;
;-----------------------------------------------------------------------;
read_cmos_date_time	proc	near
	push	ax
update_complete_01:
	mov	al,8ah				; NMI off
	call	cmos_data_in_xx 		; (al) = read the data
	test	al,80h				; update in progress ?
	jnz	update_complete_01		; yes...
	pop	ax

cmos_data_in_xx:
	pushf					; save current interrupt status
	cli					; disable interrupts
	out	70h,al
	jcxz	$+2
	jcxz	$+2
	in	al,71h
	popf
	ret
read_cmos_date_time	endp
;-----------------------------------------------------------------------;
;			DATE_TIME_CMOS_REG				;
;-----------------------------------------------------------------------;
; CMOS map for data/time field						;
;-----------------------------------------------------------------------;
date_time_cmos_reg		label	byte
	db	89h		;CMOS year
	db	88h		;CMOS month
	db	87h		;CMOS day
	db	84h		;CMOS hour
	db	82h		;CMOS minute
	db	80h		;CMOS second
date_time_cmos_reg_end		label	byte
;-----------------------------------------------------------------------;
;			WRITE_EVENT_LOG_DATA_TO_GPNV			;
; this routine writes the EVENT LOG data to GPNV.			;
; input :								;
;	AX:0000	used as buffer						;
; output:								;
;	NC	writing to GPNV is successful				;
;	CY	writing to GPNV is not successful			;
;  registers destroyted: none						;
;-----------------------------------------------------------------------;
	public	write_event_log_data_to_gpnv
write_event_log_data_to_gpnv:
	push	ds
	push	es
	pushad
	mov	es,ax
	xor	si,si
	cmp	(LOG_BUFFER ptr es:[si]).log_validity,0; invalid?
	jz	weldtg_00		; current log data in GPNV is invalid
	cmp	(LOG_BUFFER ptr es:[si]).log_change,0; changed?
	jz	weldtg_00		; Br. if event log didn't change
	mov	cx,(LOG_BUFFER ptr es:[si]).log_size;size of event log data
	jcxz	weldtg_00		; Br. if event log buffer is empty
	inc	cx			; include the end indicator 0ffh
	mov	si,LOG_BUFFER.log_data	; SI = start of the event log data

	push	gs
	mov	bx,GPNV_DMI_EVENT_LOG_BIT	; attribute of the concerned GPNV area
; DS:SI = ptr to EVENT LOG data
	push	si
	push	cx
	push	bx
	push	0f000h
	pop	gs				; GS = BIOS selector
	call	get_gpnv_attribute_information	; get the GPNV area details


; BX = handle# of GPNV area if it exists
	pop	dx				; DX = attribute
	pop	cx				; CX = # of bytes
	movzx	ecx,cx				; ECX = # of bytes
	pop	di				; ES:DI = ptr to EVENT LOG data
	movzx	edi,di				; ES:EDI = ptr to EVENT LGO data
; ES:EDI = ptr to buffer containing the DMI data structures
; ECX	 = DMI data structures size in BYTEs
; BX	 = handle# of GPNV area if it exists
; DX	 = attribute of GPNV area
	mov	ax,cgroup:ram_segment
	sub	ah,10h
	mov	ds,ax
	xor	esi,esi
; DS:ESI = ptr to scratch buffer long enough to contain the whole GPNV area
; ES:EDI = ptr to buffer containing the data of the GPNV area
; ECX	 = size of the data in BYTEs
; BX	 = handle# of GPNV area
; DX	 = attribute of GPNV area
; GS	 = BIOS selector
	call	update_gpnv_attribute		; update GPNV area

	pop	gs
weldtg_00:
	popad
	pop	es
	pop	ds
	ret


;-----------------------------------------------------------------------;
;			parse_all_post_errors_to_buffer 		;
;-----------------------------------------------------------------------;
; This routine parse all post error bits record previously and save the ;
; analyzed bits to event log buffer					;
; input :								;
;	cgroup:first_bp 	1st set of POST errors			;
;	bp			2nd set of POST errors			;
;	cgroup:dim_SysStatus	DIM POST errors 			;
;	DS:0000			Event log buffer			;
; output:								;
;	buffer updated							;
; register usage : none 						;
;-----------------------------------------------------------------------;
parse_all_post_errors_to_buffer proc

	push	ds
	push	es
	pushad

;---------------------------------------;
; 1st set of POST errors		;
;---------------------------------------;
; Flag - cgroup:first_bp
	mov	bx,cgroup:first_bp	; get 1st set of POST error
	xor	si,si			; SI = event log buffer start address

	test	bx,cache_memory_err_bit
	jz	lpe1_00
	or	(LOG_BUFFER ptr [si]).post_err1,CACHE_MEMORY_ERROR
lpe1_00:
;; GVC
;;	test	bx,power_on_bit 	; for ps/2 mouse error
;;	jz	lpe1_01
;;	or	(LOG_BUFFER ptr [si]).post_err1,PS2_MOUSE_ERROR
;;lpe1_01:
;;	and	bx,not (soft_reset_bit+cache_memory_err_bit+end_key_err_bit+power_on_bit+ins_key_err_bit)
	and	bx,not (power_on_bit+soft_reset_bit+cache_memory_err_bit+end_key_err_bit+power_on_bit+ins_key_err_bit)
	or	word ptr (LOG_BUFFER ptr [si]).post_err1,bx

;---------------------------------------;
; 2nd set of POST errors		;
;---------------------------------------;
; DS:SI = event log buffer
; Flag - BP
	test	bp,floppy_disk_ctl_err_bit
	jz	lpe2_00
	or	(LOG_BUFFER ptr [si]).post_err1,FLOPPY_CONTROLLER_FAILURE
lpe2_00:
	test	bp,floppy_disk_0_err_bit
	jz	lpe2_01
	or	(LOG_BUFFER ptr [si]).post_err1,FLOPPY_DRIVE_0_ERROR
lpe2_01:
	test	bp,floppy_disk_1_err_bit
	jz	lpe2_02
	or	(LOG_BUFFER ptr [si]).post_err1,FLOPPY_DRIVE_1_ERROR
lpe2_02:
	test	bp,cmos_time_err_bit
	jz	lpe2_03
	or	(LOG_BUFFER ptr [si]).post_err1,CMOS_TIME_NOT_SET
lpe2_03:

;---------------------------------------;
; DIM POST errors			;
;---------------------------------------;
; DS:SI = event log buffer
; Flag - cgroup:dim_sysStatus

	mov	eax,dword ptr cgroup:dim_SysStatus
	and	eax,7fh
	jz	lpe3_00
	shl	eax,18
	or	(LOG_BUFFER ptr [si]).post_err2,eax
lpe3_00:
	mov	ebx,dword ptr cgroup:dim_SysStatus	; EBX = System status
	test	ebx,STAT_SYS_CONF_LPT
	jz	lpe3_02
	or	(LOG_BUFFER ptr [si]).post_err2,PARALLEL_PORT_RESOURCE_CONFLICT
lpe3_02:
	test	ebx,STAT_SYS_CONF_COM
	jz	lpe3_03
	or	(LOG_BUFFER ptr [si]).post_err2,SERIAL_PORT_1_RESOURCE_CONFLICT
	or	(LOG_BUFFER ptr [si]).post_err2,SERIAL_PORT_2_RESOURCE_CONFLICT
lpe3_03:
	test	ebx,STAT_SYS_CONF_FLOPPY
	jz	lpe3_04
	or	(LOG_BUFFER ptr [si]).post_err2,FDC_RESOURCE_CONFLICT
lpe3_04:
	test	ebx,STAT_SYS_CONF_IDE
	jz	lpe3_05
	or	(LOG_BUFFER ptr [si]).post_err2,PRIMARY_ATA_RESOURCE_CONFLICT
	or	(LOG_BUFFER ptr [si]).post_err2,SECONDARY_ATA_RESOURCE_CONFLICT
lpe3_05:
	mov	ebx,cgroup:dim_IsaStatus	; EBX = ISA status
	test	ebx,STAT_ISA_CONFLICT
	jz	lpe3_06
	or	(LOG_BUFFER ptr [si]).post_err2,STATIC_RESOURCE_CONFLICT
lpe3_06:

	mov	ebx,cgroup:dim_PciStatus	; EBX = PCI status
	test	ebx,STAT_PCI_IO_CONFLICT
	jz	lpe3_07
	or	(LOG_BUFFER ptr [si]).post_err2,PCI_IO_CONFLICT
lpe3_07:
	test	ebx,STAT_PCI_MEM_CONFLICT
	jz	lpe3_08
	or	(LOG_BUFFER ptr [si]).post_err2,PCI_MEMORY_CONFLICT
lpe3_08:
	test	ebx,STAT_PCI_IRQ_CONFLICT
	jz	lpe3_09
	or	(LOG_BUFFER ptr [si]).post_err2,PCI_IRQ_CONFLICT
lpe3_09:

	cmp	(LOG_BUFFER ptr [si]).post_err2,0
	jz	lpe3_01
	or	(LOG_BUFFER ptr [si]).post_err1,SECOND_DWORD_HAS_VALID_DATA
lpe3_01:

	popad
	pop	es
	pop	ds
	ret

parse_all_post_errors_to_buffer endp


;-----------------------------------------------------------------------;
; Temporary data area used in code segment				;
;-----------------------------------------------------------------------;
first_bp	dw	0
dim_SysStatus	dd	0
dim_IsaStatus	dd	0
dim_PciStatus	dd	0

;-----------------------------------------------------------------------;
;*****************************************************************;
;*****************************************************************;
;**                                                             **;
;**     (C)Copyright 1985-1999, American Megatrends Inc.        **;
;**                                                             **;
;**                     All Rights Reserved.                    **;
;**                                                             **;
;**             6145-F, Northbelt Parkway, Norcross,            **;
;**                                                             **;
;**             Georgia - 30071, USA. Phone-(770)-246-8600.     **;
;**                                                             **;
;*****************************************************************;
;*****************************************************************;
;-----------------------------------------------------------------------;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -