Linux Kernel Project Update: Touchpad is Working!

Big thanks to roadrunner2 for his work on getting functionality on his Macbook Pro (which shares alot of the same components as our computers). Apparently, there was a communication breakdown between the device and driver which is fixed by adding short delays between the setup messages. I’m not sure if this is the optimal way to solve it, but at least the trackpad has pretty close to full functionality now!

It makes me very happy to say that I am now typing this blog post from inside Linux on my Macbook.

What still doesn’t work is force touch (pressing harder on the trackpad) and right click via a two finger click (which I utilize alot). Most likely the force touch will be backburnered since it is high effort, low reward, and I can just add two finger click without having to do it from within the kernel itself.

I’ve put off work on the speakers for now since it is relatively unimportant, at least compared to getting resume working.

From what I’ve read and then confirmed for myself, the hard drive, which is nvme, is not shutting down properly. I tried reversing it, but haven’t been able to gleam too much from that process (I’m not experienced enough in reversing). Someone (I apologize for not remembering your name or where you said this) reversed it and was able to find custom op-codes that are manufacturer specific that are called right before OS X shuts down the hard drive.

My debugging of the problem is significantly hindered by the fact that every time I want to test anything, it results in me having to reboot. Thankfully, the ssd is very quick and arch has a small footprint.

Another possible part of the problem is the disabling of LPSS. From what I can tell from intel’s original LPSS patent, it is used to put the computer in a state where data can be recovered later. However, the patent is super old (1999) and an entirely different system or process is being used to suspend.

It is the intersection of these problems (improper nvme shutdown and disabled lpss side-effects) that makes fixing resume so finicky. I’m going to read as much as I can about LPSS and nvme as well as try once again to reverse the Mac driver.

Linux Kernel Project Update: Keyboard is working!

Project introduction here:

Max has figured out that if you disable the low power subsystem (LPSS) inside of the SPI driver (pxa2xx.c), then the applespi driver written by cb22 is able to do its job. In other words: the keyboard now works!

Well… mostly. Key rollover still does not work, so you can’t press two keys at the same time and have both be detected. Wakeup from keyboard also doesn’t work. The latter we’ll tackle along with sleep/hiberate issues. The former Max is trying to figure out now.

The immediate next step is to get the trackpad to work as well. Valid data is being read by the IRQ handler, so it should just be a matter of piping it to the correct place.

My focus is now on getting the internal speakers to work. Strangely enough, the headphone jack and internal mic work perfectly, it’s just the speakers that don’t output anything. There’s a bugzilla post for this that’s been a fairly helpful start: For an overview of the linux audio stack see this article:

So far, I’ve played around with the patches mentioned in the bugzilla as well as hda jack retask to see if I could reroute to a different pin that is hopefully the speaker. No luck with that. Next I tried to just route the output to all unconnected pins, and that did get some sound from the speaker. Not the right sound and the kernel promptly panicked. But it’s something…

After this, the next things to tackle are:

  • Screen tearing
  • Bluetooth
  • Sleep/hibernate

An Update on my Progress in BJJ

It has been exactly two months since I’ve started training Brazilian Jiu-Jitsu and I’ve managed to attend class on average five times per week (excluding last week which was spring break).

I am so glad that I started and am grateful for those who turned my attention to it: Mike Cernovich, who got the idea into my head that I need to build my body and train martial arts; my friend Dan who recommended I listen to the Jocko Podcast; Jocko and Echo, who convinced me that BJJ was an extraordinary martial art; and Joe Rogan and Sam Harris, whose commentary on it pushed me over the edge to finally go to my first class. I am also incredibly thankful that a BJJ gym is so close to me (10 minutes by bus) and that Brian is such an amazing instructor.

So for anyone thinking about training, go and do it, it is probably one of the best things to happen to me.

Onto the progress update…


This has been my main focus, I want to build my game upon a rock-solid defense. I’ve started every roll from butterfly except for those where my partner insists on playing guard (looking at you, Anthony).


If I can get into a good survival posture, I can almost always defend submissions against other white belts. The ones I have the most trouble defending against are the ezekiel choke from mount, bow and arrow choke from back, kimura from north/south. My best defenses seem to be against the guillotine and triangle.

The problem is that I can’t always get into a survival posture right out of a transition. This will be one of my main focuses going forward.


I still don’t have a reliable side control escape, the standard hip-out-and-insert-knee works sometimes, but I still need to get it down solid. From mount, I can usually get an uppa vs smaller opponents and a knee-elbow vs larger ones. From back control, I seriously don’t have a good escape. I usually have to just try and survive until the round ends.

Playing Guard

In general, my 0pen guard is pretty horrible. It gets passed super easily and I can very rarely recompose it. Grapplearts’ Bottom Game Formula has been super helpful so far, I just need to implement the techniques more often in my rolls. The granby roll-type resets in particular have been hard to implement.

Although, playing spider guard is super fun even though I can’t get the sweep very often. In no-gi, I’m a fan of x and single-leg x to set up the straight ankle lock and guard pass.

From closed guard, I can semi-reliably get a hip-bump sweep and I like using a push-pull with the arm to setup the triangle. I still don’t feel like my armbar from here is tight enough.


Passing the Guard

Haven’t really focused on this at all, so it’s predictably very underdeveloped.

Control and Transitions

I can hold side control, but have trouble transitioning to mount, especially on smaller opponents where the knee ride isn’t available. As long as I can remember the feet-behind-hips cue, I can hold mount, otherwise, it’s pretty shotty. I haven’t really had enough experience with back mount to have complete control.


The submissions I’ve gotten so far are the triangle from closed guard, omaplata from spider guard, and the ezekiel from mount. I’m still searching for that one submission that I really like and will try and master. Right now the triangle is the top contender, but I also really like the guillotine and arm triangle/darce chokes. Will make that decision as I get more experience.


I still have a long, long, long way to go, obviously. Right now I’m focusing on developing my open guard and getting into survival posture right away when it does get passed. I need to start doing some solo drills, especially related to hip escaping and granby rolls.

I have exactly one month until my first tournament, The Good Fight in Albany. I feel completely unprepared for it, but hopefully can tighten up my game a little before it. My cardio is probably going to be above average and I am going to use that as much as possible. Rounds are eight minutes and if I can make it as tiring for them as possible, I can force a mistake and hopefully get a submission. This means trying to keep it standing if possible and being the aggressor if they pull guard. Endless pressure and constant movement will be the name of the game. I’ll post another update right after the tournament with my results.

Newest Project: Working on the Linux Kernel

This is a long overdue post on our (Max Shavrick and my) work on the Linux kernel for RCOS. We are being supported by Microsoft through mentorship by Stephen Hemminger, who works on the kernel for a living.

Max and I both own the 2015 12″ Macbook (8,1), which unfortunately contains quite a few hardware items that do not yet have drivers in the Linux kernel. Our task is to try and fill these gaps.

The most important of these is getting the keyboard and trackpad to work. The issue is that they are both SPI devices, which Linux does not currently support. In addition, there is not a DMA controller built into the SPI controller as in the 2016 (9,1) Macbook. There are two posts on Bugzilla about it as well as one on Bounty Source. There is also a WIP driver on Github from cb22 that apparently has basic functionality (no rollover or wakeup) on the 2016 Macbook.

By forcing the pxa2xx driver (the main SPI controller for Linux) to not use DMA, Max has been able to detect keypresses and touchpad actions. However, all of the packets are filled with zeros. There are three hypotheses:

  1. We are not reading the correct number of bytes (currently reading 256 in chunks of 8).
  2. We are not correctly acknowledging that we have read the bytes resulting in the last packet being sent.
  3. No bytes are being transferred and an empty buffer is being returned.

At this time, we are not sure how to proceed. We aren’t able to run kgdb since there is no (simple) way to connect via a serial connection.

I’m still wrapping my head around how all of the communication in the kernel works, I’ll have a blog post next week explaining as much as I know.


Interesting Links: February 2017


  • Why We Get Fat: “Optimal nutrition is about maximising micronutrients while managing your glucose load so your pancreas can keep up. In addition to managing carbohydrates, moderating protein, increasing fibre and maximising nutrition, are important to optimise body fat and normalise blood glucose.”
  • Why Learning is the New Procrastination: “Stop learning by watching the game. Start learning by playing it.”
  • Charlie Munger on Getting Rich, Wisdom, Focus, Fake Knowledge and More: “While we can’t have his genetics, we can try to steal his approach to rationality. There’s almost no limit to the amount one could learn from studying the Munger mind, so let’s at least get started by running down some of his best ideas.”
  • A Brief History of Existential Terror: “Success, in this view, is to find a fear that is at your level of skill and ambition, something which might not work, and to dance with it. The biggest danger in the modern world is not failure, it’s boredom.”
  • Creating Focus: “Instead of writing some non-sense motivational speech on how to get amped up about your life, we’re going to outline a way to consistently get into ‘the zone’.”
  • 10 Year Projects and Short Term Projects: “If you choose your projects right, life will be very satisfying, full of achievements, every year will be a little easier and better than the last one… I’d like to recommend a guideline to you: only do 10-year projects or short projects, and almost nothing in between.”
  • How Your Climate-Controlled Comfort Is Killing You: “But what if our quest for technology-enabled comfort has actually made us physically and mentally weaker and sicker? What if our bodies actually need discomfort to truly thrive and flourish?”


