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

📄 oempost.asm

📁 AMI 主板的BIOS源码
💻 ASM
📖 第 1 页 / 共 5 页
字号:
; this routine returns the information whether shadow ram can be made   ;
; readable and writeable at the same time i.e. whether read ram and     ;
; write ram is possible.                                                ;
; input :                                                               ;
;       stack   available                                               ;
; output:                                                               ;
;       cy      routine not implemented                                 ;
;       nc      routine implemented                                     ;
;       DI      shadow ram attribute                                    ;
;               bit-0 = 0 shadow ram read and write not possible        ;
;                       1 shadow ram read write possible                ;
;               bit-1 = 0 VGA memory not USWC                           ;
;                       1 VGA memory USWC                               ;
;               bit15-2= reserved (set to 0)                            ;
;       SI      bit 3-0 = C000 shadow ram cacheable in 16k granularity  ;
;                   bit-0 C0000-C3FFF                                   ;
;                   bit-1 C4000-C7FFF                                   ;
;                   bit-2 C8000-CBFFF                                   ;
;                   bit-3 CC000-CFFFF                                   ;
;               bit 7-4 = D000 shadow ram cacheable in 16k granularity  ;
;               bit11-8 = E000 shadow ram cacheable in 16k granularity  ;
;               bit15-12= F000 shadow ram cacheable in 16k granularity  ;
;       ECX,EDX USWC memory region1 32-bit start address, size in bytes ;
;       EAX,EBX USWC memory region2 32-bit start address, size in bytes ;
; register usage : can destroy any register except EBP,DS,ES,FS,GS      ;
; NOTE: 1. do not program anything in this routine.                     ;
;       2. in this routine, CS should NOT be assumed as F000.           ;
;       3. if read ram and write ram is possible, then in the hooks     ;
;       E000_READ_X_WRITE_RAM and F000_READ_X_WRITE_RAM, make read ram  ;
;       and write ram.                                                  ;
;       4. Set both start address and size to 0000 for a region which   ;
;       will not be set to USWC.                                        ;
;-----------------------------------------------------------------------;
first_shadow_question   label   byte
        db      Q_DC000_SHADOW
        db      Q_D8000_SHADOW
        db      Q_D4000_SHADOW
        db      Q_D0000_SHADOW
        db      Q_CC000_SHADOW
        db      Q_C8000_SHADOW
;        db      Q_C4000_SHADOW
        db      Q_C0000_SHADOW
        db      Q_C0000_SHADOW
last_shadow_question    label   byte
number_shadow_questions equ     (last_shadow_question - first_shadow_question)
        public  get_shadow_status
get_shadow_status:
        xor     si,si                   ; default to no areas shadowed

        call    check_cmos_8e           ; check if cmos checksum good
        jnz     gss_exit                ; exit if not

        test    bp,ins_key_err_bit      ; <INS> key pressed ?
        jnz     gss_exit                ; exit if yes

        mov     di,offset first_shadow_question
        mov     cx,number_shadow_questions
gss_00:
        mov     al,byte ptr cs:[di]
        call    check_cmos_data
        inc     di              ; point to next CMOS question
        cmp     al,2            ; is shadow cache enabled?
        jne     gss_01          ; jump if NOT
        or      si,01h          ; else OR in this bit
gss_01:
        shl     si,1            ; shift si for next shadow region
        loop    gss_00          ; do this for up to 8 regions
        shr     si,1            ; fix up after testing last region
;
; Next see if we are supposed to cache the system BIOS region (0f0000)
;
        mov     al,Q_CACHE_BIOS
        call    check_cmos_data
;;        or      al,al           ; is system BIOS cacheable set?
        jz      gss_02          ; jump if not
        or      si,0f000h       ; else OR in the 4 0F0000 page bits
;
; next decide whether to set the VGA frame buffer region to
; USWC memory type.
;
gss_02:
        xor	di,di
;        mov     al,VGA_FRAME_BUFFER_USWC
;        call    check_cmos_data
;        jz      gss_exit
;        or      di,00000010b

gss_exit:
        xor     ecx,ecx         ; no USWC region1
        xor     edx,edx
        xor     eax,eax         ; no USWC region2
        xor     ebx,ebx
        clc
        ret
