📄 ri61ffd.asm
字号:
; This function sets a device's configuration in CMOS. This function is ;
; called only during runtime. ;
; ;
; Input: AL = Node number ;
; DS:SI = Pointer to the node ;
; Stack available ;
; ;
; Output: CF = Set if error setting node, clear if no error ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
SetNodeStatic proc near private
pusha
call NodeDataToConfigNumber ;AL = Entry # in DeviceConfigTable
jc SetNodeDone ;Br if invalid config was requested
mov ah, al ;AH = 0/1 for Disabled/Enabled
inc ah ;AH = 1/2 for Disabled/Enabled
mov al, Q_IT8661F_FLOPPY_CONTROLLER
call set_cmos_item_checksum
clc
SetNodeDone:
popa
ret
SetNodeStatic endp
;---------------------------------------;
; SetNodeDynamic ;
;---------------------------------------;-------------------------------------;
; This function sets a device's configuration directly into hardware. This ;
; function is called during POST and runtime. ;
; ;
; Input: AL = Node number ;
; DS:SI = Pointer to the node ;
; Stack available ;
; ;
; Output: CF = Set if error setting node, clear if no error ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
SetNodeDynamic proc near private
pusha
call NodeDataToConfigNumber ;AL = Entry # in DeviceConfigTable
jc SetNodeDone ;Br if invalid config was requested
;AL = 0/1 for Disabled/Enabled
call SetHardwareConfig ;Configure device to requested setting
SetNodeDone:
popa
ret
SetNodeDynamic endp
;---------------------------------------;
; RegisterInit ;
;---------------------------------------;-------------------------------------;
; This function initializes the peripheral chip's registers to power on ;
; defaults and prepares the chip for configuration. The device should be ;
; disabled so it is not detected as an off board device. ;
; ;
; Input: Nothing ;
; Stack available ;
; ;
; Output: Nothing ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
RegisterInit proc near private
call IT8661FCommonRegisterInit
pusha
; mov al, Q_IT8661F_FLOPPY_SWAP
; call get_cmos_item ;AL = 0/1 for drive swap disable/enable
; shl al, 2
; mov bh, al
mov bh,0
; mov al, Q_IT8661F_FLOPPY_ACCESS
; call get_cmos_item ;AL = 0/1 for access normal/read-only
; or bh, al
mov bl, 00h ;Logical Device 00 (FDC)
mov ax, 0f0f0h
call IT8661FReadIO
and al, 11111010b
or al, bh
xchg al, ah
call IT8661FWriteIO
popa
ret
RegisterInit endp
;---------------------------------------;
; GetAutoStatus ;
;---------------------------------------;-------------------------------------;
; This function reports if a peripheral chip device is set to auto or manual ;
; in CMOS. ;
; ;
; Input: AL = Node number ;
; Stack available ;
; ;
; Output: AL = 0 If device is set to AUTO mode in CMOS ;
; 1 If device is set to MANUAL mode in CMOS ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
GetAutoStatus proc near private
mov al, Q_IT8661F_FLOPPY_CONTROLLER
call get_cmos_item ;AL = 0/1/2 for AUTO/Disabled/Enabled
jz GetAutoDone ;Br if set to auto
mov al, 1 ;Return manual value
GetAutoDone:
ret
GetAutoStatus endp
;---------------------------------------;
; IdeSetMode ;
;---------------------------------------;-------------------------------------;
; This routine should set the mode/DMA timing of an IDE peripheral device. ;
; ;
; Input: PIO mode / DMA timing ;
; Stack available ;
; ;
; Output: ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
IdeSetMode proc near private
ret
IdeSetMode endp
;---------------------------------------;
; AdjustSetup ;
;---------------------------------------;-------------------------------------;
; This routine programs any peripheral chip specific parameters which need to ;
; be programmed after SETUP e.g. Serial Port FIFO enable, Parallel Port ;
; Direction, etc. Please note that before setup, these parameters should be ;
; set to disabled (normal) setting. This routine is called from ADJUST_SETUP ;
; hook in PC1.ASM file. ;
; ;
; Input: Nothing ;
; Stack available ;
; ;
; Output: Nothing ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
AdjustSetup proc near private
push ax
and cs:IT8661FFloppyController, not PTFLAG_INVISIBLE_NODE
call GetHardwareConfig
or al, al
jnz @F ;Br if enabled
or cs:IT8661FFloppyController, PTFLAG_INVISIBLE_NODE
@@:
pop ax
ret
AdjustSetup endp
;---------------------------------------;
; IsrInstall ;
;---------------------------------------;-------------------------------------;
; This routine may hook any interrupt vector. This hook will be called only ;
; when the BIOS is running from RAM, so any old vector address may be saved ;
; in the code segment for chaining. ;
; ;
; Input: Nothing ;
; Stack available ;
; ;
; Output: Nothing ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
IsrInstall proc near private
ret
IsrInstall endp
;---------------------------------------;
; InitHotKey ;
;---------------------------------------;-------------------------------------;
; This routine can be used to do any peripheral programming after hot key ;
; setup is run and system does not need to reboot. this routine is called ;
; from HOT_KEY_ADJUST_SETUP. ;
; ;
; Input: Pointer to _old_cmos_buffer and _common_cmos_buffer ?.............. ;
; DS = Segment of _old_cmos_buffer and _common_cmos_buffer ;
; Stack available ;
; ;
; Output: Nothing ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
InitHotKey proc near private
ret
InitHotKey endp
;---------------------------------------;
; InitBufferPrfOptimal ;
;---------------------------------------;-------------------------------------;
; This routine can be used to update _common_cmos_buffer in peripheral setup ;
; screen when user loads optimal values. This routine is called from ;
; CMOS_SETUP. ;
; ;
; Input: Pointer to _common_cmos_buffer ?................. ;
; DS = ES = Segment of _common_cmos_buffer ;
; Stack available ;
; ;
; Output: Nothing ;
; ;
; Destroys: Nothing ;
;-----------------------------------------------------------------------------;
InitBufferPrfOptimal proc near private
ret
InitBufferPrfOptimal endp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -