Jump to content

Various Hardware Info tools for OS X

Hardware info OS X

  • Please log in to reply
10 replies to this topic

#1
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,619 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...

I ported a number of tools to Mac OS X for getting some hardware info on some machines.

- ectool: Tool to get info from the Embedded Controller

- flashrom: You know this one ;)

- ethtool: Tool to get info from the ethernet adapters / WiFI cards (mostly done)

- ich_descriptors_tool: Tool to get south bridge info

- ifdtool: Tool to get info from UEFI BIOS

- inteltool: Tool for Intel CPU info

- lspci: PCI Info

- mptable: Tool to get multiprocessor description table

- msrtool: Tool for MSR info

- nvramtool: Tool for NVRAM info

- osxpmem: Tool for getting OS X memory data

- probe, video: Tool for checking Intel GPUs

- setpci: Tool for setting PCI data

- superiotool: Tool for probing SuperIO chip

- testvideobios: Tool for forcing load of a custom (video) BIOS ROM

 

2 kexts:

- DirectHW.kext: Direct HW communication driver

- pmem.kext: Direct memory access driver, this creates /dev/pmem

 

Enjoy :D

 

I also collected some info on a real MacBook Pro.

Also my laptop dump from some of the apps is attached ;)

Attached Files



#2
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,085 posts
  • Gender:Male
  • Location:UK

Thank you for this treasure trove of tools Andy  :)



#3
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,085 posts
  • Gender:Male
  • Location:UK

Thanks to Andy posting pmem.kext because I have now been able to do something I wanted to do for a while and that’s put a script together to dump the ACPI tables directly from memory. I only put it together in the last 24 hours or so, so it’s not perfect and it may not work for everyone. 

 
The script doesn’t deal with ACPI_recl (reclaimable) regions so it may fail to find the RSDP pointer. It fails on my iMac so for now I uncomment line #282 and force a larger block size of memory to read and then it works.
 
There may well be other error checks which haven’t be dealt with properly too, but for now it works as an example of reading memory directly from within OS X.
 
I’ve tested it on 10.9 and 10.10 DP5.
 
The script requires a memory map to work from. I have been using the FirmwareMemoryMap.txt file from DarwinDumper’s Firmware Memory Map option.
 
Usage is:
./dumpACPIfromMem.sh
or
./dumpACPIfromMem.sh /path/to/FirmwareMemoryMap.txt

 
ps. @Andy - I hope you don’t mind me posting this here but I thought this would show a good example for the kext.
 
EDIT: I forgot to mention that this dumps the native tables from BIOS and not the tables injected by the boot loader.
 
EDIT2: I will work to improve the script to make it dump more as I see it currently does not get all the SSDT tables as you'd see from using Linux or Clover (F4) from GUI.  Done.
 
 
EDIT: Attachment removed.
The script has now matured sufficiently to the point where I wish to see results from other hardware. I have moved this request to the DarwinDumper thread as that is where I eventually wish this script to a part of.


#4
bs0d

bs0d

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 161 posts

EDIT: I forgot to mention that this dumps the native tables from BIOS and not the tables injected by the boot loader.

 

some 'bootloaders' also update the legacy regions for ACPI and DMI so the correct tables will be dumped.



#5
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,085 posts
  • Gender:Male
  • Location:UK

Thanks for the note bs0d. I currently have the option of booting using Chameleon, Clover or Ozmosis so I'll check this evening using the updated version of the script that I've just added to the above post.

I do quite like the option of being able to dump native tables though..



#6
MARKBOARD NETSET

MARKBOARD NETSET

    InsanelyMac Protégé

  • Members
  • Pip
  • 33 posts
  • Gender:Male
  • Interests:Luck for Hack

Thanks for the note bs0d. I currently have the option of booting using Chameleon, Clover or Ozmosis so I'll check this evening using the updated version of the script that I've just added to the above post.

I do quite like the option of being able to dump native tables though..

@blackosx good luck bro i will try your next update :)



#7
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,085 posts
  • Gender:Male
  • Location:UK
I’ve managed to grab some time to test v0.35 of my script on OS X 10.9.4 booted using three different loaders. I’ve run the script twice, first time taking the first RSDP pointer found in memory, and then second time taking the last RSDP pointer found in memory.
 
EDIT: Revised to include tables from all RSDP pointers found (not just first and last)
 
