Live data from Hacker News

Hacking the OS X Kernel for Fun and Profiles

research.swtch.com

1–10 of 38 posts

Re: Hacking the OS X Kernel for Fun and Profiles

#2
I'm afraid the title may scare people off the article. i assure you, "hacking" here is used in the canonical sense: "An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed."

Re: Hacking the OS X Kernel for Fun and Profiles

#3
post #2

I'm afraid the title may scare people off the article. i assure you, "hacking" here is used in the canonical sense: "An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed."

I think the "hacking X for fun and profit" is a pretty well-known trope.

Re: Hacking the OS X Kernel for Fun and Profiles

#4
post #2

I'm afraid the title may scare people off the article. i assure you, "hacking" here is used in the canonical sense: "An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed."

I think the "hacking X for fun and profit" is a pretty well-known trope.

i agree, but the context nowadays is different. you don't often see articles about modifying the binaries of major operating system kernels.

what impressed me most is that the hack worked flawlessly on one of my 10.8.5 pre-release kernels even though it had not been tested there yet.

Re: Hacking the OS X Kernel for Fun and Profiles

#5
post #2

I'm afraid the title may scare people off the article. i assure you, "hacking" here is used in the canonical sense: "An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed."

Have you noticed you are posting this on Hacker News? :)

Re: Hacking the OS X Kernel for Fun and Profiles

#6
post #5
post #2

I'm afraid the title may scare people off the article. i assure you, "hacking" here is used in the canonical sense: "An incredibly good, and perhaps very time-consuming, piece of work that produces exactly what is needed."

Have you noticed you are posting this on Hacker News? :)

... where it will compete with articles about the Star Wars Weather Forecast and discussions on TV programmes. yes, the humour is not lost on me ;)

Re: Hacking the OS X Kernel for Fun and Profiles

#8

Can anyone provided an explanation of how the binary patch is applied?

If you're familiar with Go you can read the source of the apply function here:

the loadKernel function reads in the kernel and builds a symbol table looking for the bsd_ast and current_thread symbols here:

https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fi...

then the "apply" func writes the modified binary instructions code:

https://code.google.com/p/rsc/source/browse/cmd/pprof_mac_fi...

Re: Hacking the OS X Kernel for Fun and Profiles

#9
Can someone explain what this patch actually does? I have an old Macbook Air with a malfunctioning sensor that cause the CPU to always run in powersaving mode (capped at 800 mhz), so it's basically unusable under OS X.

I have walked around this issue by installing Linux which allows me to tune the CPU governor manually, and it uncaps the artificial limit that the malfunctioning sensor puts.

Would this patch allow me to do something similar in Mountain Lion?

Re: Hacking the OS X Kernel for Fun and Profiles

#10
post #9

Can someone explain what this patch actually does? I have an old Macbook Air with a malfunctioning sensor that cause the CPU to always run in powersaving mode (capped at 800 mhz), so it's basically unusable under OS X. I have walked around this issue by installing Linux which allows me to tune the CPU governor manually, and it uncaps the artificial limit that the malfunctioning sensor puts. Would this patch allow me…

The patch fixes a bug with how the SIGPROF signal is delivered to a process, ensuring that it gets delivered to the proper thread rather than an arbitrary thread. It's unrelated to anything in the area of powersaving or clock speed throttling.
Post reply on HN