Skip to content

Added simple 286 detection code #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/GLABIOS.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -4985,6 +4985,7 @@ POST_MEMORY DB 'RAM', 0 ; RAM Memory test
ENDIF
DB '000 ', POST_K_UNIT ; and KB or KiB
DB ' OK', 0
POST_286 DB '286', 0
POST_V20 DB 'V20'
IF INIT_V40 EQ 1
DB '/V40' ; could be a V40
Expand Down Expand Up @@ -10259,11 +10260,21 @@ POST_SYS_VIDEO ENDP
POST_COL_1 POST_CPU, POST_CLR_VAL1 ; display 'CPU' left column
; SI now points to '8088'
CPU_CHECK_TYPE_2:
TEST_GFLAG V20 ; ZF = 0 if V20, ZF = 1 if 8088
JZ CPU_CHECK_TYPE_2_DONE ; jump if 8088
MOV AX, 7000H ; Try to set flag bits 12-14 to 1's
PUSH AX ; Push the test value onto the stack
POPF ; Pop it into the flag register
PUSHF ; Push it back onto the stack
POP AX ; Pop it into AX for check
AND AX, 7000H ; if bits 12-14 are cleared then
JNZ CPU_CHECK_TYPE_V20 ; the chip is a 80286
MOV SI, OFFSET POST_286
JMP CPU_CHECK_TYPE_2_DONE
CPU_CHECK_TYPE_V20:
TEST_GFLAG V20 ; ZF = 0 if V20, ZF = 1 if 8088
JZ CPU_CHECK_TYPE_2_DONE ; jump if 8088
MOV SI, OFFSET POST_V20 ; if not, is V20
CPU_CHECK_TYPE_2_DONE:
CALL OUT_SZ ; write CPU type
CALL OUT_SZ ; write CPU type
POST_COL_END ; end first column

;----------------------------------------------------------------------------;
Expand Down