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

📄 oempost.asm

📁 <BIOS研发技术剖析>书的源代码,包括完整的BIOS汇编语言源程序.
💻 ASM
📖 第 1 页 / 共 5 页
字号:
	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                                                            ;
;       EOI has not yet been issued to Interrupt Controller             ;
; output:                                                               ;
;       NC      display change successful                               ;
;       CY      display change not successful                           ;
; register usage : Do not destroy any register                          ;
;                                                                       ;
;                       IMPLEMENTATION NOTE                             ;
; 1. This routine will be called whenever display needs to changed to   ;
; OEM display mode.                                                     ;
; 2. Uncompress the OEM logo module, save the segment where the OEM logo;
; module is uncompressed, give control to OEM logo module to display the;
; OEM logo.                                                             ;
; 3. The OEM Logo Module ID is 0Eh.                                     ;
; 5. The OEM Logo Module can be incorporated into the system ROM image  ;
; by AMIMM utility.                                                     ;
; 6. If you need to have separate module for OEM Logo Code and Data,    ;
; use Module ID 0Eh for Code and any user defined module ID for Data.   ;
; 7. The necessary data areas in DIMDATASEG is                          ;
;       OemSegment      DW      ; contain the segment where the         ;
;                               ; OEM logo module is uncompressed       ;
;                                                                       ;
;                       IMPLEMENTATION ALGORITHM                        ;
; Step-0: Check whether OEM logo module is already uncompressed in      ;
; OemSegment. If already uncompressed, go to Setp-4.                    ;
; Step-1: Uncompress the OEM logo module.                               ;
; Step-2: If uncompress is not successful, Set Carry flag (CY), Exit.   ;
; Step-3: Save the segment where OEM logo module is uncompressed in     ;
;         OemSegment data area in DIMDATASEG.                           ;
; Step-4: Give control to OEM logo module.                              ;
; Step-5: Reset carry flag (NC), Exit.                                  ;
;                                                                       ;
;                       OEM LOGO MODULE FORMAT                          ;
; Note that this format is a suggesstion only (the code given here is   ;
; written based on this format). Any format is allowed in which case    ;
; the code in this routine needs to be modified accordingly.            ;
;                                                                       ;
; Offset-0: Word having the signature 55AA.                             ;
; Offset-2: Byte having the module size in 512Bytes unit.               ;
; Offset-3: The entry point of OEM logo display module.                 ;
;                                                                       ;
;-----------------------------------------------------------------------;
        extrn   uncom_segment:word
        extrn   scratch_segment:word
        extrn   uncompress_general_module:near
        public  change_display_to_oem
change_display_to_oem:
        push    es
        push    ds
        pushad
        push    DIMDATASEG
        pop     ds
        mov     ds,ds:word ptr OemSegment
        cmp     ds:word ptr [0000h],0aa55h
        jz      short cdto_01           ; OEM module already uncompressed
;---------------------------------------;
; uncompress OEM code
        cli
        mov     ax,cgroup:uncom_segment
        mov     ds:word ptr OemSegment,ax
        mov     es,ax
        mov     ds,cgroup:scratch_segment
        mov     bl,graphic_logo_code_id
        call    uncompress_general_module; uncompress OEM module
        stc                             ; display change not successful
        jnz     short cdto_00           ; no OEM module present
;---------------------------------------;
;; PaiLin {
;; for 256 color Logo
	mov	es,cgroup:uncom_segment
	mov	ds,cgroup:scratch_segment
	mov	bl,33h;graphic_logo_data_id
	call	uncompress_general_module; uncompress OEM module
	stc				; display change not successful
	jnz	short cdto_00		; no OEM module present
;	push	ds
;        push    DIMDATASEG
;        pop     ds
;        mov     ax,cgroup:uncom_segment
;	shr	cx,4
;	add	ax,cx
;        mov     ds:word ptr OemSegment,ax
;        mov     es,ax
;        mov     ds,cgroup:scratch_segment
;        mov     bl,graphic_logo_data_id 
;        call    uncompress_general_module; uncompress OEM module
;        stc                             ; display change not successful
;	pop	ds
;        jnz     short cdto_00           ; no OEM module present
;; } PaiLin
;---------------------------------------;
cdto_01:
        sti
        push    cs
        push    offset cgroup:cdto_ret
        push    ds
        push    0003h                   ; OEM routine offset is at 0003h
        retf
cdto_ret:
        clc                             ; display change successful
cdto_00:
        sti
        popad
        pop     ds
        pop     es
        ret
;-----------------------------------------------------------------------;
ENDIF
;-----------------------------------------------------------------------;
;			GET_ONBOARD_DEVICE_INFO				;
; this routine returns the information of concerned onboard device.	;
; input :								;
;	DS:SI	ptr to concerned onboard device data structure		;
;		(See Note-1 for device type details)			;
; output:								;
;	CY	error (e.g. routine is not implemented)			;
;		(in this case, device will be assumed to be disabled)	;
;	NC	successful						;
;		AL	00, onboard device is disabled			;
;			01, onboard device is enabled			;
;  register usage : do not destroy any register except AL		;
; NOTE:									;
; 1. The input DS:SI points to the start of the concerned onboard device;
; device information structure. The bit6-0 of the byte at offset-4 of	;
; the structure contains the device type information as follows:	;
;	device type	device						;
;		00	Undefined					;
;		01	Other						;
;		02	Unknown						;
;		03	Video						;
;		04	SCSI Controller					;
;		05	Ethernet					;
;		06	Token Ring					;
;		07	Sound						;
;		08-7F	Undefined					;
; 2. If the device type is Undefined, return with AL = 00, disabled	;
;-----------------------------------------------------------------------;
	public	get_onboard_device_info
get_onboard_device_info:
	stc
	ret
;-----------------------------------------------------------------------;
;---------

⌨️ 快捷键说明

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