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

📄 nruntime.asm

📁 本源码为BIOS研发技术剖析光盘原代码,是SIS530BIOS完整原代码.
💻 ASM
📖 第 1 页 / 共 5 页
字号:
; special_int_15:                                                       ;
;       cmp     ah,24h                  ; func# 24h ?                   ;
;       jnz     si15_00                 ; no..                          ;
;       cmp     al,03h                  ; subfunc# 03h ?                ;
;       jnz     si15_00                 ; no..                          ;
;       POP     BX                      ; ===VERY VERY IMPORTANT===     ;
;                                       ; discard return address        ;
;       mov     bx,02h                  ; bit 1 = 1..GateA20 thru' bit-1;
;                                       ; of I/O port 92H               ;
;       sti                             ; enable interrupt              ;
;       xor     ah,ah                   ; AH = 00..successful           ;
;                                       ; NC..successful                ;
; x??   proc    far                                                     ;
;       ret     0002                                                    ;
; x??   endp                                                            ;
;                                                                       ;
; si15_00:                                                              ;
;       ret                                                             ;
;-----------------------------------------------------------------------;
;                               SPECIAL_INT_15                          ;
;-----------------------------------------------------------------------;
;  input :                                                              ;
;       none                                                            ;
;       stack   available                                               ;
;  register usage : do not destroy any register                         ;
;-----------------------------------------------------------------------;
        public  dummy_ret
        extrn   bios_scratch:byte
        extrn   oem_special_int_15:near
        extern  check_bu(dummy_ret):near
        extern  VumaInt15EntryPoint(dummy_ret):near
        extrn   apm_real_mode_entry:near
        public  special_int_15          ; special int 15 func if any
special_int_15:
;---------------------------------------;
if      MKF_ACPI_SUPPORT
        cmp     ah,88h                  ; fn# 88h ?
        jz      func_88
        cmp     ax,0e801h               ; fn# E801h ?
        jnz     short osi15_00          ; no
func_88:
        test    cgroup:bios_scratch,acpi_aware_os_bit; Bit-5 = 1 -> ACPI OS
        jz      short osi15_00          ; not ACPI OS

        extrn   acpi_int15_fn88:near
        extrn   acpi_int15_fne801:near

        cmp     ax,0e801h
        jnz     acpi_int15_fn88         ; ACPI INT15 Fn 88h in RUNACPI.ASM
        jmp     acpi_int15_fne801       ; ACPI INT15 Fn E801h in RUNACPI.ASM

osi15_00:
endif
;---------------------------------------;
        call    oem_special_int_15      ; OEM specific INT15 function
        cmp     ah,053h                 ; APM function ?
        jne     si15_00                 ; no
        jmp     apm_real_mode_entry     ; execute APM function
si15_00:
        cmp     ax,0F401h               ; VUMA function ?
        jne     si15_01                 ; no
        jmp     VumaInt15EntryPoint     ; execute VUMA function
si15_01:
        jmp     check_bu                ; check for BIOS upgrade func
;-----------------------------------------------------------------------;
;                               FD_SPEED_LOW                            ;
;-----------------------------------------------------------------------;
; this routine is called to support low speed floppy verify if reqd.    ;
; input :                                                               ;
;       ds      0040h                                                   ;
;       stack   available                                               ;
; output :                                                              ;
;       (ZF)    0, if you do not need low speed during verify           ;
;               else set to low speed and CALL COMOUT, then make (ZF) = 1
;                                                                       ;
; ==============================NOTE====================================;
; MAKE SURE ONLY (zf) IS CHANGED IN OUTPUT. THE carry FLAG CAN NOT BE   ;
; CHANGED.                                                              ;
; YOU ARE ADVISED TO USE THE FOLLOWING CODE ALWAYS.                     ;
; ==============================NOTE====================================;
;                                                                       ;
; register usage : do not destroy any register                          ;
;-----------------------------------------------------------------------;
        public  dummy_ret
        public  fd_speed_low            ; low speed floppy format, if reqd.
fd_speed_low:
;  for no speed change..
        or      sp,sp                   ; ZF = 0
dummy_ret:
        ret

;; need to go to low speed..
;;      00. save necessary registers to be used in steps 01, 02.
;;      01. save current speed status.
;;      02. goto low speed.
;;      03. restore registers which are saved in step 00.

;;      04. execute COMOUT rotuine. COMOUT routine has output in carry flag.
;;          DO NOT dsetroy carry flag after this.
;;              extrn   comout: near
;;              call    comout          ; send command /parameters to FP controller

;;      05. save necessary registers registers (including flag) to be used
;;          in steps 06.
;;      06. restore current speed status.
;;      07. restore registers including flags which are saved in step 05.

