ARM64 Hardware Using Linux May Handle Switch Games

Linux is a family of open-source operating systems. These are based on the Linux Kernel, an operating system kernel by Linus Torvalds, first released on the 17th of September, 1991. It is typically packaged in Linux distribution.

The distributions support an array of libraries and system software, many of which are provided by the GNU Project. Although many Linux distributors use Linux as their name, only Free Software Foundation uses GNU/Linux to focus on GNU software’s significance, which has caused controversy.

Regardless of its complexity, it is one of the widely-used and misunderstood operating systems. Linux supports a diverse range of computer architectures. One of which will be discussed here, as it enables Linux to run Nintendo Games. That may be simplifying it too much; allow us to explain.

Advanced RISC Machines(ARM) is a family of instruction set architectures for computer processors. Due to the lower power consumption, low cost, and minimal heat generation in comparison to the competitors, ARM processors are considered desirable for battery-powered devices, like laptops, tablet computers, smartphones, and similar systems.

Horizon Linux

A person by the name of nocsi shared his discovery on a forum. He modified ARM Linux to run Switch games, and while that may sound simple, his journey is very technical.

Over the past while, I’ve worked on and off in my free time patching the arm64 Linux kernel to run Nintendo Switch games natively, i.e., by taking many of the Switch’s “Horizon” OS system calls and implementing their behavior using Linux’s existing facilities for memory management, scheduling, synchronization, etc. – Nocsi

Nocsi wanted to run some of the Switch games on his MacBook, and since the same arm64 architecture powers them, it should be possible. However, the task is tedious. He first tried “ptrace” to run user-space by attaching to the processes that run Switch games’ code; it would trap the system calls to a tracer process.

However, that became impossible without OS support due to the Switch program’s system use. He then tried to do it all within the kernel and virtualize the required OS under macOS, making it possible.

He found something positive by patching arm64. Since it allowed Linux’s hardware drivers to support for free, it could virtualize Apple silicon Macs and run bare minimum on any arm64 hardware. Of course, they have to be supported by Linux, and then even if the hardware is on the lower end, you can be very flexible with running Switch games, provided that there is no need to emulate the CPU.

Although that is for the future, it is still great news, and nocsi’s achievement shows that possibility.

Note that this is not an attempt to accurately recreate the Horizon OS, nor is it particularly intended to run on an actual Switch, as (I believe) is the case is for the Mesosphere project (though you probably could, I’m aware that the Switch can run Android at least). Instead, Horizon Linux is my attempt to enable Switch games to run on any arm64 hardware. – Nocsi

Further Tweaks

OS support can now handle Horizon system calls, but the Switch program also has to communicate with several system services to take input, audio, graphics, and so on. His genius idea was to gut the essential things from the yuzu emulator and integrate that here. It solves most of the problems on that side.

In addition, he added some originality to the program by having each system run persistently on its own(although that added more work for him).

The custom Linux kernel is called “Horizon Linux,” and the yuzu hack-job is called “Mizu.” Mizu is intended to run as a systemd service under Horizon Linux. – Nocsi

His work on the “Mizu” and “Horizon Linux” can be found on GitHub. The project is still in the works, meaning that for now, it can run Puyo Puyo Tetris, but in the future, with more work, there may be other games we can play on Linux.

 

Although the gameplay may look glitchy, it is not a bug as it requires running the OpenGL 4.6.

Unfortunately, I did not know anything about graphics when I set out to complete this project, and figured that I should be good to go given the vague notion that Parallels (and QEMU, if I recall) already supported GPU acceleration. It wasn’t until many, many hours into the project, when I was ready to test graphical Switch homebrew demos, that I realized yuzu’s GPU emulation (which I’m stealing) requires OpenGL 4.6, and that exposing such a modern graphics API to virtual machines on macOS is no trivial matter.

Even the macOS host only supports up to OpenGL 4.1. Very recently we got OpenGL 4.3 on the latest tech preview of VMware Fusion, which offers some hope—but it still isn’t good enough, as you can tell from the above demo. – Nocsi

At that stage, the game is still not playable. It is slow because the CPU is handling all the rendering, and GPU is taking no part. However, to test GPU acceleration, he bought a Jetson Nano dev kit(probably the cheapest arm64 hardware), which fully supports OpenGL 4.6.

While that improved the performance, it runs natively on the CPU. It can theoretically run with any arm64 hardware. Now for anyone who is tech-savvy, you know how big of a commercial game milestone this is. It will be fascinating if this works as intended and can run other games.

That does seem ways in the future, though, as we need more arm64 devices to be available cheap, along with some big beefy GPUs.

TL;DR

ARM Linux was modified to run some switch games; so far, it can run Puyo Puyo Tetris with only minor performance declines. Nocsi will continue this project on and off, and more updates will come as there are modifications to the system.

What are your thoughts on this whole project? Do you think it can be revolutionizing for Linux since this may be the first time we have seen Linux running Nintendo Games? Let us know below, and we will get back to you!

Here is a Similar Read: WB. No Longer Licensing Mortal Kombat Merchandise.