Category Archives: Hardware

lspci and dmidecode under MacOS X

Thanks goes to a guys from coreboot for the DirectHW kernel driver and framework that emulates the most commonly used hardware access functions on x86 machines under Mac OS X.

DirectHW is free software and released under the license ISC-L.

Build the DMG installer with kernel driver and framework:

git clone http://review.coreboot.org/p/directhw.git
cd directhw/macosx
make directhw

A couple of people having trouble building DirectHW, so you can download from mirror

Build and install pciutils-3.1.7:

PCIUTILS="pciutils-3.1.7"
rm -rf ${PCIUTILS}{,.tar.bz2}
wget -v -nd -c ftp://ftp.kernel.org/pub/software/utils/pciutils/${PCIUTILS}.tar.bz2
tar xvjf ${PCIUTILS}.tar.bz2
patch -p0 < patches/${PCIUTILS}.diff
cd ${PCIUTILS}
make OPT="-O2 -arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" install install-lib
cd -
rm -rf ${PCIUTILS}{,.tar.bz2}

Build and install dmidecode-2.11:

DMIDECODE="dmidecode-2.11"
rm -rf ${DMIDECODE}{,.tar.bz2}
wget -v -nd -c http://download-mirror.savannah.gnu.org/releases/dmidecode/${DMIDECODE}.tar.bz2
tar xvjf ${DMIDECODE}.tar.bz2
patch -p0 < patches/dmidecode-2.11.diff
cd ${DMIDECODE}
make install
cd -
rm -rf ${DMIDECODE}{,.tar.bz2}

Don’t forget to load the kernel extension:

sudo kextload /System/Library/Extensions/DirectHW.kext

Great, now you can use lspci, dmidecode, etc… don’t forget to use sudo:

update-pciids
sudo lspci -vv
sudo dmidecode
sudo biosdecode

USB to UART Bridge Controller (dongle)

Finally i’ve got TTL to USB dongle. Here is some photos:

CP2102 Front
CP2102 Back

Silicon Labs CP2102 as detected by MacOS

CP2102 MacOS USB1
CP2102 MacOS USB2

Drivers can be downloaded from the official site.
Driver version 4.1.1 successfully installed under MacOS X Yosemite 10.10.5 (14F27).

$ kextstat | tail -1
  170    0 0xffffff7f832d7000 0x6000     0x6000     com.silabs.driver.CP210xVCPDriver (4.1.1) <90 37 4 3>

driver loaded and we’re got two special character devices under the /dev directory:

$ ls -la /dev/*SLAB*
crw-rw-rw- 1 root wheel 17, 11 Sep 14 23:04 /dev/cu.SLAB_USBtoUART
crw-rw-rw- 1 root wheel 17, 10 Sep 14 23:04 /dev/tty.SLAB_USBtoUART

now we’re should perform loopback test. Short RX and TX pins, and run terminal:

sudo cu -l /dev/tty.SLAB_USBtoUART -s 115200

try to enter some text. Letters should be displayed while each key pressed.
If you’re see typed text all fine and press ~. (tilde and period) to exit terminal.