跳到正文
认知
返回认知精选
认知精选科技大约 15 小时前1
单一来源当前只有一个可用来源,尚未完成多源交叉核验

Darling:Steam、WebKit与迈向Mac OS 9

We've made some very nice progress since the last post. Steam now runs under Darling, and so do VLC, Cuphead and Age of Empires II. Our support for Carbon-era applications is growing quickly, Darling has gained its own Finder and System Preferences, and the build now includes Apple's WebKit. At the end, I'll share where we're heading next, including PowerPC and Mac OS 9-era applications.

Steam​

The headline of this update: Steam runs under Darling, both on x86-64 and on ARM64.

This is a bigger deal than it might seem. Most of the Steam client's user interface is built on CEF (the Chromium Embedded Framework), which is essentially a full web browser embedded into an application. Running it requires a lot from the system underneath: multiple processes talking to each other, GPU-accelerated rendering, shared memory and a large share of the macOS APIs. Getting CEF to run means that Darling is now strong enough for a whole class of applications built on top of it.

CEF also works on Wayland. Fun fact: Wine added support for CEF on Wayland during the same week as we did.

If you look closely, Steam is warning us that "your current macOS version is unable to run 32-bit games". Nice try, Steam, but you don't know which "macOS" you're talking to. As we showed in our last post, this one can.

That being said, it's not all smooth sailing yet. We have seen reports that things don't work as well on some hardware. That's not too surprising, because Steam touches some of the trickiest areas of the graphics stack, such as combining OpenGL with Vulkan (which is how we emulate Metal) and sharing buffers between them via DMA-BUF. These are exactly the areas where differences between GPU drivers show up.

Performance is not top notch either. CEF makes a lot of Mach API calls, and that hits one of our weak spots. In Darling, Mach APIs are emulated by darlingserver, a user-space process: every Mach call turns into a round trip to another process instead of a direct call into the kernel, as it would be on macOS. If you know Wine, this is the same structural cost that wineserver has, and it's just as painful for applications that make many such calls.

We're working on it, though. Just as this post was being written, we landed a multithreaded darlingserver, which should help with exactly this kind of workload. We also landed scrolling speed improvements in Cocotron, the basis of our AppKit implementation, which now uses the GPU together with NEON or AVX instructions to make scrolling smoother in applications like Notes.

VLC for macOS now runs under Darling as well. It works under Wayland too, which is a little funny, because as far as we know, the current stable release of VLC for Linux doesn't support Wayland natively. So in a way, running the macOS build through Darling gets you there sooner. Of course, a native Wayland build of VLC would still be the better option, because Darling's performance still isn't top notch.

See the VLC entry in our AppDB for details.

More Games​

Cuphead now runs, including support for game controllers.

Age of Empires II has also become playable. This would not have been possible without MSLC, our new Metal shader compiler, which was critical to getting the game to work. MSLC is already very close to matching Apple's own Metal shader compiler.

I've also heard that Roblox runs on Darling, but I haven't verified that claim personally. If you've tried it, please submit a report to the AppDB and let us know.

Carbon​

Before Cocoa took over, there was Carbon: the API Apple created to ease the transition of classic Mac OS applications to Mac OS X. Plenty of software from that era, especially games, was written against it, and Apple dropped it entirely together with 32-bit support. We are now fast expanding our support for Carbon-era APIs.

A good example is Redline, a racing game that relies very extensively on Carbon. It now runs in Darling.

We can also run some of Apple's Carbon example applications, such as CarbonSketch. Sample code like this is a great test: it exercises the APIs the way Apple intended them to be used, so it helps us check our implementation against the documented behavior, not only against the quirks of individual games.

Work like this would be much harder without access to the software itself. We are eternally thankful for the existence of Macintosh Repository, which is a fantastic source of older Mac software.

Finder and System Preferences​

In the last post, I mentioned that we had started working on our own Finder app. It is now part of Darling. Its main purpose is to make it easy to get applications out of DMG disk images: mount the image and copy the application into the Darling prefix, all without touching the command line. It's not perfect yet, but we're getting there!

We have also added our own System Preferences app. This is the configuration utility I wanted to have back in our Q4 update. It lets you configure Darling through panes such as Keyboard, Display, Sound, Graphics and Metal. The Sound pane, for example, lists the audio devices from your sound server, lets you play a test tone on each output and shows the input level of your microphone.

Newer Software Too​

We're not focusing on old software only, though. Our contributors are also expanding support for newer applications, for example DEVONthink.

Using the macOS Library Cache​

One of our contributors spent two weeks on a proof of concept that runs macOS applications, such as Notes, using the macOS library cache. It also provides the building blocks needed to run Catalyst applications, which are iPad applications brought over to the Mac.

What makes this approach interesting is how the library cache works: it lets us draw the line between Darling's own libraries and macOS libraries wherever we want. Some libraries can come from Darling, and others straight from macOS, with data structures passed back and forth between the two. This lets Darling become much more of a drop-in replacement for macOS from an application's point of view.

SwiftUI and Xcode​

The GoPro application recently brought us SwiftUI, based on OpenSwiftUI, along with a myriad of smaller frameworks.

All of this came together with Xcode, Apple's own development environment and one of the most demanding applications on the platform. Thanks to the library cache, SwiftUI and all the other symbols we have been adding all over the place, it took less than 24 hours to get Xcode 26.3 to start up and show its welcome window. It's still early, but it shows how much ground is already covered: each new application that runs brings more of the system along with it, so getting the next ones to work should become increasingly easy.

A note on this screenshot: it was taken on ARM64 Linux, and Xcode was using native Apple libraries from the library cache described above. We're working on removing the need for these, so that Xcode can run on Darling's own implementations.

WebKit​

Darling's build now includes Apple's WebKit. This is the engine behind Safari and behind every web view in a macOS application, so a lot of software depends on it, often in places you wouldn't expect.

The page below was rendered with our WebKit build:

Our WebKit even supports WebGL. On macOS, WebKit doesn't implement WebGL directly on top of the GPU: it goes through ANGLE, a layer that translates WebGL's OpenGL ES calls into the platform's native graphics API. Supporting WebGL therefore means that ANGLE runs in Darling too, which is another good workout for our graphics stack.

There is a catch, though. WebKit is huge, and it extends the full Darling build by many hours. That is a problem for GitHub's free CI, where a job is limited to 6 hours. We'll have to think out of the box to make it work, so don't be surprised that our CI is broken right now. We're already working on making the CI build faster.

What's Next​

Running Applications Across Architectures​

Running x86 applications on ARM64 already works experim

Evidence

来源与证据

单一来源 · 1 个信源

当前仅有一个可用来源,尚未完成多源交叉核验。

发布时间
内容处理
AI 翻译 / 摘要,需结合原文核对
内容有误或来源失效?告诉我们

每天早上收到这 5 条

免注册,填邮箱即可;每封邮件都能一键退订。

提交即表示同意按隐私说明保存你的邮箱,只用于发送简报。

或用 RSS 订阅

AI 翻译、摘要和解读仅用于辅助判断;涉及重要决策时,请回到上方来源核实。