📄 vsa2back.asm
字号:
;**************************************************************************
;*
;* VSA2BACK.ASM
;*
;* Copyright (c) 1999 National Semiconductor Corporation.
;* All Rights Reserved.
;*
;* Function:
;* INT15h callback functions for VSA.
;*
;* $Revision:: 2 $
;*
;**************************************************************************
;.MODEL TINY
.486P
INCLUDE MACROS.INC
INCLUDE DEF.INC
INCLUDE 5530.INC
INCLUDE OPTIONS.INC
INCLUDE BDA.INC
INCLUDE VR.INC
_TEXT SEGMENT PUBLIC use16 'CODE'
; EXTERN geodeI2cDdc:NEAR
EXTERN Geode_Video_Interface:NEAR
EXTERN cy55x0RegWrite8:NEAR
EXTERN cy55x0RegRead8:NEAR
;**************************************************************************
;*
;* Geode Extended INT 15 Functions
;*
;**************************************************************************
geodeInt15Table LABEL WORD
DW geodeMiscConfig ; CH = 0, Read/Write Misc SMI Config Bits
DW geodeVideoConfig ; R/W Video SMI Config Bits
DW geodeAudioConfig ; R/W Audio SMI Config Bits
DW geodePmConfig ; R/W PM SMI Config Bits
DW geodePmSuspendTimeout ; R/W Suspend Timeout
DW geodePmStandbyTimeout ; R/W Standby Timeout
DW geodePmHDTimeout ; R/W Hard Drive Timeout
DW geodePmFDTimeout ; R/W Floppy Timeout
DW geodePmPSTimeout ; R/W Parallel/Serial Timout
DW geodePmAlarmTime ; R/W RTC Alarm Time
DW geodePmWakeupMask ; R/O Wakeup Interrupt Mask
DW geodePmIdleTimeout ; R/W Idle Timeout
DW geodePmS2d ; R/W Save/Restore Flag
DW geodePmBehavior ; Read Standby/Suspend Behavior
DW geodePmExtDflt ; TEMP until DDC added
; DW geodeI2cDdc ; R/W I2C & DDC Pins
DW geodePmExt
geodeInt15TableLength EQU ($ - geodeInt15Table)/2
;**************************************************************************
;*
;* extendedInt15Handler
;*
;* Geode-specific INT 15 interface.
;*
;* Called from xtBiosInt15Interface(). Directs to correponding INT 15
;* handler for the Geode-specific VSA function calls.
;*
;* Entry:
;* AX = BF00
;* BX = 4358 (Geode Identifier)
;* CH = Function Number
;* CL = Read/Write
;*
;* Exit:
;* CARRY Clear = Success
;* CARRY Set = Fail
;*
;* Destroys:
;* None
;*
;**************************************************************************
GeodeInt15Handler PROC NEAR PUBLIC
cmp bx, 'CX' ; Geode Identifier
jne SHORT badPmParam
cmp ax, 0BF00h ; Geode VSA routines?
je processVsaRoutines
cmp ax, 0BF01h ; Geode Video
jne NotGeodeVid
; jmp SHORT badPmParam ; Geode Video goes here for the time being
call Geode_Video_Interface
ret
NotGeodeVid:
mov dx, 1
jmp returnDX
ret
processVsaRoutines::
cmp ch, LOW OFFSET geodeInt15TableLength ; Test if within range
jae SHORT badPmParam
;
; Parse function number and make the call.
;
mov di, cx
shr di, 7 ; Move function number to place with WORD adjustment
and di, 00FEh ; Mask Most Significant Byte for safty
call geodeInt15Table[di] ; Call the corresponding function
ret
badPmParam::
stc ; Signify the failure
ret
GeodeInt15Handler ENDP
;**************************************************************************
;*
;* geodeMiscConfig
;*
;* Read Miscellaneous SMI configurations.
;*
;* Read the miscellaneous configuration bits.
;* The value of CL=1 is invalid.
;*
;* Entry:
;* CH = 0 (Function 0)
;*
;* Exit:
;* DX[0] = Virtual A20 Enable
;* 0 - Disabled
;* 1 - Enabled
;* DX[2:1] = L1 Scratchpad Size
;* 0 - No Scratchpad memory is allocated
;* 1 - 2KB
;* 2 - 3KB
;* 3 - 4KB
;* DX[15:3] = Reserved
;*
;* Destroys:
;*
;**************************************************************************
geodeMiscConfig PROC NEAR
cmp cl, 1 ; Read or Write operation?
ja badPmParam
mov dl, 3 ; Return 3 KB
scratchSizeFound:
xor dh, dh
shl dx, 1
or dx, 1 ; Enable Virtual A20
returnDX::
mov [bp].pushall.pushallDx, dx
mov [bp].pushall.pushallAx, ax
clc
ret
geodeMiscConfig ENDP
;**************************************************************************
;*
;* geodeVideoConfig
;*
;* Read Video SMI configurations
;*
;* Entry:
;* CH = 1 (Function 1)
;*
;* Exit:
;* DX[0] = SoftVGA Function Status
;* 0 - External ISA/PCI video card in use
;* 1 - On-board VSA video in use
;* DX[6:1] = Size of video in 128K units
;*
;* Destroys:
;*
;**************************************************************************
geodeVideoConfig PROC NEAR
mov dx, VID_MEM ; how much video memory
shl dx, 1
push ds ; save ds
push BDA_SEG
pop ds ; set ds to BDA
mov al, ds:[BDA_VIDEO_BOARDS_B]
pop ds ; restore ds
test al, 06h ; see if external video card
jnz noSoftVgaInit ; yes
and al, 1 ; have softvga?
Jz noSoftVgaInit ; no soft either
or dl, 1 ; xpressVideo enabled and no ext
noSoftVgaInit:
jmp returnDX
geodeVideoConfig ENDP
;**************************************************************************
;*
;* geodeAudioConfig
;*
;* Read Audio Configurations.
;*
;* Entry:
;* CH = 2 (Function 2)
;* CL = 0 - Read
;* 1 - Write
;* 2 - Read COMB Data
;*
;* Exit:
;* DX - Audio Configurations
;* DX[1:0] Audio Device Enable
;* 0 - Virtual Audio disabled
;* 3 - SoundBlaster 16 11
;* DX[3:2] Audio I/O Base Address
;* 0 - 220h
;* 1 - 240h
;* 2 - 260h 00
;* 3 - 280h
;* DX[5:4] MPU
;* 0 - Virtual MPU Disabled
;* 1 - 300h
;* 2 - 330h 10
;* 3 - Reserved
;* DX[8:6] Audio IRQ
;* 0 - None
;* 1 - IRQ9
;* 2 - IRQ3 ; This is not supported under SoundBlaster16
;* 3 - IRQ5 100
;* 4 - IRQ7
;* 5 - IRQ10
;* 6, 7 - Reserved
;* DX[10:9] 8-Bit DMA
;* 0 - Disabled
;* 1 - Channel 0 10
;* 2 - Channel 1
;* 3 - Channel 3
;* DX[12:11] 16-Bit DMA
;* 0 - Disabled
;* 1 - Channel 5
;* 2 - Channel 6
;* 3 - Channel 7
;* DX[15:13] MPU IRQ
;* 0 - disabled
;* 1 - IRQ2
;* 2 - IRQ5
;* 3 - IRQ7
;* 4 - IRQ9
;* 5 - IRQ10
;* 6, 7 - Reserved
;*
;* Destroys:
;*
;**************************************************************************
geodeAudioConfig PROC NEAR
mov dx, XPAUDIO ; Enabled, Irq 5, Dma 1, Dma 5
jmp returnDX
updateCMOSchecksum::
clc
ret
geodeAudioConfig ENDP
;**************************************************************************
;*
;* geodePmConfig
;*
;* Read/Write PM SMI config bits.
;*
;* Entry:
;* CH = 3 (Function 3)
;* CL: 0 = Read PM Configuration
;* 1 = Write PM Configuration
;*
;* Exit:
;* DX[2:0] = PM State
;* 0 - Disabled
;* 1 - Customised Setting
;* 2 - low
;* 3 - medium
;* 4 - high
;* DX[3] - external video controller present
;* DX[4] - primary hard drive master installed
;* DX[5] - primary hard drive slave installed
;* DX[6] - secondary hard drive master installed
;* DX[7] - secondary hard drive slave installed
;* DX[8] - COM1 present
;* DX[9] - COM2 present
;* DX[10] - COM3 present
;* DX[11] - COM4 present
;* DX[12] - LPT1 present
;* DX[13] - LPT2 present
;* DX[14] - reserved
;* DX[15] - Save to Disk enabled
;*
;* Destroys:
;*
;**************************************************************************
PM_OFF EQU 0
PM_CUSTOM EQU 1
PM_LOW EQU 2
PM_MEDIUM EQU 3
PM_HIGH EQU 4
PM_MAX EQU PM_HIGH
;PM_MODE EQU 0000000000000111b
EXT_VIDEO EQU 0000000000001000b
PRIMARY_HDD_MASTER EQU 0000000000010000b
PRIMARY_HDD_SLAVE EQU 0000000000100000b
SECONDARY_HDD_MASTER EQU 0000000001000000b
SECONDARY_HDD_SLAVE EQU 0000000010000000b
COM1_PRESENT EQU 0000000100000000b
COM2_PRESENT EQU 0000001000000000b
COM3_PRESENT EQU 0000010000000000b
COM4_PRESENT EQU 0000100000000000b
LPT1_PRESENT EQU 0001000000000000b
LPT2_PRESENT EQU 0010000000000000b
SAVE_TO_DISK EQU 1000000000000000b
geodePmConfig PROC NEAR
cmp cl, 1
ja badPmParam
mov dx, 0000000000000b ; PM Disabled for now
pmConfigExit:
jmp returnDX
geodePmConfig ENDP
;**************************************************************************
;*
;* geodePmSuspendTimeout
;*
;* Read/Write PM supend timeout
;*
;* Entry:
;* CH = 4 (Function 4)
;* CL = 0 for Read
;* 1 for Write
;*
;* Exit:
;* DX = Timeout in minutes, 0 for infinite timeout
;*
;* Destroys:
;*
;**************************************************************************
geodePmSuspendTimeout PROC NEAR
cmp cl, 1
ja badPmParam
mov dx, 0 ; none
jmp returnDX
geodePmSuspendTimeout ENDP
;**************************************************************************
;*
;* geodePmStandbyTimeout
;*
;* Read/Write PM Standby timeout
;*
;* Entry:
;* CH = 5 (Function 5)
;*
;* Exit:
;* DX - Timeout 1 second time base
;* 0 = Infinite Timeout
;*
;* Destroys:
;*
;**************************************************************************
geodePmStandbyTimeout PROC NEAR
cmp cl, 1
ja badPmParam
mov dx, 0 ; none
jmp returnDX
geodePmStandbyTimeout ENDP
;**************************************************************************
;*
;* geodePmHDTimeout
;*
;* Read/Write PM hard drive timeout
;*
;* Entry:
;* CH = 6 (Function 6)
;*
;* Exit:
;* DX = Timeout in 1 second time base
;* 0 = infinite timeout
;*
;* Destroys:
;*
;**************************************************************************
geodePmHDTimeout PROC NEAR
xor dx, dx
jmp returnDX
geodePmHDTimeout ENDP
;**************************************************************************
;*
;* geodePmFDTimeout
;*
;* Read/Write PM floppy drive timeout
;*
;* Entry:
;* CH = 7 (Function 7)
;*
;* Exit:
;* DX = Timeout in 1 Second Time Base, 0 for Infinite Timeout
;*
;* Destroys:
;*
;**************************************************************************
geodePmFDTimeout PROC NEAR
xor dx, dx
jmp returnDX
geodePmFDTimeout ENDP
;**************************************************************************
;*
;* geodePmPSTimeout
;*
;* Read/Write PM parallel/serial port timeout
;*
;* Entry:
;* CH = 8 (Function 8)
;*
;* Exit:
;* DX = Timeout in 1 Second Time Base, 0 for Infinite Timeout
;*
;* Destroys:
;
;**************************************************************************
geodePmPSTimeout PROC NEAR
xor dx,dx
jmp returnDX
geodePmPSTimeout ENDP
;**************************************************************************
;*
;* geodePmAlarmTime
;*
;* Read/Write PM RTC Alarm Time
;*
;* Entry:
;* CH = 9 (Function 9)
;*
;* Exit:
;* DX = Timeout in 1 Second Time Base, 0 for Infinite Timeout
;*
;* Destroys:
;*
;**************************************************************************
geodePmAlarmTime PROC NEAR
xor dx, dx
jmp returnDX
geodePmAlarmTime ENDP
;**************************************************************************
;*
;* geodePmWakeupMask
;*
;* Read/Write Get Wakeup Interrupt Mask
;*
;* Entry:
;* CH = 0A (Function A)
;* DX - Mask of events to report:
;* If PM is disabled, then AND input mask with Setup
;* settings. Else, use mask directly.
;* Bit Event
;* --- -------------
;* 0 Keyboard
;* 1 Mouse
;* 2 Modem Ring
;* 3 COM (any)
;* 4 Serial Mouse
;* 5 LPT
;* 6 RTC
;* 7 Network
;* others reserved
;*
;* Exit:
;* DX - Mask of interrupts that should cause system to wake up
;* Carry Flag - set if error
;*
;* Destroys:
;*
;**************************************************************************
BUFFER_SIZE EQU 100h
WAKE_KYBD EQU 000000001b
WAKE_MOUSE EQU 000000010b
WAKE_MODEM EQU 000000100b
WAKE_COM EQU 000001000b
WAKE_SMOUSE EQU 000010000b
WAKE_LPT EQU 000100000b
WAKE_RTC EQU 001000000b
WAKE_NETWRK EQU 010000000b
geodePmWakeupMask PROC NEAR
mov dx, 0000010b ; KBD?
jmp returnDX
geodePmWakeupMask ENDP
;**************************************************************************
;*
;* geodePmIdleTimeout
;*
;* Read/Write Idle Timeout
;*
;* Entry:
;* CH = 0B (Function B)
;* CL = 0 for Read
;* 1 for Write
;*
;* Exit:
;* DX - Timeout in milliseconds
;* 0 = Infinite timeout
;*
;* Destroys
;*
;**************************************************************************
geodePmIdleTimeout PROC NEAR
xor dx, dx
jmp returnDX
geodePmIdleTimeout ENDP
;**************************************************************************
;*
;* geodePmS2d
;*
;* R/W PM Save/Restore Flag
;*
;* Entry:
;* CH = 0C (Fuction C)
;* CL = 0 to Query flag
;* 1 to Set flag
;* 2 to Clear flag
;* DL = 2 LSBs contain CRT/LCD flag
;* bit 0 = LCD
;* bit 1 = CRT
;*
;* Exit:
;*
;* Destroys:
;*
;**************************************************************************
geodePmS2d PROC NEAR
xor dx, dx
jmp returnDX
geodePmS2d ENDP
;**************************************************************************
;*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -