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

📄 oempost.asm

📁 AMI 主板的BIOS源码
💻 ASM
📖 第 1 页 / 共 5 页
字号:
        call    get_cmos_item           ;AL = 0/1 for drive swap disable/enable
        jz      drive_not_swap
	mov	ah,04h
drive_not_swap:

        mov     al,q_fdd_access_control
        call    get_cmos_item           ;AL = 0/1 for drive protect disable/enable
        jz      drive_protect
	or	ah,1
drive_protect:
	mov	bl,0
        mov     al,0f0h
        extrn   IT8661FWriteIO:near
        call    IT8661FWriteIO
endif
if	MKF_WIN877
        mov     al,Q_FLOPPY_SWAP
        call    get_cmos_item
        jz      no_swap
        and     byte ptr ds:[15h],0bfh  ; Clear SWAP flag for INT-40 routine
        mov     ax,8001h
        extrn   Win877WriteIO:near
        call    Win877WriteIO
no_swap:
        mov     al,q_fdd_access_control
        call    get_cmos_item
        jz      fdd_rw
        mov     ax,3008h
        call    Win877WriteIO
fdd_rw:
endif
        ret
oem_program_ws  endp
;-----------------------------------------------------------------------;
;                               E000_CONTROL_BEFORE                     ;
;-----------------------------------------------------------------------;
; check point           : A7                                            ;
; this routine is called for OPTIONAL ROM shadow before E000 ROM control;
; in GS1.ASM.                                                           ;
; input :                                                               ;
;       SS      0030H                                                   ;
;       DS      0040H                                                   ;
;       ES      0000H                                                   ;
;       stack   available                                               ;
; output:                                                               ;
;       (ZF)    1 -> no further control to E000 ROM.                    ;
;               0 -> E000 ROM will get control                          ;
; register usage : can destroy any register except EBP,DS,ES,FS,GS      ;
; NOTE:                                                                 ;
;       1. Disable E000 shadow.                                         ;
;       2. Disable E000 ROM CS.                                         ;
; Purpose: if any ISA ROM is present at E000, this routine will enable  ;
;       ISA ROM access.                                                 ;
;-----------------------------------------------------------------------;
        public  e000_control_before
e000_control_before:
; Disable E000 Shadow
	mov	ax,7400h
	call	write_pci_byte
	mov	ah,75h
	call	write_pci_byte

; Disable E000 ROM CS
	mov	ah,040h
	call	read_sio_byte
	and	al,0fch
	call	write_sio_byte

        or      sp,sp                   ; (ZF) = 0, give control to E000
        ret                             ; else no control to e000_control_after
;-----------------------------------------------------------------------;
;                               E000_CONTROL_AFTER                      ;
;-----------------------------------------------------------------------;
; check point           : A9                                            ;
; this routine is called for ADAPTER ROM shadow after E000 ROM control  ;
; in GS1.ASM.                                                           ;
; input :                                                               ;
;       CX    = 0000H, no ISA ROM found at E000 segment                 ;
;             <>0000H, some ISA ROM found at E000 segment               ;
;       SS      0030H                                                   ;
;       DS      0040H                                                   ;
;       ES      0000H                                                   ;
;       stack   available                                               ;
; register usage : can destroy any register except EBP,DS,ES,FS,GS      ;
; NOTE:                                                                 ;
;       1. If no ISA ROM found at E000, simply ret.                     ;
;       2. If ISA ROM found at E000 and if E000 shadow is enabled in    ;
;       Setup (there is no Setup Question for this, you need to implement
;       it), enable E000 shadow and copy E000 ISA ROM to E000 shadow.   ;
;-----------------------------------------------------------------------;
        public  e000_control_after
e000_control_after:
        jcxz    eca_00          ; no ROM found at E000 segment

;  ROM found at E000 segment, write code here to enable E000 shadow and
;  copy E000 ROM to shadow.............................................

eca_00:
        ret
;-----------------------------------------------------------------------;
;                       OEM_SPECIAL_CONFIG_DISPLAY                      ;
;-----------------------------------------------------------------------;
; check point           : AA                                            ;
; this routine is called from special_config_display in POST.ASM to     ;
; display any OEM specific configuration.                               ;
; input :                                                               ;
;       ds      0040h                                                   ;
;       es      0000h                                                   ;
;       stack available                                                 ;
; register usage : can destroy any register except EBP,DS,ES,FS,GS      ;
;-----------------------------------------------------------------------;
        extrn   edo_memory_msg:abs
        extrn   rsdram_memory_msg:abs
        extrn   sdram_memory_msg:abs
        extrn   fpm_memory_msg:abs
	extrn	write_tty:near
        extrn   display_0d0a:near
        extrn   display_message_set:near
	extrn	read_cursor_posn:near
	extrn	set_cursor_posn:near
	extrn	dmi_mem_module_info:near

        public  oem_special_config_display
oem_special_config_display:
;; Display DRAM Types Information
	mov	dx,10			; Check SDRAM
        mov     bh,sdram_memory_msg
	call	display_dram_info

	mov	dx,4			; Check EDO
        mov     bh,edo_memory_msg
	call	display_dram_info

	mov	dx,3			; Check FP
        mov     bh,fpm_memory_msg
	call	display_dram_info

        ret

display_dram_info:
	mov	ax,1
next_dimm:
	push	ax
	call	dmi_mem_module_info
	pop	ax
	cmp	bl,7fh
	jz	dimm_no_dram
	bt	cx,dx
	jnc	dimm_no_dram
	or	ah,ah
	jnz	skip_show_title
	push	ax
        mov     bl,09h
        call    display_message_set
	pop	ax
skip_show_title:
	or	ah,ah
	jz	@f
	push	ax
	mov	al,','
	call	write_tty
	pop	ax
@@:
	push	ax
	add	al,30h
	call	write_tty
	pop	ax
	mov	ah,0ffh
dimm_no_dram:
	inc	ax
	cmp	al,4
	jnz	next_dimm
	or	ah,ah
	jz	dis_info_done
	call	read_cursor_posn	; DH,DL = row,col of cursor
	cmp	dl,40
	ja	goto_next_row
	mov	dl,40
set_cursor:
	call	set_cursor_posn		; set cursor posn
dis_info_done:
	ret
goto_next_row:
	call	display_0d0a
	ret

;-----------------------------------------------------------------------;
					; (CORE0228),(CORE0206+)>
	include	dc.equ
dc_oem_arrangement	label	byte
	db	dc_math_processor,	dc_base_memory
	db	dc_floppy_a,		dc_ext_memory
	db	dc_floppy_b,		dc_serial_port
	db	dc_display_type,	dc_parallel_port
	db	dc_amibios_date,	dc_processor_clock
	db	dc_l2_cache,		dc_apm_smi
;	db	dc_sdram_type,		dc_ecc_info
;	db	dc_k6_3_l2_cache,	dc_apm_version
	db	0ffh			; end

dc_oem_routines_table	label	word
;dc_sdram_type		equ	dc_oem_index_start
;	dw	offset cgroup:sdram_type
;
;dc_ecc_info		equ	dc_oem_index_start+1
;	dw	offset cgroup:ecc_info
;
;dc_k6_3_l2_cache	equ     dc_oem_index_start+2
;	dw	offset cgroup:k6_3_l2_cache
;
;dc_apm_version		equ	dc_oem_index_start+3
;	dw	offset cgroup:apm_version
;---------------------------------------;
; Example				;
;---------------------------------------;-------------------------------;
; Input:
;	None
; Output:
;	Message displayed with ':'
; Registers destroyed:
;	All except BP,DS,ES,FS,GS
; NOTES: Please use display_dc_colon for "xxxx : " string
;-----------------------------------------------------------------------;
;	extrn	sdram_type_msg:abs
;sdram_type:
;	mov	bl,9
;	mov	bh,sdram_type_msg
;	call	display_dc_colon	; "SDRAM TYPE      : "
;	ret
;ecc_info:
;	mov	bl,9
;	mov	bh,
;	call	display_dc_colon
;	ret
;k6_3_l2_cache
;	mov	bl,9
;	mov	bh,
;	call	display_dc_colon
;	ret
;apm_version
;	mov	bl,9
;	mov	bh,
;	call	display_dc_colon
;	ret

;-----------------------------------------------------------------------;
; Input:
;	DI	index
;---------------------------------------;
	public	dc_oem_routines
dc_oem_routines:
	sub	di,dc_oem_index_start
	shl	di,1
	call	word ptr cs:dc_oem_routines_table[di]
	retf
;---------------------------------------;
display_dc_colon:
	push	bp
	push	ds

	push	cs
	push	offset dc_return	; return address for retf

	extern	ram_segment:word
	mov	ds,cgroup:ram_segment
	push	ds:[0feb4h+2]		; segment
	push	ds:[0feb4h]		; offset
	mov	bp,dc_display_colon
	retf				; far jump to DC public routines entry
dc_return:
	pop	ds
	pop	bp
	ret
;---------------------------------------;
; Output:
;	ES:SI	point to dc_oem_arrangement
;---------------------------------------;
	public	get_dc_oem_table
get_dc_oem_table:
	push	cs
	pop	es
	mov	si,offset cgroup:dc_oem_arrangement
	ret
					; <(CORE0228),(CORE0206+)
;-----------------------------------------------------------------------;
;                       GET_SHADOW_STATUS                               ;
;-----------------------------------------------------------------------;

⌨️ 快捷键说明

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