📄 atbase.asm
字号:
;R80;
;R80;[]==============================================================[]
;R80
;R80 PUBLIC POST_2S
;R80POST_2S PROC NEAR
;R80
;R80
;R18 POST_CODE 2
;R18
;R18 mov eax,-1 ; set all registers to -1
;R18 post_2s1:
;R18 mov ebx,eax
;R18 mov ecx,ebx
;R18 mov edx,ecx
;R18 mov esi,edx
;R18 mov edi,esi
;R18
;R18 mov es,di
;R18 mov ds,si
;R18 mov fs,dx
;R18 mov gs,cx
;R18 mov bp,bx
;R18 mov sp,ax
;R18
;R18 cmp ebx,eax ; check a 32-bit register
;R18 jne short post_2s_fail
;R18
;R18 cmp sp,ax ; check a stack register
;R18 jne short post_2s_fail
;R18
;R18 or eax,eax ; finished?
;R18 jz short post_2s_cont ; yes...
;R18
;R18 inc eax ; set registers to all 0's
;R18 jmp post_2s1 ; do it over...
;R18
;R18 post_2s_fail:
;R18 jmp HaltSystem
;R18
;R18 post_2s_cont:
;R18 mov eax,55555555h
;R18 post_2s_cont1:
;R18 mov ebx,eax
;R18 mov ecx,ebx
;R18 mov edx,ecx
;R18 mov esi,edx
;R18 mov edi,esi
;R18
;R18 mov es,di
;R18 mov ds,si
;R18 mov fs,dx
;R18 mov gs,cx
;R18 mov bp,bx
;R18 mov sp,ax
;R18
;R18 cmp ebx,eax ; check a 32-bit register
;R18 jne short post_2s_fail
;R18
;R18 cmp sp,ax ; check a stack register
;R18 jne short post_2s_fail
;R18
;R18 cmp eax,55555555h
;R18 jne short post_2s_cont2
;R18
;R18 mov eax,0aaaaaaaah
;R18 jmp short post_2s_cont1
;R18
;R18 post_2s_cont2:
;R80;R61 start
;R80 call E000_64K_shadow_RW
;R80 mov si,5000h
;R80 mov di,0e000h
;R80 mov cx,8000h
;R80 call Move_Codes
;R80 call E000_64K_shadow_R
;R80;R61 end
;R80 FAR_JMP <OFFSET Normal_Post_Tests>,0E000H
;R80POST_2S ENDP
PAGE
;R77;R44 start
;R77 public Preint_19
;R77Preint_19:
;R77
;R77ifdef AVIDEO_AT_F000 ;R55
;R77 extrn Disable_E000_ROM_Shadow:near ;R55
;R77 call Disable_E000_ROM_Shadow ;R55
;R77
;R77ifdef SCAN_E000_ISA_ROM ;R75
;R77 mov bx,0e000h ;R75
;R77 mov dx,0e080h ;R75
;R77 call R_MOD_CK ;R75
;R77endif; SCAN_E000_ISA_ROM ;R75
;R77
;R77else; AVIDEO_AT_F000 ;R55
;R77
;R77 call E000_64K_shadow_RW
;R77 mov ax,0e000h
;R77 mov es,ax
;R77 xor di,di
;R77;R50A ifdef PNP_BIOS ;R50
;R77;R50A mov cx,0f000h/2
;R77;R50A else ;PNP_BIOS ;R50
;R77;R50A mov cx,8000h ;R50
;R77;R50A endif ;PNP_BIOS ;R50
;R77;R50A start
;R77;R55 ifdef AVIDEO_AT_F000
;R77;R55 mov cx,8000h
;R77;R55 else ;AVIDEO_AT_F000
;R77 mov cx,0f000h/2
;R77;R55 endif ;AVIDEO_AT_F000
;R77;R50A end
;R77 mov ax,0ffffh
;R77 cld
;R77 rep stosw
;R77 call E000_64K_shadow_R
;R77
;R77endif; AVIDEO_AT_F000 ;R55
;R77;R44 end
;R77 - starts
public Preint_19
Preint_19:
;r119 start
ifdef RPB_ENABLED ; RXX
Post_Func_Call rpb_is_running ; check if interface enabled
jc clear_E000
Post_Func_Call rpb_set_dos_mode
jmp call_int19
clear_E000:
endif ; RPB_ENABLED
;r119 end
CLEAR_E000_METHOD EQU ((POST_ORG_E8 SHL 4) + RELEASE_E000_FOR_PCI)
IF CLEAR_E000_METHOD EQ 00h
ifdef AVIDEO_AT_F000
call Disable_E000_ROM_Shadow ;prg the chipset to
;direct of E000 access to ISA
mov bx, 0e000h
mov dx, 0e080h
call R_MOD_CK
else ;AVIDEO_AT_F000
SHOULD_CLEAR_E000 EQU 1
mov ax, 0E000h
mov cx, 0F000h/2
call Clear_E000_Shadow_For_UMB
endif ;AVIDEO_AT_F000
ENDIF ;CLEAR_E000_METHOD EQ 00h
IF CLEAR_E000_METHOD EQ 10h
SHOULD_CLEAR_E000 EQU 1
ifdef AVIDEO_AT_F000
mov cx, 08000h/2
else ;AVIDEO_AT_F000
mov cx, 07000h/2
endif ;AVIDEO_AT_F000
mov ax, 0E800h
call Clear_E000_Shadow_For_UMB
ENDIF ;CLEAR_E000_METHOD EQ 10h
IF CLEAR_E000_METHOD EQ 11h
SHOULD_CLEAR_E000 EQU 1
;------------------------------------------------------------------------
; In PCIPOST.ASM, we release the E0000-E7FFF shadow RAM for PCI ROM.
;
; If this area is assigned for PCI ROM, the E shadow cannot be disabled
; any more.
;
; Also, we have to clear the shadow RAM according to the shadow RAM used in
; order that the EMM386 can use this area as UMB. In PCIPOST.ASM, it can only
; clear the RAM before E8000h. Therefore, we just have to kill code from
; E8000 onward !
;-------------------------------------------------------------------------
ifdef AVIDEO_AT_F000
mov cx, 08000h/2
mov ax, 0E800h
ifdef PCI_BUS ;R77A
push 0E000h
pop ds
mov si, offset E000_USED_BY_PCI ;check if E000 shadow RAM
mov bl, ds:[si] ; occupied by PCI ROM
or bl, bl ;occupied ?
jnz short Clear_E000_Shadow ;yes, go kill shadow RAM
;from E8000-EFFFF
endif; PCI_BUS ;R77A
call Disable_E000_ROM_Shadow ;else, prg the chipset to
;direct of E000 access to ISA
mov bx, 0e000h
mov dx, 0e080h
call R_MOD_CK
jmp short End_Clear_E800_Shadow
else ;AVIDEO_AT_F000
mov cx, 07000h/2
mov ax, 0E800h
endif ;AVIDEO_AT_F000
Clear_E000_Shadow:
call Clear_E000_Shadow_For_UMB
End_Clear_E800_Shadow:
ENDIF ;CLEAR_E000_METHOD EQ 11h
;r119 start
ifdef RPB_ENABLED ; RXX
call_int19:
endif ; RPB_ENABLED
;r119 end
POST_CODE 0ffh
;R131 - starts
ifdef VSA_VGA
extrn Gx86_VSA_Final_Init:near
call Gx86_VSA_Final_Init
endif ;VSA_VGA
;R131 - ends
;R113A ;R113 start
;R113A ifdef Gx86_PCI_REG
;R113A mov al, 0C3h
;R113A out 22h, al
;R113A mov al, 0E0h
;R113A out 23h, al
;R113A mov al, 0C2h
;R113A out 22h, al
;R113A mov al, 0C2h
;R113A out 23h, al
;R113A
;R113A mov dx, 0cf8h
;R113A mov eax, 800090d0h ; Index to GX5510
;R113A out dx, eax
;R113A
;R113A mov dx, 0cfch
;R113A mov ax, 5000h ; Tell VSA to finish initialization
;R113A out dx, ax
;R113A endif ;Gx86_PCI_REG
;R113A ;R113 end
int 19h
ifdef SHOULD_CLEAR_E000
;-------------------------------------------------
;Input : AX = starting addr. to be cleared
; CX = no. of words to be cleared
;-------------------------------------------------
Clear_E000_Shadow_For_UMB Proc Near
pusha
call E000_64K_shadow_RW
popa
mov es, ax
xor di, di
mov ax, -1
cld
rep stosw
call E000_64K_shadow_R
ret
Clear_E000_Shadow_For_UMB Endp
endif ;SHOULD_CLEAR_E000
;R77 - ends
;R130 - start
ifdef Trend_AntiVirus
public Virus_Used_Shadow
Virus_Used_Shadow label near
dw 0
align 16
db '$CHWY'
Set_Shadow_WrProt proc far
pushad
push es
push 0f000h
pop es
mov ax, word ptr es:[Virus_Used_Shadow]
mov dh, al
@@:
pushad
call Ct_Shadow_R ;Shadow protect write
popad
cmp dh, ah
jz short @f
add dh, 4
jmp short @B
@@:
pop es
popad
retf
Set_Shadow_WrProt endp
endif; Trend_AntiVirus
;R130 - end
;R99 - start
PUBLIC BAD_DISK_MSG
BAD_DISK_MSG:
ifdef Special_Bad_Disk_Message
db Special_Bad_Disk_Message
else ;Special_Bad_Disk_Message
DB 'DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER',CR,LF,00h
endif ;Special_Bad_Disk_Message
;R99 - end
;[]==============================================================[]
;
;INT_19S:
;
; Read O/S boot block in at 0000:7C00h and jumps to it.
;
;
;Saves: NONE
;
;Entry: NONE
;Exit: NONE
;
;Author: Award
;Date: 04/18/90
;
; Name | Date | Description
; ---------------------------------------------------------------
; TIM | 18-Apr-90 | Initial revision
;
;[]==============================================================[]
;R28 start
ifdef CD_ROM
Xlat_CDsec_CHS:
shl eax,2 ;CDsec*4
inc eax
mov edx,eax
shr edx,16
;R123C mov cx,63*16
mov cx,63*255 ;R123C
div cx
xchg ax,dx ;DX = Cylinders
mov cl,63
div cl ;AL = Heads & AH = Sectors
mov cl,ah
and cl,3fh
mov ch,dl
shl dh,6
or cl,dh
mov dh,al
ret
;R43 start
CD_ROM_TEMP_SEG EQU 2000h
CD_ROM_TEMP_OFF EQU 800h
TEMP_OFF EQU 700h
Display_str:
push ax
push cx
mov ah,3
xor bh,bh
int 10h
pop cx
mov ax,1301h
mov bx,7
int 10h
pop ax
ret
Option_Str db 0dh,'Enter a choice : 1',8
Option_Str_len equ $ - offset Option_Str
Floppy_Str db '1.2MB '
db '1.44MB '
db '2.88MB '
;R43 end
C_DRIVE EQU 81h
;R37 start
public Model_Number_Len ;R52
Model_Number_Len equ 40
ifndef NO_CDROM_BOOT_MESSAGE ;R78
CD_Boot_Str0 db 'Boot from ATAPI CD-ROM : '
CD_Boot_Str0_len equ $ - offset CD_Boot_Str0
endif ;NO_CDROM_BOOT_MESSAGE ;R78
CD_Boot_Str2 db ' Failure ...' ;R53
CD_Boot_Str1 db 0dh,0ah
CD_Boot_Str1_len equ $ - offset CD_Boot_Str1
CD_Boot_Str2_len equ $ - offset CD_Boot_Str2 ;R53
Special_CDROM_Drive db 'GCD-R520B' ;R52A
Special_CDROM_Len0 equ $ - offset Special_CDROM_Drive ;R52A
;R37 end
else ;CD_ROM
C_DRIVE EQU 80h
endif ;CD_ROM
A_DRIVE EQU 0
CD_DRIVE EQU 80h
None_Drive EQU 0ffh ;R66
SCSI_Drive EQU 0feh ;R88
LS120_DRIVE EQU 7fh ;R115
Boot_Seq_Drive:
;R66 DB A_DRIVE, C_DRIVE, CD_DRIVE
;R66 DB C_DRIVE, A_DRIVE, CD_DRIVE
;R88 start
ifdef HDD_Boot_Selectable
DB A_DRIVE, C_DRIVE, SCSI_DRIVE
;R93 start
;R93A start
;ifdef support_only_C_boot
; DB C_DRIVE, None_DRIVE, None_DRIVE
;else ;support_only_C_boot
;R93A end
;R93 end
DB C_DRIVE, A_DRIVE, SCSI_DRIVE
;R93A endif ;support_only_C_boot ;R93
else ;HDD_Boot_Selectable
;R88 end
DB A_DRIVE, C_DRIVE, None_DRIVE ;R66
;R93 start
;R93A start
;ifdef support_only_C_boot
; DB C_DRIVE, None_DRIVE, None_DRIVE
;else ;support_only_C_boot
;R93A end
;R93 end
DB C_DRIVE, A_DRIVE, None_DRIVE ;R66
;R93A endif ;support_only_C_boot ;R93
endif ;HDD_Boot_Selectable ;R88
ifdef CD_ROM ;R88
DB C_DRIVE, CD_DRIVE, A_DRIVE
ifdef BOOT_FORM_CD_A_C ;R78
DB CD_DRIVE, A_DRIVE, C_DRIVE ;R78
else ;BOOT_FORM_CD_A_C ;R78
DB CD_DRIVE, C_DRIVE, A_DRIVE
endif ;BOOT_FORM_CD_A_C ;R78
endif ;CD_ROM ;R88
;R28 end
;R88 start
ifdef HDD_Boot_Selectable
DB C_DRIVE, A_DRIVE, SCSI_DRIVE ;D,A
DB C_DRIVE, A_DRIVE, SCSI_DRIVE ;E,A
DB C_DRIVE, A_DRIVE, SCSI_DRIVE ;F,A
DB SCSI_DRIVE, A_DRIVE, C_DRIVE ;SCSI,A,C
DB SCSI_DRIVE, C_DRIVE, A_DRIVE ;SCSI,C,A
endif ;HDD_Boot_Selectable
;R88 end
DB C_DRIVE, None_DRIVE, None_DRIVE ;R93A
;R110 start
ifdef WINCOM_boot_item
DB A_DRIVE, CD_DRIVE, SCSI_DRIVE ;A,CDROM,SCSI
DB C_DRIVE, CD_DRIVE, SCSI_DRIVE ;C,CDROM,SCSI
endif ;WINCOM_boot_item
;R110 end
;R115A start
ifdef LS120_SUPPORT
ATAPI_Boot equ 1
endif ;LS120_SUPPORT
ifdef IOMEGA_ZIP_Support
ATAPI_Boot equ 1
endif ;IOMEGA_ZIP_Support
ifdef ATAPI_Boot
DB LS120_DRIVE, C_DRIVE, None_DRIVE
endif ;ATAPI_Boot
;R115A end
;R115Aifdef LS120_SUPPORT ;R115
;R115A DB LS120_DRIVE, C_DRIVE, None_DRIVE ;R115
;R115Aendif ;LS120_SUPPORT ;R115
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -