Can you tell me how to compile a project to get kext? I only get a unix file.
I have very little experience in xcode, for all the time I collected 2-3 applications that I found on GitHub.
In Xcode 3.2.6 and earlier, there's a menu where you select the target (KEXT, framework, library) and the type of build (Release, Debug).
Here, try this v1.6 (Intel/PPC). Just built it on Intel 10.6.8, xcode 3.2.6 with 10.4/10.5/10.6 sdk's. Still got two errors on build, but I don't want to dive deeper into it. Current master version produced even more errors, so I skipped it. I'm flying blind here, so it's not tested.
* Why don't you guys provide pre-built binaries on you githubs? Why do we all have to go thru all the pains?
** BUILD SUCCEEDED **
cc DirectHW.c -dynamiclib -framework IOKit -o libDirectHW.dylib
In file included from DirectHW.c:19:
MacOSMacros.h:54:6: warning: #warning x86_64
MacOSMacros.h:70:6: warning: #warning SDK 10.6+
cc -static -c DirectHW.c -o libDirectHW.a
In file included from DirectHW.c:19:
MacOSMacros.h:54:6: warning: #warning x86_64
MacOSMacros.h:70:6: warning: #warning SDK 10.6+
mv libDirectHW.dylib build/Release/libDirectHW.dylib
mv: rename libDirectHW.dylib to build/Release/libDirectHW.dylib: No such file or directory
make[1]: *** [libs] Error 1
make: *** [directhw] Error 2
I didn't update the makefile since I only needed the kext which I build in Xcode instead of using make.
The xcodebuild command probably should be updated to specify the 10.6 project since the DirectHW folder contains two Xcode projects.
I think you need to change build to build/build10.6
The makefile installs the kext to /Library/Extensions/DirectHW.kext but that's not necessary for old versions of macOS. In old versions of macOS (10.8 and earlier) or new versions of macOS with SIP disabled (10.11 - 10.15) You can load it manually as long as it has proper file permissions. macOS 11 - 13 requires installing to /Library/Extensions and allowing the kext in Security preferences panel.
The makefile installs the framework, dylib, library, and object files to default locations on your system so that apps that don't compile or link the DirectHW.c file directly into their binary can use the code. DirectHW on PPC probably won't do anything for flashrom until you make changes and recompile flashrom.
pciutils testing:
arch darwin darwin2 darwin3 intel-conf1 How to load unsigned DirectHW.kext
10.4.11 Tiger p - - p -
10.5.8 Leopard pP - - pP -
10.4.11 Tiger i i - p i pi
10.5.8 Leopard ix ix - p ix pix
10.6.8 Snow Leopard x ix - p ix pix
10.7.5 Lion x ix - ix ix
10.8.5 Mountain Lion x ix - ix ix
10.9.5 Mavericks x ix - ix ix install to /System/Library/Extensions.
10.10.5 Yosemite x ix ix ix ix add "kext-dev-mode=1" to boot-args.
10.11.6 El Capitan x - - ix ix disable SIP.
10.12.6 Sierra x - panic ix ix disable SIP.
10.13.6 High Sierra x ix ix ix ix disable SIP.
10.14.6 Mojave x ix ix ix ix disable SIP.
10.15.7 Catalina x x x x x disable SIP.
11.7.2 Big Sur x x x x x disable SIP. Install to /Library/Extensions. Allow in "Security & Privacy" preferences panel. Restart.
12.6.2 Monterey x x x x x disable SIP. Install to /Library/Extensions. Allow in "Security & Privacy" preferences panel. Restart.
13.1 Ventura x x x x x disable SIP. Install to /Library/Extensions. Allow in "Security & Privacy" preferences panel. Restart.
kernel user
p = ppc 10.1 10.1
P = ppc64 - 10.5 SDK (only works on PPC Mac)
i = i386 10.4 10.4
x = x86_64 10.6 10.6
a = arm64 11 11
- for 10.1 to 10.3 : use GCC 3.3 and the oldest SDK.
- for 10.4 Xcode 2.2.x or 2.3, use GCC 4.0 and 10.4 SDK (not 10.4u).
- for 10.4 Xcode 2.4 or later, define KPI_10_4_0_PPC_COMPAT for PPC architecture, use 10.4u SDK for both PowerPC and Intel.
- for ppc64 user, 10.5 SDK has 64 bit libraries.
# darwin doesn't work from ppc userspace because AppleACPIPlatformExpert user client doesn't support cross endian.
# darwin doesn't work with ppc kernel since ppc doesn't have ACPI and doesn't use AppleACPIPlatformExpert.
# intel-conf1 method only supports registers 00-FF.
# both darwin3 and intel-conf1 require DirectHW.kext.
# darwin3 requires joevt/directhw.
# ppc userspace requires joevt/directhw.
# darwin and darwin2 require boot-args to contain "debug=".
# all require administrator rights.
# darwin2 requires OS X 10.10 or later.
# darwin and darwin2 don't seem to work in OS X 10.11; instead, use Darwin3 or intel-conf1 with DirectHW.kext.
Correct, along with changing the size in the FCode header and the number of blocks in the PCI header. That was the only thing I could do not being able to re-tokenize the whole thing. I did try your DumpPCIRom.sh script, but it segfaulted when attempting to decode the original ROM when using that perl script, and produced too many untokenizable words when trying to decode it with the NDRVs stripped out (which apparently were what was causing the segfault).
Maybe you need updated versions. What version of macOS were you using? I use it in Monterey currently. The script works with my version of detok.