Recently Finished:

  • The 22 Immutable Laws of Marketing
  • Stealing Fire
  • Extreme Ownership

Up Next:

  • Contagious
  • Cashvertising
  • The Boron Letters
  • The Robert Collier Letter Book
  • Zen Habits
  • Mindfulness in Plain English
  • The Magic of Thinking Big

How I (Finally) Started a Journaling Habit

It seems that almost every site I follow recommends keeping a journal:

For the longest time (think: years), I’ve tried and failed to keep up a consistent journaling habit. But in the last 100 days, I’ve only missed two and by now it’s a solid habit that doesn’t take any willpower in the morning. In fact, it actually takes willpower not to do it.

So what finally did it?

Fountain pens and nice notebooks. Let me explain…

Journaling is one of those things where you don’t see much benefit from it until after you’ve consistently done it for a while. This makes it hard to fit into the cue-action-reward loop that is required for habit formation.

With meditation, my cue is sitting down at my desk after weighing in and the reward is the feeling of calm immediately proceeding it. With working out, my cue is a certain time every day and the reward is the endorphin rush and chocolate protein shake.

I had the cue worked out for journaling, but was never rewarding myself with anything. When I finally shelled out for a nice pen, ink, and paper (TWSBI Eco, Pilot Iroshizuku, and LEUCHTTURM1917 for you nerds out there :p), the act of writing itself was a pleasant experience and didn’t need an additional reward.

Aside: this is an example of friction and snowball mental models. Reducing friction lets the snowball start to roll down the hill to produce something exponentially greater than what you started with and the energy added.

This makes it much easier to get the action reinforced and once you add a bit of willpower to do it consistently for a bit… Voila! You have a habit!

Something else that helped me was the idea that you don’t need to follow any sort of type of journaling. Just start, experiment, and do what works for you. I tried quite a few that were so complicated that maintaining them took much more time than it was worth.

At first, you may think that you don’t have enough going on in your life to justify journaling, but believe me, once you start, you’ll want to write down everything.

For now, my journaling habit looks something like the following:

  • Immediately after waking: stream of consciousness, 1 page minimum
  • During the day: modified bullet journal to track habits, food, and condensed learnings as well as pending to-dos
  • After BJJ: freeform, anything I learned
  • Before going to bed: what went well and what didn’t

It’s the small things in life…

… that bring me the most joy.

The big things–my health, my career, and (especially) my love life–are never all going to be completely where I want them to be. I find that I can very easily brush away my successes and focus on where I am still failing.

But the small things–

the incredible design of a pen,

the subtle flavors in a cup of coffee,

the perfectly-timed bassline in a live DnB set,

the editing of a great book that is worth every penny,

the absolutely hilarious facial expressions in a comic strip,

–the tiny details that someone put countless hours of work in to make just perfect, these are the things that I find I can appreciate the most.

Interesting Links: January 2017


  • First, See the Circle: Another great article by Scott H Young that challenges one to think more consciously about which of our behaviors are scripts and which are intentional. Plus, it introduced me to Westworld, a TV show I highly recommend watching (and I don’t say that often!).
  • Mental Models I Find Repeatedly Useful: A monster post by the founder of Duck Duck Go on mental models and thinking better. I certainly will be stealing a bunch of these as I build out my own mental models page.
  • The Challenge of Arendtian Action: Breaking Smart is back! Anything written by Venkatesh Rao you should just go ahead and read.
  • Goals Cause Depression: A thought-provoking post from the always-contrarian Wall Street Playboys. This time, they extoll the virtues of time allocation as a framework for achievement instead of goal setting.
  • How to Break into the Tech Industry: An incredibly thorough post about getting a tech job even with an unconventional background. I will surely be revisiting this article often in my own search for a good job.
  • How You Move Defines How You Live: A follow-up post and set of videos to Tim Ferriss’ Tools of Titans in which Peter Attia shows us the best way to prepare to move correctly.
  • Making Badass Developers: An older video from O’Reilly in which Kathy Sierra, the creator of the excellent Head First series, presents on how developers can level-up their skills.


Recently Finished:

  • Tools of Titans
  • True to Form
  • The Goal

Up Next:

  • Extreme Ownership
  • Zen Habits
  • Mindfulness in Plain English
  • Mindfulness
  • Radical Acceptance

On Starting Brazilian Jiu-Jitsu

