📄 ri61flp.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
; Set parallel port address
mov ah, al ;AH = 0/1/2/3 for Disabled/378/278/3BC
inc ah ;AH = 1/2/3/4 for Disabled/378/278/3BC
mov al, Q_IT8661F_LPT_PORT
call set_cmos_item_checksum
; Set parallel port IRQ
xor ah, ah ;Assume IRQ5
test (DevNodeDataBlock ptr [si]).LptIrq.ides_irq_mask, 0020h
jnz SetDevIrqToCmos
inc ah ;IRQ7
SetDevIrqToCmos: ;AH = 0/1 for IRQ5/IRQ7
mov al, Q_IT8661F_LPT_IRQ
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/2/3 for Disabled/378/278/3BC
call SetHardwareConfig ;Configure device to requested setting
call SetHardwareIrq ;Configure device IRQ
clc
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
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_LPT_PORT
call get_cmos_item ;AL = 0/1/2/3/4 for
; AUTO/Disabled/378/278/3BC
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:IT8661FParallelPort, not PTFLAG_INVISIBLE_NODE
call GetHardwareConfig
or al, al
jnz @F ;Br if enabled
or cs:IT8661FParallelPort, 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
;---------------------------------------;
; InitBufferPrfFailSafe ;
;---------------------------------------;-------------------------------------;
; This routine can be used to update _common_cmos_buffer in peripheral setup ;
; screen when user loads fail safe 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 ;
;-----------------------------------------------------------------------------;
InitBufferPrfFailSafe proc near private
ret
InitBufferPrfFailSafe endp
;---------------------------------------;
; GetHardwareConfig ;
;---------------------------------------;-------------------------------------;
; This routine determines the current configuration of the peripheral device ;
; by reading directly from its registers. The value returned is an entry ;
; number in the DeviceConfigTable. ;
; ;
; Value Read Value Read Entry # in Config ;
; From CR30 From CR60/CR61 DeviceConfigTable Setting ;
; ------------ ------------ ----------------- -------- ;
; 0 XX / XX 0 Disabled ;
; 1 03 / 78 1 378 ;
; 1 02 / 78 2 278 ;
; 1 03 / BC 3 3BC ;
; ;
; Input: Nothing ;
; Stack available ;
; ;
; Output: AL = Entry number in DeviceConfigTable that represents the current ;
; configuration of the peripheral device. ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -