在Mac上开发和调试KEXT [英] Developing and Debugging KEXT on mac

查看:427
本文介绍了在Mac上开发和调试KEXT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode在Mac上开发KEXT,每次编译后,我都通过终端更改权限并加载KEXT,然后从控制台应用程序读取结果.开发中的一些错误使系统陷入内核恐慌,我不得不重启我的mac,这真令人讨厌.我想知道是否有更好的方法来开发和调试KEXT?

I'm developing a KEXT on mac using Xcode, After every compile I'm changing permissions through terminal and load the KEXT, then reading results from console app. Some of the mistakes in development giving system a kernel panic and I have to restart my mac, this is so annoying. I was wondering if there is a better way to develop and debug a KEXT?

推荐答案

这个问题的答案太大了,但至少有据可查,请查看Apple的以下文件:

This is too big a topic for an answer, but it is at least well documented, look at these documents from Apple:

  • When Things Go Wrong: Debugging the Kernel
  • Debugging a Kernel Extension with GDB
  • Technical Note TN2063: Understanding and Debugging Kernel Panics

还请注意,您可以通过Firewire(使用另一台Mac上的fwkpfv命令行实用程序)或串行端口(主要用于在VM中进行测试,因为现代Mac不能使用)从kprintf()记录调用中获取输出. t有串行端口). kprintf是同步的,因此,与kernel.log不同,您将看到调试输出,即使调试输出紧接在崩溃之前也是如此.

Also note that you can get the output from kprintf() logging calls via Firewire (using the fwkpfv command-line utility on the other Mac) or Serial Port (mainly useful for testing in VMs, as modern Macs don't have serial ports). kprintf is synchronous, so unlike the kernel.log you will see the debug output even if it occurs immediately before a crash.

这篇关于在Mac上开发和调试KEXT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