FDOS/kernel

Startup CPU check does not accept NEC V20/V30 as 186-class processors

Closed this issue · 5 comments

The check is in

kernel/kernel/cpu.asm

Lines 51 to 56 in db71b1a

mov ax,1 ; determine if 8086 or 186
mov cl,64 ; try to shift further than size of ax
shr ax,cl
or ax,ax
jz is086 ; 186 ignores the upper bits of cl
mov bx, 1 ; 186: above 808x, below 286

A user reported in https://www.bttr-software.de/forum/forum_entry.php?id=21210 that it doesn't work on a NEC V20.

My implementation of a CPU check is either in https://hg.pushbx.org/ecm/ldebug/file/7f3440d5824d/source/init.asm#l3071 or in https://hg.pushbx.org/ecm/cpulevel/file/43b74982baeb/cpulevel.asm#l53

thank you for adding the bug report and link to code to fix. hopefully I will have time this evening to update the check.

I just tested my patched cpulevel utility (link in initial report) on the HP 95LX and its NEC V20/V30 detection does work as expected.

I tested the lDebug init CPU detection much earlier when I adapted the debugger to run on the HP 95LX. It also detects the machine (M? command) as an 186.

draft pull request #126 with fix, need to test and verify I did test correctly.

should now treat NEC V20/V30 as 186 and work on 186 compiled kernels