;-----------------------------------------------------------------------;
;                       DISPLAY_CPU_NAME_PRATING                        ;
; This routine displays CPU name and PRating.                           ;
; If you do not want to display the PRating along with the CPU name,    ;
; then you have to modify this routine to display only the CPU name.    ;
; input :                                                               ;
;       none                                                            ;
; output:                                                               ;
;       none                                                            ;
; register usage : do not destroy any register                          ;
;-----------------------------------------------------------------------;
        extrn   cpu_name_display_buffer:byte
        extrn   write_tty:near
        extrn   display_message_cs:near
        public  display_cpu_name_prating
display_cpu_name_prating:
	pusha
	mov	si,offset cgroup:cpu_name_display_buffer
	call	display_message_cs	; display cpu name
;---------------------------------------;
; if you do not want to display PRating along with the CPU name,
; then comment out the following lines between {PR_STARTS and PR_ENDS}
	extrn	pr_string:byte
	cmp	byte ptr cgroup:[pr_string+2],0 ; 
	jz	dcnp_00
	mov	si,offset pr_string
	call	display_message_cs
dcnp_00:
;---------------------------------------;
	popa
        ret
;-----------------------------------------------------------------------;
;                       CHECK_DISPLAY_CPU_CLOCK                         ;
; This routine returns the information whether the CPU clock will be    ;
; displayed.                                                            ;
; input :                                                               ;
;       none                                                            ;
; output:                                                               ;
;       NC      display cpu clock                                       ;
;       CY      do not display cpu clock                                ;
; register usage : do not destroy any register                          ;
; Note :                                                                ;
; 1. For AMD CPU, you may want not to display PRating along with        ;
; the CPU name and may want to display PRating in place of CPU clock.   ;
; In this case, this routine should return as CLC (i.e. display CPU     ;
; clock) and DISPLAY_CPU_CLOCK routine should display PRating instead of;
; CPU clock frequency.                                                  ;
; 2. Default code returns CY i.e. not to display CPU clock frequency for;
; AMD CPU with PRating. For AMD CPU without PRating, default code will  ;
; return NC i.e. to display CPU clock frrequency.                       ;
;-----------------------------------------------------------------------;
        public  check_display_cpu_clock
check_display_cpu_clock:
	extrn	_sysinfo_flag:word
	test	cgroup:byte ptr _sysinfo_flag,01h	; bit0=0, don't display clock
	jz	cdcc_no_clock
	cmp	cs:byte ptr [pr_string+2],00h; PRating exists ?
	jnz	cdcc_no_clock		; yes, do not display clock if PRating
	clc				; NC, display clock
	jmp	short cdcc_exit
cdcc_no_clock:
	stc				; CY, do not display CPU clock
cdcc_exit:
	ret
;-----------------------------------------------------------------------;
;                       DISPLAY_CPU_CLOCK                               ;
; This routine displays the CPU clock.                                  ;
; input :                                                               ;
;       none                                                            ;
; output:                                                               ;
;       none                                                            ;
; register usage : do not destroy any register                          ;
; Note :                                                                ;
; 1. For AMD CPU, you may want not to display PRating along with        ;
; the CPU name and may want to display PRating in place of CPU clock.   ;
; In this case, the CHECK_DISPLAY_CPU_CLOCK routine should return as CLC;
; (i.e. display CPU clock) and this routine should display PRating      ;
; instead of CPU clock frequency.                                       ;
; 2. Default code is to display CPU clock frequency.                    ;
;-----------------------------------------------------------------------;
        extrn   mhz_msg:abs
        extrn   cpu_freq:word
        extrn   display_ax:near
	extrn	get_reset_id:near
	extrn	write_tty:near
        extrn   display_message_set0:near
        public  display_cpu_clock
display_cpu_clock:
	pusha
	mov	ax,cs:cpu_freq
	call	display_ax
	mov	bh,mhz_msg
	call	display_message_set0
	popa
        ret

