Guest User

Untitled

a guest
Jun 2nd, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. cpuid.s:
  2.  
  3. .global cpuid_vendor
  4.  
  5. cpuid_vendor:
  6. pushal
  7.  
  8. mov $0x0, %eax
  9. cpuid
  10.  
  11. movl %ebx, (%edi)
  12. movl %edx, 4(%edi)
  13. movl %ecx, 8(%edi)
  14.  
  15. popal
  16. ret
  17.  
  18. source/cpuid.h:
  19.  
  20. extern void cpuid_vendor(uint8_t cpuid_vendor_string[12]);
  21.  
  22. kernel.c:
  23.  
  24. uint8_t cpuid_vendor_string[12];
  25. cpuid_vendor(cpuid_vendor_string);
  26.  
  27. for (int i = 0; i < 12; i++)
  28. {
  29. printf("%c", cpuid_vendor_string[i]);
  30. }
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment