You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/2021/08/14-progress-report.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Instead, a much safer approach that has been used by projects such as [Nouveau](
25
25
This is very different from a typical virtual machine, which is designed to run a guest OS on top of a host OS, with a full set of virtualized hardware. Our hypervisor, which is built on our [m1n1](https://asahilinux.org/2021/03/progress-report-january-february-2021/#playing-with-hardware) bootloader and hardware experimentation tool, is a completely bespoke implementation. It is designed to mostly stay out of the way of the guest OS, running it in an environment as close to bare metal as possible, while just transparently intercepting and logging hardware accesses. Thus, macOS "sees" the real M1 hardware, and interacts with it as normal - complete with a full accelerated desktop.
26
26
27
27
{{< captioned caption="This tweet was posted from Safari on macOS, running on the hypervisor" >}}
Since the hypervisor is built on m1n1, it works together with Python code running on a separate host machine. Effectively, the Python host can "puppeteer" the M1 and its guest OS remotely. The hypervisor itself is partially written in Python! This allows us to have a very fast test cycle, and we can even update parts of the hypervisor itself live during guest execution, without a reboot.
Copy file name to clipboardExpand all lines: content/blog/2021/10/06-progress-report.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Once we have a stable kernel foundation, we will start publishing an "official"
67
67
As part of reverse engineering the CPU frequency hardware, I found myself needing to run macOS under the m1n1 hypervisor with full SMP support... so I made it happen! The hypervisor can now expose all 8 CPU cores to the guest, and virtualizes the CPU startup hardware. This is not only important for reverse engineering SMP-related features, it also means it now boots almost as fast as on bare metal!
68
68
69
69
{{< captioned caption="The hypervisor, now with 8 times the cores" >}}
This also makes it even more practical to use for testing Linux; there is very little reason not to run under the hypervisor during most kernel development now. This makes things much easier for anyone without a serial debug cable, as the hypervisor provides a virtual UART over USB, as well as interactive debugging features.
Good news! A couple months ago, [Asahi Lina](https://twitter.com/LinaAsahi) joined our team and took on the challenge of reverse engineering the M1 GPU hardware interface and writing a driver for it. In this short time, she has already built a prototype driver good enough to run real graphics applications and benchmarks, building on top of the existing Mesa work. The proof of concept uses m1n1 via a USB connection and runs the driver remotely, so it is bottlenecked by USB bandwidth, but she has also demonstrated that the GPU proper renders the GLMark2 phong shaded bunny scene at over 1000FPS, at 1080p resolution. This fully open source stack passes [94%](https://twitter.com/LinaAsahi/status/1546301886147731457) of the dEQP-GLES2 test suite. Not bad!
Copy file name to clipboardExpand all lines: content/blog/2022/11/29-gpu-story.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Since getting all these structures right is critical for the GPU to work and the
68
68
69
69
At first most of the driver was really just [a bunch of hardcoded structures](https://github.com/AsahiLinux/m1n1/blob/main/proxyclient/experiments/agx_1tri.py), but eventually I managed to get them right and render a triangle!
This was just a hacked up together demo, though... before starting on the Linux kernel driver, I wanted to make sure I really understood everything well enough to design the driver properly. Just rendering one frame is easy enough, but I wanted to be able to render multiple frames, and also test things like concurrency and preemption. So I really needed a true "kernel driver"... but that's impossible to do in Python, right?!
74
74
@@ -78,7 +78,7 @@ Could I run [Inochi2D](https://inochi2d.com/) on top of Mesa, with Alyssa's Mesa
Just a few days later, I could run a full GNOME desktop session!
118
118
@@ -126,7 +126,7 @@ Of course, there are always unsafe sections of code, but since Rust makes you th
126
126
127
127
Oh, and there's also error and cleanup handling! All the error-prone `goto cleanup` style error handling to clean up resources in C just... vanishes with Rust. Even just that is worth it on its own. Plus you get real iterators and reference counting is automatic! ❤
0 commit comments