<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog on Phillip Tennen</title>
    <link>https://axleos.com/blog/</link>
    <description>Recent content in Blog on Phillip Tennen</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <copyright>Copyright © 2023, Phillip Tennen.</copyright>
    <lastBuildDate>Mon, 15 Apr 2024 00:03:00 +0100</lastBuildDate>
    <atom:link href="https://axleos.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Building a GPS Receiver, Part 4: Measuring Twice</title>
      <link>https://axleos.com/building-a-gps-receiver-part-4-measuring-twice/</link>
      <pubDate>Mon, 15 Apr 2024 00:03:00 +0100</pubDate>
      <guid>https://axleos.com/building-a-gps-receiver-part-4-measuring-twice/</guid>
      <description>We&amp;rsquo;re plotting the satellite&amp;rsquo;s orbit according to the data the satellite is sending, but the resulting orbit is clearly nonsense. My first instinct was to track down where I was parsing the data format incorrectly. To my dismay, these bits &lt;em&gt;are&lt;/em&gt; what the satellites are beaming down, and I was pretty sure I was parsing the data fields correctly. Next line of attack: I knew that the satellites also transmitted parity bits for error detection. I had been ignoring these parity bits up to now. Perhaps it&amp;rsquo;s a good time to check against them?</description>
    </item>
    <item>
      <title>Building a GPS Receiver, Part 3: Juggling Signals</title>
      <link>https://axleos.com/building-a-gps-receiver-part-3-juggling-signals/</link>
      <pubDate>Mon, 15 Apr 2024 00:02:00 +0100</pubDate>
      <guid>https://axleos.com/building-a-gps-receiver-part-3-juggling-signals/</guid>
      <description>We can reliably track our satellites over many minutes! We&amp;rsquo;ve surmounted one of the major challenges in building out gypsum, and now just one obelisk stands before us: computing the user&amp;rsquo;s position. This brings us to the really fun part: reading and decoding the bits that these satellites are transmitting! Unfortunately, this isn&amp;rsquo;t as easy as I imagined at the start. Reading off bits from the satellite requires a peculiar methodology due to the way that the data bits are encoded on top of the PRN code and the carrier wave.</description>
    </item>
    <item>
      <title>Building a GPS Receiver, Part 2: Tracking Pinpricks</title>
      <link>https://axleos.com/building-a-gps-receiver-part-2-tracking-pinpricks/</link>
      <pubDate>Mon, 15 Apr 2024 00:01:00 +0100</pubDate>
      <guid>https://axleos.com/building-a-gps-receiver-part-2-tracking-pinpricks/</guid>
      <description>We&amp;rsquo;re getting there! We&amp;rsquo;ve set up a pipeline that can read vast quantities of floating point samples from our radio hardware, and can pick out the hums of the GPS satellites amongst the noise. Our acquisition phase told us which GPS satellites are within view of the user, and has given us a &lt;em&gt;coarse&lt;/em&gt; estimate of each satellite&amp;rsquo;s Doppler shift and PRN sequence phase. However, these satellites are extremely precise devices in a noisy and changing environment, and our coarse estimates won&amp;rsquo;t nearly cut it.</description>
    </item>
    <item>
      <title>Building a GPS Receiver, Part 1: Hearing Whispers</title>
      <link>https://axleos.com/building-a-gps-receiver-part-1-hearing-whispers/</link>
      <pubDate>Mon, 15 Apr 2024 00:00:00 +0100</pubDate>
      <guid>https://axleos.com/building-a-gps-receiver-part-1-hearing-whispers/</guid>
      <description>Have you ever noticed that your Maps app still works during a flight? It can feel illicit, like someone just forgot to turn off the signal, and that watching yourself crawl along the earth should be done without drawing undue attention. A few months ago I learned that there were only around 30 GPS satellites serving the entire planet. This piqued my interest, because it reminded me of the 13 root DNS servers from which all resolution flows. Perhaps GPS has a similar design in which the &amp;lsquo;source of truth&amp;rsquo; is diluted by several layers of signal repeaters? I navigated to gps.gov, and was presented with this delightful image. I became even more excited to learn about what these satellites do!</description>
    </item>
    <item>
      <title>An IRC client in your motherboard</title>
      <link>https://axleos.com/an-irc-client-in-your-motherboard/</link>
      <pubDate>Fri, 05 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/an-irc-client-in-your-motherboard/</guid>
      <description>I made a graphical IRC client that runs in UEFI. It&amp;rsquo;s written in Rust and leverages the GUI toolkit and TrueType renderer that I wrote for axle&amp;rsquo;s userspace. I was able to develop it thanks to the &lt;code&gt;vmnet&lt;/code&gt; network backend that I implemented for QEMU. You can connect to an IRC server, chat and read messages, all from the comfort of your motherboard&amp;rsquo;s pre-boot environment. &amp;ldquo;Why&amp;rdquo;? What kind of question is &amp;ldquo;why&amp;rdquo;?</description>
    </item>
    <item>
      <title>Simulating Slices of iOS Apps</title>
      <link>https://axleos.com/simulating-slices-of-ios-apps/</link>
      <pubDate>Mon, 15 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/simulating-slices-of-ios-apps/</guid>
      <description>In 2019, I built a work-for-hobby iOS simulator on a strict regimen of weekends and coffee. While the full details of this project will stay in-house, there&amp;rsquo;s enough I can share to hopefully be interesting! First up, here&amp;rsquo;s what this looks like running against a simple demo app. On the right is the bona-fide iOS simulator from Xcode, and on the left is the simulator I built.</description>
    </item>
    <item>
      <title>Writing a TrueType font renderer</title>
      <link>https://axleos.com/writing-a-truetype-font-renderer/</link>
      <pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/writing-a-truetype-font-renderer/</guid>
      <description>Text is &lt;em&gt;the&lt;/em&gt; medium of digital interaction, and text rendering has an outsized impact on the overall fit and finish of any system. It therefore pains me that axle has for years relied on a low-resolution 8x8 bitmap font. Let&amp;rsquo;s fix it! Take a look at the characters composing this sentence. Note the curves, the negative space, the use of size and distance. If you&amp;rsquo;ve got a magnifying glass handy, you can even see how &amp;lsquo;black-on-white&amp;rsquo; text uses many shades of gray to make the text smoother on the eyes.</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 6: Post-boot Paradise</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-6-post-boot-paradise/</link>
      <pubDate>Mon, 02 Oct 2023 10:45:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-6-post-boot-paradise/</guid>
      <description>We&amp;rsquo;ve managed to flash and boot a modified iOS distribution! We&amp;rsquo;re now in the home-stretch of a user-facing jailbreak. The main thing that end-users typically expect from a jailbreak is that they can open up Cydia and install some runtime modifications that alter the behavior of system processes such as SpringBoard. I wasn&amp;rsquo;t sure exactly how jailbreaks install Cydia, aside from a loose guess that the jailbreak ships a copy of &lt;code&gt;Cydia.app&lt;/code&gt; and copies it to &lt;code&gt;/Applications/&lt;/code&gt;. This is roughly right, but there&amp;rsquo;s more to the story.</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 5: Flashing the Filesystem</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-5-flashing-the-filesystem/</link>
      <pubDate>Mon, 02 Oct 2023 10:44:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-5-flashing-the-filesystem/</guid>
      <description>The &lt;code&gt;Authentication error&lt;/code&gt; string that &lt;code&gt;asr&lt;/code&gt; would usually print out after it decides to reject the filesystem is interesting, though. Maybe we can poke further at that to try to find an approachable patch-point? Huh, zero hits! That&amp;rsquo;s curious, because &lt;code&gt;asr&lt;/code&gt; is definitely printing this out&amp;hellip; Let&amp;rsquo;s search the whole ramdisk for this string. Ah! This is coming from &lt;code&gt;/usr/lib/libSystem.B.dylib&lt;/code&gt;, which is dynamically loaded and used by &lt;code&gt;asr&lt;/code&gt;. It seems odd that anything to do with verifying a filesystem image would live here, though&amp;hellip; Let&amp;rsquo;s take a closer look.</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 4: Investigating the Ramdisk</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-4-investigating-the-ramdisk/</link>
      <pubDate>Mon, 02 Oct 2023 10:43:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-4-investigating-the-ramdisk/</guid>
      <description>Eventually, I managed to glean the structure of what happens next: The Restore ramdisk contains a traditional, but heavily trimmed down, OS distribution. It has all the fun directories, like &lt;code&gt;/usr/sbin/&lt;/code&gt; and &lt;code&gt;/System/Library/PrivateFrameworks/&lt;/code&gt;. It also ships with some standard UNIX utilities, such as &lt;code&gt;/bin/cat&lt;/code&gt;. The kernel loads and executes &lt;code&gt;/etc/rc.boot&lt;/code&gt; from the ramdisk to drive the next piece of work. Remarkably, this is &lt;em&gt;not a text file&lt;/em&gt;!</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 3: Patching the Boot Chain</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-3-patching-the-boot-chain/</link>
      <pubDate>Mon, 02 Oct 2023 10:42:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-3-patching-the-boot-chain/</guid>
      <description>One thing that I initially found quite surprising about this whole process is that, with this approach of breaking each successive stage&amp;rsquo;s image validation and uploading patched images, the system we&amp;rsquo;re booting is arguably no longer iOS. It&amp;rsquo;s a custom OS distribution that&amp;rsquo;s &lt;em&gt;very similar&lt;/em&gt; to iOS, but is based on custom firmware images that are essentially authored by the jailbreak developer when they apply their patches. To my sensibilities, this makes this approach to jailbreaking less of a &amp;ldquo;pure&amp;rdquo; jailbreak than exploiting and modifying a running system post-hoc, once it&amp;rsquo;s already booted.</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 2: Bypassing the Boot Chain</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-2-bypassing-the-boot-chain/</link>
      <pubDate>Mon, 02 Oct 2023 10:41:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-2-bypassing-the-boot-chain/</guid>
      <description>Now that we&amp;rsquo;ve gained confident control of the SecureROM environment, let&amp;rsquo;s move on to something more ambitious: booting iOS. Of course, running unsigned code in DFU mode, then handing the reigns back to a secure boot chain kind of defeats the purpose of running unsigned code in the first place. What would be great is if we could boot iOS, but in a special way that disables all the security mechanisms present &lt;em&gt;after&lt;/em&gt; the SecureROM. This &lt;em&gt;is&lt;/em&gt; jailbreaking! Recall our chain of trust from earlier:</description>
    </item>
    <item>
      <title>Exploiting the iPhone 4, Part 1: Gaining Entry</title>
      <link>https://axleos.com/exploiting-the-iphone-4-part-1-gaining-entry/</link>
      <pubDate>Mon, 02 Oct 2023 10:40:00 +0100</pubDate>
      <guid>https://axleos.com/exploiting-the-iphone-4-part-1-gaining-entry/</guid>
      <description>Years ago, I was active in the iOS tweak development scene. I made many products and tools, distributed on Cydia, that modified iOS system behavior and added new functionality to SpringBoard. This was a really fun time, and gave me valuable early career exposure to reverse engineering closed-source binaries, interacting directly with the Objective-C runtime, and entrepreneurship. I&amp;rsquo;m really grateful for those years. One aspect of the jailbreak scene that always seemed like black magic to me, though, was the process of jailbreaking itself.</description>
    </item>
    <item>
      <title>Making a newsletter backend</title>
      <link>https://axleos.com/making-a-newsletter-backend/</link>
      <pubDate>Sat, 26 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/making-a-newsletter-backend/</guid>
      <description>I&amp;rsquo;m currently working on a huge project. Since I&amp;rsquo;d like to finish it soon, I&amp;rsquo;m instead going to spend an evening implementing a bespoke newsletter service.&#xA;A couple of months ago, I added a prominent RSS button to the overview of this blog, acquiescing to the venture capital overlords that line my pockets on the promise of a dedicated audience willing to trudge through inane jokes like this one.&#xA;Don&amp;rsquo;t see it?</description>
    </item>
    <item>
      <title>Writing about writing about programming</title>
      <link>https://axleos.com/writing-about-writing-about-programming/</link>
      <pubDate>Mon, 26 Jun 2023 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/writing-about-writing-about-programming/</guid>
      <description>When I&amp;rsquo;m being first-order productive, I&amp;rsquo;m programming: creating and interacting with a system.&#xA;This first-order productivity is great, but it isn&amp;rsquo;t discoverable for others: there&amp;rsquo;s generally a high bar to entry for comprehending another person&amp;rsquo;s work when it&amp;rsquo;s expressed solely as a structured program.&#xA;Second-order productivity is when I&amp;rsquo;m writing about programming, or about systems. This kind of productivity is generally more accessible and distributable, and forms most of the content of this blog!</description>
    </item>
    <item>
      <title>Screwing up my page tables</title>
      <link>https://axleos.com/screwing-up-my-page-tables/</link>
      <pubDate>Mon, 12 Jun 2023 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/screwing-up-my-page-tables/</guid>
      <description>Recently, the epic yak shave that is my life dragged me down into oblong pits of page table corruption. I&amp;rsquo;ve made it out the other side, with a primary takeaway of &amp;ldquo;how the hell did this ever work?&amp;rdquo;, followed closely by &amp;ldquo;what the hell is still hiding?&amp;rdquo;. Picture this: you&amp;rsquo;re carefree, healthy, &amp;ldquo;hey, I should rewrite axle&amp;rsquo;s network stack in Rust!&amp;rdquo;. Sinister snap of the violin. Sad oboe, crying clown. OK, this can&amp;rsquo;t be too bad. Let&amp;rsquo;s start with the basics: we&amp;rsquo;ll fire up the network card driver to jog our memory about where we left things off.</description>
    </item>
    <item>
      <title>Pastel chips of content</title>
      <link>https://axleos.com/pastel-chips-of-content/</link>
      <pubDate>Sun, 04 Jun 2023 20:14:28 +0100</pubDate>
      <guid>https://axleos.com/pastel-chips-of-content/</guid>
      <description>I had a hankering to tweak this blog&amp;rsquo;s presentation a bit. Here&amp;rsquo;s what it looked like this morning:&#xA;Bleugh! Straightforward content? Simple design? Restraint? Thanks, but no. It&amp;rsquo;s like this guy&amp;rsquo;s never heard of responsive web pages.&#xA;First, let&amp;rsquo;s make each of those posts pop a little bit more.&#xA;Yeah, yeah! Subtle, I like it. Tiny thing, it needs more color.&#xA;Now we&amp;rsquo;re talking.&#xA;I manually picked out some pastels and selected one randomly for each blog post chip.</description>
    </item>
    <item>
      <title>Rearranging the computer</title>
      <link>https://axleos.com/rearranging-the-computer/</link>
      <pubDate>Fri, 02 Jun 2023 08:46:27 +0100</pubDate>
      <guid>https://axleos.com/rearranging-the-computer/</guid>
      <description>Programming the computer allows you to take something you see and rearrange the pieces a bit to better fit your needs. It&amp;rsquo;s really a delightful and powerful thing.&#xA;A few weeks ago, Daisy and I were staying in a cottage with poor internet speeds. We were trying to stream a series of videos, but the embedded player would only get through a few seconds of playback before it choked for several minutes on the next chunk.</description>
    </item>
    <item>
      <title>Supporting multiple architectures</title>
      <link>https://axleos.com/supporting-multiple-architectures/</link>
      <pubDate>Thu, 01 Jun 2023 00:43:22 +0100</pubDate>
      <guid>https://axleos.com/supporting-multiple-architectures/</guid>
      <description>axle used to be a 32-bit-only OS. In late 2021, I had a hankering to fix this longstanding limitation, and plunge into a world that expanded not just our address spaces, but our hope. Roughly, if you want to add support for x86_64 to an existing x86 OS, you&amp;rsquo;ll need to update these components: Global descriptor table, interrupt descriptor table, interrupt handlers, hand-coded assembly routines, multitasking, paging and virtual memory manager, linker scripts, ELF loader, ported software, disable the red zone, &amp;hellip;</description>
    </item>
    <item>
      <title>axle&#39;s red rectangle of doom</title>
      <link>https://axleos.com/axles-red-rectangle-of-doom/</link>
      <pubDate>Wed, 31 May 2023 22:38:08 +0100</pubDate>
      <guid>https://axleos.com/axles-red-rectangle-of-doom/</guid>
      <description>Over the course of developing an operating system, things are going to crash, and they&amp;rsquo;re going to crash a lot. One way to make crashes slightly less annoying is to isolate them: the rest of the system continues running, and you can poke around further after an unexpected condition arises in one process. Perhaps surprisingly, it took me several years before this became feasible! Previously, when any code path, in any process, encountered an error condition (such as a page fault, or an explicit &lt;code&gt;assert()&lt;/code&gt;), the kernel would spew some debug information over the serial port, then lock up to prevent further shenanigans. This is pretty overzealous and often unnecessary.</description>
    </item>
    <item>
      <title>Adding `vmnet` support to QEMU</title>
      <link>https://axleos.com/adding-vmnet-support-to-qemu/</link>
      <pubDate>Sat, 13 May 2023 10:59:04 +0100</pubDate>
      <guid>https://axleos.com/adding-vmnet-support-to-qemu/</guid>
      <description>Every hobby operating system developer dreams of the day that a stack wrought from their own blood, sweat, and keystrokes renders its first webpage. Back in early 2021, I decided to break ground on the first step towards this goal. Before we can connect to the web, we need to handle all the necessary protocols to exchange packets over both the web and our humble local network link. This includes implementing protocols such as TCP, DNS, and ARP. But before we even &lt;em&gt;think&lt;/em&gt; about talking in protocols, we need the bare-bones: some way to send packets out, and get packets in.</description>
    </item>
    <item>
      <title>Running axle on multiple CPUs</title>
      <link>https://axleos.com/running-axle-on-multiple-cpus/</link>
      <pubDate>Sun, 26 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/running-axle-on-multiple-cpus/</guid>
      <description>In the beginning, Intel created the 8086. This has been widely regarded as a bad move, but boy is it popular. The enduring success of the 8086 has been bought on the blood altar of Compatibility: software written for the original 8086, even very low-level software that runs without any supporting OS infrastructure, must continue to function on every new x86-line CPU manufactured today. This selling point enforces some pretty annoying constraints on both the advancement of the x86 line and on developers who need to interface directly with x86 CPUs.</description>
    </item>
    <item>
      <title>Syscalls, what gives?</title>
      <link>https://axleos.com/syscalls-what-gives/</link>
      <pubDate>Fri, 26 Aug 2022 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/syscalls-what-gives/</guid>
      <description>Syscalls are a fundamental piece of the processes model within contemporary operating systems.&#xA;OS&amp;rsquo;s generally like to provide the abstraction that a given program is running on the CPU, linearly and largely in an uninterrupted fashion, from start to finish.&#xA;Of course, this isn&amp;rsquo;t the case; programs are interrupted all the time, for a variety of reasons. Some examples of times the kernel needs to step in:&#xA;The kernel needs to handle an event from a peripheral device The program has page-faulted and needs the kernel&amp;rsquo;s VMM to make everyone play nice The program has been preempted to give other programs the chance to use the CPU for a few milliseconds The underlying reality of what the CPU spends its time on is a complex juggling act of contexts scheduling in and out.</description>
    </item>
    <item>
      <title>Gaming games</title>
      <link>https://axleos.com/gaming-games/</link>
      <pubDate>Fri, 19 Aug 2022 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/gaming-games/</guid>
      <description>Chess.com is a great online chess server and content creator. One of their hallmark features is their chess puzzles:&#xA;Present the player with a position&#xA;The player needs to find the &amp;rsquo;tactic&amp;rsquo;: the best sequence of moves, typically resulting in an advantage over the opponent&#xA;The quicker the player completes a puzzle, the more points they earn&#xA;They look like this:&#xA;Puzzles are nice because they help players train their pattern recognition and develop their intuition for chess.</description>
    </item>
    <item>
      <title>Footsteps of pi</title>
      <link>https://axleos.com/footsteps-of-pi/</link>
      <pubDate>Sun, 03 Apr 2022 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/footsteps-of-pi/</guid>
      <description>Imagine you have a compass.&#xA;Instead of the 4 cardinal directions, mark the compass with 10 evenly-divided indications.&#xA;Let&amp;rsquo;s play a game together. You&amp;rsquo;re standing on a plane, and in front of you is a ball.&#xA;I&amp;rsquo;m going to tell you a number. Push the ball with enough force to impart a 1 meter-per-second change in velocity in the direction matching the number&amp;rsquo;s annotation on your compass.&#xA;For example, if I gave you the number 7:</description>
    </item>
    <item>
      <title>Writing axle&#39;s GameBoy emulator</title>
      <link>https://axleos.com/writing-axles-gameboy-emulator/</link>
      <pubDate>Sun, 20 Feb 2022 00:00:00 +0000</pubDate>
      <guid>https://axleos.com/writing-axles-gameboy-emulator/</guid>
      <description>The Nintendo GameBoy is an exceptionally well-documented system, perfect for anybody who’d like to take a crack at emulation. Publicly-maintained resources like the Pan Docs make it both approachable and convenient to get an overview of the GameBoy’s address space layout, to understand the mechanics of hardware peripherals, and to learn about various edge-case behaviors that some games depend on. Over the past three weeks, I’ve been writing a GameBoy emulator my very own. This is not a unique project! I was inspired by the blog post of another adventurer doing the same thing.</description>
    </item>
  </channel>
</rss>
