Patch: easy CPU-detection for older processors (<586)

Helge Deller (Helge.Deller@ruhr-uni-bochum.de)
Fri, 24 Sep 1999 18:01:25 +0200


--Boundary-=_nWlrBbmQBhCDarzOwKkYHIDdqSCD
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hello List,

I wrote the following small patch to detect (most of) the older processors <=486
in a very compatible way for Linux-Kernel. Most other detection routines uses
something like a keyboard-reset or other tricks to identify the cpu-type and
mask-revision and because of that they often have problems on other
newer machines.

The following patch uses:
- BIOS routines (int 0x15) for all (compatible) PS/2, AMI-BIOS and Compaq-BIOSES
to gather the information. If one BIOS doesn´t support this function, it only
returns a set Carry-Flag. This way this patch is 100% compatible. (Anybody has
info about AWARD-Bioses ?)
- With the info of the mask-revision a identification of 486SL/SX
a.s.o is possible.
- The code will only be compiled, if you select a CPU < 586TSC.
- This patch is very small
- It should cleanly apply to the 2.2.10 and the 2.3.18 kernels.

The patch doesn´t try to identify the CPU-Vendor, only the type of the CPU
(386DX, 486DX/4, 486SL), but of course it could be expanded....

Of course it could be possible, that some CPU´s on other machines will not be
detected, but anyway it is better to see on most computers something like
"486SL" and the mask-revision than "unknown"... :-)
I tested it here on three different machines, and it worked OK.

Does this - or a litlle bit modified - patch has the chance to get into the
2.3.x-Kernel ?

Answers welcome,
Helge Deller.

--Boundary-=_nWlrBbmQBhCDarzOwKkYHIDdqSCD
Content-Type: application/x-gzip;
name="cpu_patch.tgz"
Content-Transfer-Encoding: base64
Content-Description: cpu-detection-patch for 2.2.10 and 2.3.18
Content-Disposition: attachment; filename="cpu_patch.tgz"

H4sIAOSf6zcAA+1X+0/iWBT21/JXHMfElZe0pbxHIwrOssPDWJ3BbCbNpb2VrqVl+kDIjP/7nntb
HBDE3WQnm930kEB7e7/vnvcp+jTUpiTQx3s/TyRRLCsK7AET8cUvQEUqlwHKlYpckSrFogQgSWKp
tAfiT9TpWUI/IB7Anue6wa59bz3/j4phmSbkQ68vA/H0ccEqVsuFEdpa8GkQTo/VV5ZT+Xz+l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jkcK9
G0SdkPUE1hJ4j4gbZaYQEaGbjjZTIw3fsITZHGQ1rRkkIMfzalmL6vdkWzKdnkK1sR3EGs120CHq
ZZqNSJWn1YYgFDL4BRm4pl9D6kezAN+IHAMdyaKPpuPvoAc4pdzQ03Fo5KOcEZVqTsakkcRKriRx
vz41mEcRHlg68LFsGTjaLHOh4Uxh6i6LCi95WaLikNExAb7tiAQqCTeoV+QWphC31TWXkwvD4EWB
wCm+HHHR3NoWFCP0LOc+HnB59v7HOg+PlcCTKcNP0iyDefq5gvgjfvIJ6PnTpc/ZnkhHoHOqhwGb
ofYix2KO+qFils96OZrSaeU7TuQBljxoSTxccWucSYQ5OrTjlGL2rYxdriFLJTyeedDQbDqj9umJ
CN+/c9VOTsR0bDkSBaHnNOK7SMVY7xkmgOuhHUO8+dTutwbXmCk37W4jOmNpP+7o33a7jMN/tPBf
Aj/6OUWj/GXsOvEp+hnb/Cr2HbYCaA0LrWH3HeMQhJFHyUNjHaRsAam7API2wLCgDruFi2GhPdwB
bb6Ads57EJ13sQulbKKUN1EioliwWFwwRHNZhMNoJr9nd2aaIxlglZvzLk2gNjKtchTXOIo7OFpD
uTCYUY/PwNfolDU6ZZdK3dc4SmscpZ1mFeTXWKprLNWdhhWUFZYd+3bFprQe0SvWpsLJuwZv+WM3
tA0gNgKNBYxJ9EqHO/ej8ljhfIorckm2fN3GKteni7Vqwae5522NtXqMX9hOmGZmVINRj8bOgiek
4o5bquE/IOy45Uquyhsu9u64HaxW9VpZ3/Y/9gef++jdVD7ywFrvgPcgLnXe8oQXuLDRxXXUHwTh
R4d5+ku6XNxdd4aM89/+15tIIokkkkgiiSSSSCKJJJJIIokkkkgiiSSSSCL/b/kTc6VxhwAoAAA=

--Boundary-=_nWlrBbmQBhCDarzOwKkYHIDdqSCD--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/