1

I'm working on a kernel extension - a device driver - and rely heavily on diagnostic messages that come from kprintf().

$ fwkpfv on the host machine will display log messages from kprintf() on the target, but it needs "debug=0x8" in boot-args.

# nvram boot-args="debug=0x14e kdp_match_name=firewire"
# nvram -p | grep boot-args
boot-args      "debug=0x14e kdp_match_name=firewire"

(I don't remember clearly whether the quotes were included.)

If I boot normally after setting boot-args:

# nvram -p | grep boot-args

#

I am eternally in your debt.

pmdj
  • 22,018
  • 3
  • 52
  • 103
Mike Crawford
  • 2,232
  • 2
  • 18
  • 28
  • That's rather odd, I've never seen that happen and I use kprintf on a near-daily basis - what macOS/OSX version is this, and if appropriate, is SIP enabled? Have you got some kind of EFI bootloader/menu installed? On more recent versions (10.12+ IIRC) you can't set boot-args from a normal session, only from the recovery OS - or from an earlier OS X install on the same Mac. But if that was the problem, it should error out, not make the NVRAM transient. Any kexts that access NVRAM internally? Also, I guess the NVRAM battery could be dead? (More likely on older hardware…) – pmdj Sep 14 '17 at 11:05

1 Answers1

1

Some folks on the darwin-drivers mailing list pointed out to me that the nvram command holds its settings in RAM until a clean shutdown is performed. I've been in the habit of forcibly powering my Mac Pro off as sometimes my driver panics when it's just been installed.

It worked to boot into recovery mode, set the boot-args, then shutdown from the Apple menu.

This got my Firewire logging back.

Mike Crawford
  • 2,232
  • 2
  • 18
  • 28