Ozmosis
Only valid pointers found in whole scan were:
---------------------------------------------------------------
RSD PTR #1 : Revision=02 | RSDT Address=cab84028 | XSDT Address=00000000cab84070 | XSDT Length=36
RSD PTR #1 : Revision=02 | RSDT Address=cabb1028 | XSDT Address=00000000cabb1060 | XSDT Length=36
RSD PTR #1 : Revision=02 | RSDT Address=cabbf028 | XSDT Address=00000000cabbf070 | XSDT Length=36
RSD PTR #2 : Revision=02 | RSDT Address=cabc0028 | XSDT Address=00000000cabc0070 | XSDT Length=36
---------------------------------------------------------------
Get first RSDP pointer
=====================
Found Table: XSDT at 00000000cab84070 | Length: 100 | Table ID: A M I
Number of tables in XSDT = 8
Found Table: FACP at 00000000cab8fc68 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cab8fd60 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cab8fdf8 | Length: 60 | Table ID: A M I
Found Table: HPET at 00000000cab8fe38 | Length: 56 | Table ID: A M I
Found Table: SSDT at 00000000cab8fe70 | Length: 877 | Table ID: SataTabl
Found Table: SSDT at 00000000cab901e0 | Length: 2474 | Table ID: Cpu0Ist
Found Table: SSDT at 00000000cab90b90 | Length: 2706 | Table ID: CpuPm
Found Table: DMAR at 00000000cab91628 | Length: 176 | Table ID: SNB 
Found Table: DSDT at 00000000cab84168 | Length: 47866 | Table ID: A M I
Found extra SSDT tables
01e95018 points to zero data
Found Table: SSDT at ca8eda98 | Length: 771 | Table ID: ApIst
Found Table: SSDT at ca8ec018 | Length: 2107 | Table ID: Cpu0Cst
Found Table: SSDT at ca8eec18 | Length: 281 | Table ID: ApCst
Get second RSDP pointer
=====================
Found Table: XSDT at 00000000cabb1060 | Length: 60 | Table ID: A M I
Number of tables in XSDT = 3
Found Table: FACP at 00000000cabbcc28 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cabbcd20 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cabbcdb8 | Length: 60 | Table ID: A M I
Found Table: DSDT at 00000000cabb1128 | Length: 47866 | Table ID: A M I
Get third RSDP pointer
=====================
Found Table: XSDT at 00000000cabbf070 | Length: 92 | Table ID: A M I
Number of tables in XSDT = 7
Limiting length to 1MB
Found Table: -ext at 00000000cabc10c8 | Length: 1048576 | Table ID: PL,curre
00000000cabc11c0 points to zero data
Limiting length to 1MB
Found Table: (?? at 00000000cabc1258 | Length: 1048576 | Table ID: ????
Limiting length to 1MB
Found Table: ? at 00000000cabc1298 | Length: 1048576 | Table ID: ?
Limiting length to 1MB
Found Table:  at 00000000cabc12d0 | Length: 1048576 | Table ID: ??rT_0
00000000cabc1640 points to zero data
Found Table: FACP at 00000000cabc20d8 | Length: 244 | Table ID: Notebook
Found Table: DSDT at 00000000cabc0168 | Length: 8041 | Table ID: Notebook
Get last RSDP pointer
=====================
Found Table: XSDT at 00000000cabc0070 | Length: 100 | Table ID: Notebook
Number of tables in XSDT = 8
Found Table: FACP at 00000000cabc20d8 | Length: 244 | Table ID: Notebook
Found Table: APIC at 00000000cabc21d0 | Length: 146 | Table ID: Notebook
Found Table: MCFG at 00000000cabc2268 | Length: 60 | Table ID: Notebook
Found Table: HPET at 00000000cabc22a8 | Length: 56 | Table ID: Notebook
Found Table: SSDT at 00000000cabc22e0 | Length: 877 | Table ID: SataTabl
skipping table with address 0000000000000000
Found Table: SSDT at 00000000cabc2700 | Length: 908 | Table ID: CpuPm
Found Table: SLIC at 00000000cabc2a90 | Length: 374 | Table ID: Notebook
Found Table: DSDT at 00000000cabc0168 | Length: 8041 | Table ID: Notebook
 
Chameleon (DropSSDT = Yes)
 
Only valid pointers found in whole scan were:
---------------------------------------------------------------
RSD PTR #1 : Revision=02 | RSDT Address=cab84028 | XSDT Address=00000000cab84070 | XSDT Length=36
RSD PTR #2 : Revision=02 | RSDT Address=cabb1028 | XSDT Address=00000000cabb1060 | XSDT Length=36
---------------------------------------------------------------
Get first RSDP pointer
=====================
Found Table: XSDT at 00000000cab84070 | Length: 100 | Table ID: A M I
Number of tables in XSDT = 8
Found Table: FACP at 00000000cab8fc68 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cab8fd60 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cab8fdf8 | Length: 60 | Table ID: A M I
Found Table: HPET at 00000000cab8fe38 | Length: 56 | Table ID: A M I
Found Table: SSDT at 00000000cab8fe70 | Length: 877 | Table ID: SataTabl
Found Table: SSDT at 00000000cab901e0 | Length: 2474 | Table ID: Cpu0Ist
Found Table: SSDT at 00000000cab90b90 | Length: 2706 | Table ID: CpuPm
Found Table: DMAR at 00000000cab91628 | Length: 176 | Table ID: SNB 
Found Table: DSDT at 00000000cab84168 | Length: 47866 | Table ID: A M I
Found extra SSDT tables
Limiting length to 1MB
Found Table: p{N
                 at 01e95018 | Length: 1048576 | Table ID: 
Found Table: SSDT at ca8eda98 | Length: 771 | Table ID: ApIst
Found Table: SSDT at ca8ec018 | Length: 2107 | Table ID: Cpu0Cst
Found Table: SSDT at ca8eec18 | Length: 281 | Table ID: ApCst
Get last RSDP pointer
=====================
Found Table: XSDT at 00000000cabb1060 | Length: 60 | Table ID: A M I
Number of tables in XSDT = 3
Found Table: FACP at 00000000cabbcc28 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cabbcd20 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cabbcdb8 | Length: 60 | Table ID: A M I
Found Table: DSDT at 00000000cabb1128 | Length: 47866 | Table ID: A M I
 
Clover EFI
Only valid pointers found in whole scan were:
---------------------------------------------------------------
RSD PTR #1 : Revision=02 | RSDT Address=00000000 | XSDT Address=000000001ff69000 | XSDT Length=36
RSD PTR #2 : Revision=02 | RSDT Address=cabb1028 | XSDT Address=00000000cabb1060 | XSDT Length=36
---------------------------------------------------------------
Get first RSD pointer
=====================
Found Table: XSDT at 000000001ff69000 | Length: 108 | Table ID: A M I
Number of tables in XSDT = 9
Found Table: FACP at 000000001ff68000 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cab8fd60 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cab8fdf8 | Length: 60 | Table ID: A M I
Found Table: HPET at 00000000cab8fe38 | Length: 56 | Table ID: A M I
Found Table: SSDT at 000000001ff63000 | Length: 877 | Table ID: SataTabl
Found Table: SSDT at 000000001ff61000 | Length: 2474 | Table ID: Cpu0Ist
Found Table: SSDT at 000000001ff5f000 | Length: 2706 | Table ID: CpuPm
Found Table: DMAR at 00000000cab91628 | Length: 176 | Table ID: SNB 
Found Table: SSDT at 000000001ff5e000 | Length: 1549 | Table ID: CpuPm
Found Table: FACS at 00000000cabbdf80 | Length: 64
Found Table: DSDT at 000000001ff65000 | Length: 8041 | Table ID: A M I
Get last RSD pointer
=====================
Found Table: XSDT at 00000000cabb1060 | Length: 60 | Table ID: A M I
Number of tables in XSDT = 3
Found Table: FACP at 00000000cabbcc28 | Length: 244 | Table ID: A M I
Found Table: APIC at 00000000cabbcd20 | Length: 146 | Table ID: A M I
Found Table: MCFG at 00000000cabbcdb8 | Length: 60 | Table ID: A M I
Found Table: DSDT at 00000000cabb1128 | Length: 47866 | Table ID: A M I
EDIT:
So with all three loaders it's possible to retrieve both original BIOS tables and injected tables. 

As far as I know, Ozmosis does not give me the option of dropping SSDT tables, instead I guess intelligently deciding which tables to drop?



#8
STLVNUB

STLVNUB

    InsanelyMac Legend

  • Coders
  • 1,126 posts
  • Gender:Male

Your on a roll, blackosx, keep up the good work, "dropping SSDT tables" is coming ;)



#9
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,085 posts
  • Gender:Male
  • Location:UK

Post above edited to include scans of all RSDP pointers found and not just first and last.



#10
blacksheep

blacksheep

    InsanelyMac Protégé

  • Members
  • PipPip
  • 50 posts
  • Gender:Male
  • Location:Warsaw, Poland

Perhaps it's a stupid question, but I have to ask...

 

Can testvideobios load EFI part of the ROM on real Mac?

Or is this only possible in EFI shell?

 

I'm trying to mod D700 EFI part to work with regular 7970/280X and it would be great if there would be a possibility to test EFI ROMs without a need of flashing the card every time.

So far modded EFI driver is crashing Mac Pro EFI in early booting stage. I must use old 32-bit MP to recover the card every time, because computer refuses to boot even DOS as long card is installed, even along second GPU with good EFI on it.

 

Thank you in advance for your answer.



#11
Rampage Dev

Rampage Dev

    InsanelyMac Deity

  • Local Moderators
  • 1,991 posts
  • Gender:Male
Nice list.





Also tagged with one or more of these keywords: Hardware, info, OS X


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy