• Please review our updated Terms and Rules here

CPU/FPU Detection Program / Routines

Thanks. Results are re-producable with fake86. There are two issues, first that Int 21h function 3306h isn't defined prior to DOS 5 (use function ah=30h), and second Int 2Fh function 160Ah hangs DOS 2.1.

Hope that helps!
 
Last edited:
Thanks for the hints. I solved the bug, by first checking whether function 3306H is supported, if not it must be DOS <5 (and the Windows Existence Checking will not be done).

Works with pce using DOS 2.1 (8088, MDA, 256KB).
@pearce_jj: Would you please retry it on a real XT. Which version of DOS do you running on your XT ?

Added Features:
- Prints the Computer Class (e.g. IBM PC, PC/AT, PC/XT, PS/2)
- Prints the Computer Model (if it exists in my database)
- Prints the BIOS Revision Date
- Prints the Model, SubModel, Revision ID Bytes
 
Ok so that's definitely fixed that issue. I ran some tests - here's the results:

On PC/XT with MHS-D8088,8087, MDA, 256K, DOS2.1. dcpu lists PC/XT, V20, FPU, 256K, Hercules.

On Portable (5155), Intel '83 dated P8088, no FPU, 512K, DOS2.1. dcpu lists PC/XT, V20, no FPU, 512K, CGA.

On PC with Intel 8088, no FPU, MDA, 256K, DOS2.1. dcpu lists PC, 8088, no FPU, 256K, Hercules.

On Tandy 1400FD with V20, no FPU, CGA, 768K, DOS3.3. dcpu lists Unknown PC/XT, V20, no FPU, 640K, CGA.


So it seems the later Intel 8088 is being picked up as a V20 and the IBM MDA is being detected as Hercules. The MHS-8088 I will try to find out what it actually is!

Hope that helps!
 
For the MDA Detection: Are really sure that no Hercules card is installed? This detection rans 100% successful within DOSBox, my PS/2 M30/286, pce and both 486ers.

For the 8088/V20 Thing: I implemented another method for detecting V30/V20 CPUs.

For the Tandy 1400FD: dcpu only prints the amount of Conventional Memory, not the total amount

Sorry for the troubles, but would you please try this new version ?
 
Hi, I quickly tested it on V20 and MHS-8088, which were detected as V20 and 8088 respectively, so that looks better!

The cards in these systems I'm sure are IBM MDAs, but I will post up some photos of them once I get chance to pull one out.

Cheers!
 
you don't need to make photos, just check what video card you have !
 
Hi MMoeller, I haven't forgotton this, but haven't got access to my kit for a few days. Will post back when I have tested the updated version though.
 
hmm, ok. Tried it with PCem with all possible video cards: all get detected correctly (MDA, CGA, Hercules+).
The thing is, that according to pearce_jj, MDA doesn't get detected successful on a real IBM PC.
Maybe later revisions of the MDA also (like the Hercules) set the retrace flag correctly, so this newer revisions get detected as Hercules.

Hmm, I need a modified detection algorithm for MDA/Hercules/HGC+/HGC InColor video cards.

I uploaded a modified version, which prints the value stored in the 6845 Status Register.
@pearce_jj: I need this value, please post it here
 
I notice in the following MDA/Herc detection code, that the author is looking for a change in the bit 7 state. I guess that is because in an MDA card, bit 7 is undefined, and thus the author is allowing for the possibility that in an MDA card (either IBM or non-IBM), bit 7 may be fixed at either 0 or 1.

mda_herc_detection.jpg
 
I don't know if it still builds as a .COM file, but if it does you could add detection for 8080 and Z80 processors when running under CP/M:
Code:
 org 0100h
 db 0EBh, 40h, 0EBh  ; x86 => JMP 0142h 
                     ; x80 => XCHG ! MOV B,B ! XCHG
 db 97h              ; SUB A
 db 11h, 13h, 01h    ; LXI D,L0113
 db 0EAh, 0Dh, 01h   ; JPE 010Dh
 db 11h, 20h, 01h    ; LXI D, L0122
 db 0Eh, 09h         ; MVI C,9
 db 0CDh, 05h, 00h   ; CALL 5
 db 0C7h             ; RST 0
L0113: 
 db '8080 or 8085', 13, 10, '$'
L0122:
 db 'Z80',13,10,'$'
;
 org 0142h
;x86 code continues...
 
@JohnElliot: Thanks for the contribution, I have integrated it ! I don't know how to test it, would you plz do that or describe how to do it !?!?!
@modem7: Yes I implemented it the same way as shown in your picture 1 !

Regards,
Martin
 
Yep, looks like a good job. I guess it really needs someone with a Hercules to give it a whirl too. Tandy 1000SL/TL had them onboard I seem to recall.
 
Wow, dcpu is now a multi-architecture binary (it runs on both CP/M (x80) and DOS (x86)). I will maybe rewrite it as mixture of Turbo Pascal and Turbo Assembler, to make it more elegant.
 
this is interesting. it detects a 386 inside fake86 now, but a few weeks ago i tried an older version and it detected an 8086. probably a bug in my emulator?
 
i just wrote a disney sound source detection routine if you want to include it. it should work but i dont have a sound source anymore. anybody who has one care to test this? :)

Code:
data    equ 378h
status  equ 379h
command equ 37Ah

org 100h

;turn on sound source
mov dx, command
mov al, 4h
out dx, al

;try to overflow the FIFO
mov cx, 32
sendloop:
  ;send some dummy bytes
  mov dx, data
  mov al, 80h
  out dx, al
  
  mov dx, command
  mov al, 0Ch
  out dx, al
  
  nop
  nop
  nop
  nop
  
  mov al, 4h
  out dx, al
  
  loop sendloop

mov dx, status
in al, dx
test al, 40h
jnz found

;code reaches this if there is no sound source
mov si, offset strnotfound
call print
mov dx, command
mov al, 0Ch
out dx, al
ret

;code reaches this is sound source is found
found:
  mov si, offset strfound
  call print
  mov dx, command
  mov al, 0Ch
  out dx, al
  ret

print:
  pushf
  cld
  printnext:
    lodsb
    cmp al, 0
    jz printdone
    mov ah, 0Eh
    int 10h
    jmp print
  printdone:
    popf
    ret

strfound    db 'Sound Source found', 13, 10, 0
strnotfound db 'Sound Source not found', 13, 10, 0
 
Back
Top