;;      08. exit with (ZF) set to 1. DO NOT CHANGE ANY OTHER FLAG.
;;              PUSH    AX
;;              MOV     AL,0FFH
;;              INC     AL              ; (ZF) = 1
;;                                      ; NOTE THAT inc al AFFECTS zf ONLY
;;              POP     AX
;;              RET
;-----------------------------------------------------------------------;
;               NMI_PARITY_CHECK                ; Moved to OEMRUN.ASM
;-----------------------------------------------------------------------;
;               DISPLAY_PARITY_ADDRESS          ; Moved to OEMRUN.ASM
;-----------------------------------------------------------------------;
;       PREPARE_CHIPSET_FOR_FLASH_PROGRAMMING   ; Moved to RUNTIME.ASM
;-----------------------------------------------------------------------;
;                               PRP_DELAY                               ;
;-----------------------------------------------------------------------;
; this routine is called to provide sufficient io recovery time between ;
; consecutive io operation in serial/printer port.                      ;
; NOTE: this routine is called from INT-14 and INT-17 ISR by a CALL     ;
; instruction and must return by RET. This CALL and RET instruction     ;
; themselves consume 8 clocks approx (actual clocks depends on CPU type).
; if 8 clocks is enough, NO extra delay is needed.                      ;
; input :                                                               ;
;       stack   available                                               ;
; output :                                                              ;
;       none                                                            ;
; register usage : do not destroy any register                          ;
; NOTE: in normal cases, no extra delay is required.                    ;
;-----------------------------------------------------------------------;
        public  prp_delay
prp_delay       proc    near
        jcxz    short $+2
        jcxz    short $+2
        jcxz    short $+2
        jcxz    short $+2
        jcxz    short $+2
        jcxz    short $+2
        ret
prp_delay       endp
;-----------------------------------------------------------------------;
;                               WEITEK_CHECK                            ;
;-----------------------------------------------------------------------;
; called from INT-11 ISR. set bit-24 of EAX if weitek is present i.e.   ;
; EAX = 0100 0000                                                       ;
; input :                                                               ;
;       none                                                            ;
;       stack   available                                               ;
; register usage : do not destroy any register except EAX               ;
;-----------------------------------------------------------------------;
        public  weitek_check            ; weitek check if any.
weitek_check:
        xor     eax,eax                 ; weitek not present
        ret

;; if weitek is present remove two line of code above and add the following
;; code.
;;      mov     eax,01000000h           ; bit-24 = 0/1  weitek absent/present
;;      ret
;-----------------------------------------------------------------------;
;                               SPECIAL_INT_1A                          ;
;-----------------------------------------------------------------------;
; this routine is called from INT-1A ISR to support any special int-1A  ;
; function if any. if you do not have any special func, simply return   ;
; control to INT-1A ISR. otherwise do the special function and return   ;
; control to caller of INT-1A by IRET or RET 2.                         ;
; here is how INT-16 code will look like.                               ;
;int_1a proc    far                                                     ;
;       ...                                                             ;
;       jmp     special_int_1a                                          ;
;special_int_1a_end:                                                    ;
;       ...                                                             ;
;       ...                                                             ;
;int_1a endp                                                            ;
;-----------------------------------------------------------------------;
;  input :                                                              ;
;       ah      function#                                               ;
;       stack   available                                               ;
;  register usage : do not destroy any register                         ;
;-----------------------------------------------------------------------;
        public  special_int_1a
        extrn   special_int_1a_end:near
special_int_1a:
        jmp     special_int_1a_end
;-----------------------------------------------------------------------;
;                       CHANGE_SPEED            ; Moved to OEMRUN.ASM
;-----------------------------------------------------------------------;
;                       ENABLE_L1_CACHE                                 ;
;-----------------------------------------------------------------------;
;  this routine enables internal cache (WB or WT) mode by cpu           ;
;  routine and chipset programming.                                     ;
;  input :                                                              ;
;       none                                                            ;
;       stack   available                                               ;
;  output:                                                              ;
;       none                                                            ;
;  register usage : do not destroy any register                         ;
;-----------------------------------------------------------------------;
        public  enable_l1_cache
enable_l1_cache:
        push    ax
        mov     al,q_internal_cache
        call    check_cmos_data
        cmp     al,1
        pop     ax
        jbe     el1c_1
        call    enable_l1_cache_wb
        ret
el1c_1:
        call    enable_l1_cache_wt
        ret
;-----------------------------------------------------------------------;
;                       ENABLE_L2_CACHE                                 ;
;-----------------------------------------------------------------------;
;  this routine enables external cache (WB or WT) mode by chipset       ;
;  programming.                                                         ;
;  input :                                                              ;
;       none                                                            ;
;       stack   available                                               ;
;  output:                                                              ;
;       none                                                            ;
;  register usage : do not destroy any register                         ;
;-----------------------------------------------------------------------;
        public  enable_l2_cache
enable_l2_cache:
        push    ax
        mov     al,033h
        call    cmos_data_in_x
        test    al,1
        jz      el2c_2
        mov     al,q_internal_cache
        call    check_cmos_data         ; 0/1/2, disabled/wt/wb
        jz      el2c_2
        mov     al,q_external_cache
        call    check_cmos_data         ; 0/1/2, disabled/wt/wb
        jz      el2c_2                  ; disbaled
        cmp     al,1
        jz      el2c_1                  ; wt
        call    enable_l2_cache_wb      ; wb
        pop     ax

⌨️ 快捷键说明

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