Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.1 KiB

4 years ago
  1. ;++
  2. ;
  3. ;Module Name:
  4. ;
  5. ; olidtect.c
  6. ;
  7. ;Abstract:
  8. ;
  9. ; This modules implements the machine type detection.
  10. ;
  11. ;Author:
  12. ;
  13. ;
  14. ;
  15. ;Environment:
  16. ;
  17. ; Kernel mode only.
  18. ;
  19. ;Revision History:
  20. ;
  21. ;--
  22. .386p
  23. include callconv.inc
  24. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  25. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  26. ;++
  27. ; BOOLEAN
  28. ; DetectOlivettiMp (
  29. ; OUT PBOOLEAN IsConfiguredMp
  30. ; );
  31. ;
  32. ; Routine Description:
  33. ; Determines the type of system (specifically for eisa machines), by reading
  34. ; the system board ID.
  35. ;
  36. ; Arguments:
  37. ; IsConfiguredMp - If LSX5030/40/40E is detected, then this value is
  38. ; set to TRUE if more than one CPU is found, else FALSE.
  39. ; The effect is that on returning FALSE, the standard HAL
  40. ; is used, whilst on returning TRUE, the LSX5030 HAL is used.
  41. ;
  42. ; Return Value:
  43. ; TRUE (non-zero in eax): LSX5030/40/40E detected
  44. ; FALSE (zero in eax): non-LSX5030 detected
  45. ;
  46. ;--
  47. cPublicProc _DetectOlivettiMp,1
  48. ; 3 byte value is read from 0c80-0c82
  49. mov edx, 0c80h
  50. in al, dx
  51. cmp al, 3dh ; Manufacturer Code - 1st byte
  52. jne NotAnLSX5030
  53. inc edx
  54. in al, dx
  55. cmp al, 89h ; Manufacturer Code - 2nd byte
  56. jne NotAnLSX5030
  57. inc edx
  58. in al, dx
  59. cmp al, 03h ; Product Number part 1
  60. jne NotAnLSX5030
  61. ;inc edx
  62. ;in al, dx
  63. ;and al, 0f8h ; 5-bit Product Number part 2
  64. ;cmp al, 10h
  65. ;jne NotAnLSX5030
  66. ;
  67. ; Detect Processor Type reading Product Number part 2
  68. ; Mask out Id's different from Cxh and Dxh
  69. ;
  70. mov edx, 0c8bh
  71. in al, dx
  72. and al, 0e0h
  73. cmp al, 0c0h
  74. je AnLSX5030
  75. NotAnLSX5030:
  76. mov eax, 0
  77. stdRET _DetectOlivettiMp
  78. AnLSX5030:
  79. mov edx, dword ptr [esp+4] ; get the address of IsConfiguredMp
  80. mov byte ptr [edx], 1 ; *IsConfiguredMp = TRUE
  81. mov eax, 1
  82. stdRET _DetectOlivettiMp
  83. stdENDP _DetectOlivettiMp
  84. _TEXT ENDS