;-----------------------------------------------------------------------;
;-----------------------------------------------------------------------;
;                       SILENT BOOT HOOKS                               ;
;-----------------------------------------------------------------------;
IF      MKF_SILENT_BOOT
;-----------------------------------------------------------------------;
;                       OEM_INIT_SILENT_BOOT                            ;
; this routine initializes any OEM specific stuff for silent boot. this ;
; routine is called from INIT_SILENT_BOOT routine at check point 37h    ;
; while initializing the data areas needed for silent boot.             ;
; allowed.                                                              ;
; input :                                                               ;
;       none                                                            ;
; output:                                                               ;
;       none                                                            ;
; register usage : Do not destroy any register                          ;
;                                                                       ;
;                       IMPLEMENTATION NOTE                             ;
; 1. This routine can be used to initialize any OEM specific data area  ;
; which can be used to display any OEM specific stuff dynamically e.g.  ;
; status of BIOS POST progress.                                         ;
; 2. A 16 byte data area VideoOemData is defined for this purpose in    ;
; DIMDATASEG.                                                           ;
;-----------------------------------------------------------------------;
        public  oem_init_silent_boot
oem_init_silent_boot:
        ret
;-----------------------------------------------------------------------;
;                       OEM_DYNAMIC_SILENT_BOOT_DISPLAY                 ;
; this routine is called from INT1C handler inside timer interrupt if   ;
; the current active display is OEM.                                    ;
; input :                                                               ;
;       none                                                            ;
;       EOI has not yet been issued to Interrupt Controller             ;
; output:                                                               ;
;       none                                                            ;
; register usage : Do not destroy any register                          ;
;                                                                       ;
;                       IMPLEMENTATION NOTE                             ;
; 1. This routine can be used to display any OEM specific dynamic       ;
; information e.g. status of BIOS POST progress.                        ;
; 2. If any data area is needed for this, 16 byte data area VideoOemData;
; is defined for this purpose in DIMDATASEG. This data area should be   ;
; initialized in OEM_INIT_SILENT_BOOT hook and can be updated in this   ;
; hook.                                                                 ;
; 3. Use INT 10h to display anything from here. DO NOT USE any BIOS     ;
; display routines because BIOS display routines will put the concerned ;
; charecters in the local buffer instead of on the screen because at    ;
; this time the current active display is OEM.                          ;
;-----------------------------------------------------------------------;
        public  oem_dynamic_silent_boot_display
oem_dynamic_silent_boot_display:
        ret
;-----------------------------------------------------------------------;
;                       CHANGE_BACK_TO_OEM_DISPLAY                      ;
; this routine returns whether the change back to OEM display mode is   ;
; allowed.                                                              ;
; input :                                                               ;
;       none                                                            ;
; output:                                                               ;
;       CY      change back to OEM display mode allowed                 ;
;       NC      change back to OEM display mode not allowed             ;
; register usage : Do not destroy any register                          ;
;                                                                       ;
;                       IMPLEMENTATION NOTE                             ;
; 1. This routine is called when at least one transition from OEM       ;
; display mode to BIOS display mode has already been happened and a     ;
; request has come again to change the display mode to OEM.             ;
; 2. This routine should return the information whether the change back ;
; to OEM display mode is allowed or not.                                ;
; 3. If change back to OEM display mode is allowed, the display mode    ;
; can be toggled by pressing the hot key even if the display was forced ;
; to change to BIOS display mode for some reason (e.g. some error       ;
; display, etc.).                                                       ;
; 4. If change back to OEM display mode is not allowed, the display mode;
; can not be changed back to OEM (i.e. it will in BIOS display mode) if ;
; the display mode was changed to BIOS display mode for some reason     ;
; (e.g. toggle hot key is pressed, soft error display, etc.).           ;
; 5. Default implementation is                                          ;
;       STC             ; change back to OEM display allowed            ;
;       RET                                                             ;
; 6. If change back to OEM display mode is not allowed, the code of this;
; routine will be                                                       ;
;       CLC             ; change back to OEM display NOT allowed        ;
;       RET                                                             ;
;-----------------------------------------------------------------------;
        public  change_back_to_oem_display
change_back_to_oem_display:
        stc                             ; CY, change back to OEM display allowed
        ret
;-----------------------------------------------------------------------;
;                       CHANGE_DISPLAY_TO_OEM                           ;
; this routine changes the display to OEM display mode and is called    ;
; from INT1C handler inside timer interrupt when display mode needs to  ;
; be changed to OEM mode.                                               ;
; input :                                                               ;
;       none                                                            ;

⌨️ 快捷键说明

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