[syslinux] isolinux source, detecting 8086 cpu
Michael K Ter Louw
mterlouw at gmx.net
Wed Feb 27 18:44:33 PST 2002
Hi, I was looking through isolinux and noticed you had trouble detecting
8086 cpu's. I have some experience with this so I thought you might
like some different info. The behavior of the "push sp" instruction
changed after the 8086 to pushing sp before updating it. I've included
a snippet of one of my bootstraps in case you want to use it (or just
want to understand better). I also use a different method for detecting
the 386. Basically I just attempt a 32-bit instruction and hook the
invalid opcode exception. Hope this helps. :)
Mike
push sp
; save sp
pop ax
; ax = saved sp
cmp ax, sp
; 8086 modifies sp before pushing
je .not_8086
; processor is not an 8086
;
.invalid_cpu: ;
mov si, .err_cpu ; si
points to error message
jmp .error_handler ;
display message and reboot
;
.not_8086:
;
mov W [6 << 2], .invalid_cpu ; store offset of
invalid opcode handler
mov [(6 << 2) + 2], cs ; store
segment of handler
xor eax, eax
; test a 32-bit instruction
More information about the Syslinux
mailing list