In the past month, I listened to every episode of The Jocko Podcast, in which Jocko Wilink, an ex-Navy SEAL speaks on military leadership, self-discipline, and Jiu-Jitsu. I can’t quite articulate how much this podcast has helped me and I highly recommend it to anyone.

One of the things that I was most excited to try out was Brazilian Jiu-Jitsu. BJJ is a martial art, combat sport system that focuses on grappling and especially ground fighting and, according to Jocko, is the best first martial art to learn and has benefits far beyond learning how to fight.

So this semester, I found a BJJ gym close to me and tried it out for my first week.

“BJJ promotes the concept that a smaller, weaker person can successfully defend against a bigger, stronger, heavier assailant by using proper technique, leverage, and most notably, taking the fight to the ground, and then applying joint-locks and chokeholds to defeat the opponent.” – Wikipedia

Before trying it, I was still a little bit skeptical about just how much leverage could make up for a weight/size difference.

Boy, was I wrong about that. On the third day, I rolled with a girl who couldn’t have weighed more than 100 lbs. Before slapping hands, she seemed perfectly aloof and content with rolling with someone at least 60% larger than her.

The clock started and I thought I might simply be able to pass her guard with strength alone. I moved her arms to one side and tried to explode to the other to get side control. This completely backfired.

I still don’t exactly know what happened, but the next thing I know, she’s mounted on me and put me into the hardest armbar I’ve ever experienced.

I tap, she lets go, and I look at the clock. 30 seconds have gone by.

I look back at her with what could only have been a stupid look of astonishment and she gives back a wry smile. Touche.

We slap hands and go again. I last a little bit longer this time, but she still eventually manages to get me into a rear naked choke. 50 more seconds have gone by…

And again we go. Less than 20s in, she’s again in a dominant position. I manage to get anchored around one of her legs and keep a frame with my elbows between us. This was surely the only thing that kept me from not being submitted (again) in the 20s that remained.

When we get up, I’m completely exhausted and volunteer to sit out for the next round. I look over to her again and get nothing back. It was like she never even broke a sweat during that.


Later that day, I saw an even smaller women (probably 90lb, definitely less than 5′ tall) submit a much, much larger man (probably 250lb, at least 6′ tall).

Lesson learned: leverage is a powerful thing.

Even though I get completely wrecked by more than one girl and many, many guys, training is very fun and I plan on continuing it for as long as I can. Even though my aim is not (really) to learn how to fight, if that is yours, especially if you expect to be at a size disadvantage, I highly recommend finding a BJJ gym and checking it out.

The Best Books I Read in Fall 2016

During this past semester, I read more interesting books than I previously had in any similar time period. Below are the absolute best ones. Enjoy!

Sapiens by Yuval Noah Harari

Undoubtedly one of the most thought-provoking books that I’ve ever read. Harari argues that the main differentiator between homo sapiens (literally “wise man”) and every other species is that we are able to collectively believe in non-physical ideas. These “myths” like governments, corporations, religions, etc. enabled us to come together and accelerate our own progress.



Ego is the Enemy by Ryan Holiday

I don’t think any book has ever made me introspect as much as this one did. In Ryan Holiday’s second philosophical book, he draws the experience of both himself and of people like George Marshall, Katharine Graham, and Bill Belichick to explain that our largest impediment to success is not anything in the outside world, it is our own ego.

See my notes here.

How to Get Filthy Rich in Rising Asia by Mohsin Hamid

I don’t read much fiction at all (two this semester, I think), but this one came so highly recommended by so many people, and for good reason. It’s a wonderful reminder that people are the most important things in our lives, not fortune or fame. The impact that it had only could have happened in the unique way that it was told.



Why Greatness Cannot Be Planned by Kenneth Stanley and Joel Lehman

Another incredibly thought provoking book that turns conventional knowledge on it’s head. Stanley starts off by describing a scientific discovery made in artificial intelligence that concludes that perhaps objective-based thinking is not the way to go. He then goes onto explain the ramifications of this discovery on fields ranging from scientific research funding to education to personal development. It’s a bit too long and not terribly well written, but the content is exceptional.

See my notes here.

Models by Mark Manson

This is the first dating advice book I’ve read that didn’t focus on manipulating or tricking women into liking you. Rather, Manson explains that one should focus on creating an attractive lifestyle and then communicate it effectively. Improving my dating life is going to be one of my major themes in 2017 an I’m sure I’ll be referring to this often.

See my notes here.




Algorithms to Live By by Brian Christian and Tom Griffiths


Theoretical computer science has been a topic that I’ve actively avoided for many years. Somehow, this book, by telling the stories behind discoveries as well as connecting theoretical topics to practical problems, was able to be a true page-turner. Extremely fun book, even for non-technical people.