Re:
Re:
- Subject: Re:
- From: Michael Crawford <email@hidden>
- Date: Sun, 01 Apr 2018 16:25:18 -0700
Good for you. I'm always happy when the young people exhibit initiative.
Recent releases of Mac OS X (now macOS) require kernel extensions -
drivers mostly - to be digitally signed when used in the "normal way".
However you can disable the signing requirement by disabling System
Integrity Protection in the Recovery System:
Reboot your Mac.
At the very beginning of boot, hold down the option key. (This works
more reliably for me than Command-R or whatever it is.)
Eventually a row of icons will appear. Click on the one that has
"Recovery" in its name.
Click the up-arrow just below the Recovery icon.
When you're in the Recovery desktop, select Terminal from the
Utilities menu. It's slow to load - be patient.
The terminal will have a root shell. No need for "sudo".
This command disables System Integrity Protection:
$ csrutil disable
You will also want to set some debugging flags in the nvram. The
nvram can only be changed in Recovery mode.
$ nvram -p | grep boot-args
... will display the current value of boot-args. You will want to do
something like:
$ nvram boot-args="debug=0x14e"
There are various lists of what you can do with boot-args. Here's one:
https://osxeon.wordpress.com/2015/08/10/boot-argument-options-in-os-x/
IMHO the two-machine debugger works best with Firewire. If your boxes
don't have firewire port you can use Thunderbolt Firewire dongles.
For this you will need:
$ nvram boot-args="debug=0x14e kdp_match_name=firewire fwkdp=0x8000"
fwkdp only needs to be set when using the Thunderbolt dongle.
Reboot again but don't hold the option key.
If you _do_ have your boxes attached via firewire, you can also get
the kernel printfs sent over firewire:
$ fwkpfv
On the host machine (the one with the debugger UI):
$ fwkdp
Apple recommends hiding the terminal window. I'm not clear why one
shouldn't use "nohup fwkdp &" but maybe that's because someone's
grandmother did it that way.
In another Terminal window:
$ lldb
> kdp-remote localhost
Enter the two-machine debugger on the target:
PE_enter_debugger( "message" )
Staple my email to your monitor and you'll do just fine.
Don't be shy about asking questions.
On Sun, Apr 1, 2018 at 2:28 PM, N <email@hidden> wrote:
> Unfortunately, XNU is not very well documented (compared to some other
> kernels). The documentation should mostly
> correspond to the current version of the kernel. Another excellent piece of
> documentation is Amit Singh's book on
> OS X, which is quite dated, but still remains highly relevant.
>
> XNU directory structure reflects the components of the kernel. For example,
> osfmk/ is the mach part, and bsd/
> is the BSD part. The above book also maps functionality of the kernel to its
> components.
>
>> On 1 Apr 2018, at 22:49, Pranav Vyas <email@hidden> wrote:
>>
>> Hey everyone,
>>
>> I am an undergrad studying Operating Systems. We have been asked to do a
>> case study on any operating system of our choice. Detailing how it handles
>> process scheduling, memory management, disk scheduling etc. I wanted to do
>> mine on macOS, and I found this guide online:
>> https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/About/About.html
>>
>> It is perfect for my needs, but it appears to have last been updated in
>> 2013. So I was wondering,
>> 1) Is there a more recent version of this guide?
>> 2) Or failing that, is there some way to find what substantive changes have
>> been made to the kernel since 2013?
>>
>> Also, I found the source code for Darwin on Github, however, I have very
>> little experience navigating such a huge database, any tips on how to get
>> started?
>>
>> Thank you for your time.
>> Pranav
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Darwin-kernel mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Mike Crawford
Portland Custom Software Development
email@hidden
http://soggywizards.com
One Must Not Trifle With Wizards For It Makes Us Soggy And Hard To Light
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >[no subject] (From: Pranav Vyas <email@hidden>) |
| >Re: (From: N <email@hidden>) |