An open-source implementation of some of Boot Camp's keyboard services in C#.
- This program was developed by using clean-room reverse-engineering techniques, including decompiling Boot Camp services.
- This program, repository and its authors are not affiliated with Apple Inc. in any way, shape, or form.
OpenBootCamp currently implements the following features of Boot Camp Manager:
- Fn behaviour switching: Switch whether the default Fn behaviour should be the standard Fn keys, or the special function printed on each key.
- Special Fn key handling: This includes keys like the display and keyboard brightness keys.
Additionally, the following bugs from the official Boot Camp Manager are fixed:
- Keyboard backlight state is not remembered across reboots
- Special Fn keys do not work before login (Apple's Boot Camp Manager doesn't run until a user logs in)
along with introducing a whole lot of other bugs/missing features, but still...
- Install instructions
- Eject DVD drive on pressing the Eject button on the keyboard
- Volume control on Windows 7
- An overlay when adjusting keyboard backlight, screen brightness, and volume (when not already handled by Windows)
- Ability to install Apple drivers (
KeyAgent.sys
,MacHALDriver.sys
, etc.) automatically rather than having to install Boot Camp Services to get them - A config application. Learn to edit XML for now.
- A few power saving features:
- Turn off keyboard backlight when closing laptop lid (something which I would've thought would be done in hardware/drivers, but here we are)
- Set keyboard backlight state based on power source or battery charge (e.g. low battery, switching between AC and battery power)
- Turn off keyboard backlight when keyboard is inactive
- Smooth keyboard backlight animations
- More that I haven't thought of yet
Only Apple computers that can run Windows are supported (i.e. any Intel Mac). Any non-Apple Windows systems are not supported (even if using a Magic Mouse/Trackpad/Keyboard).
Windows 7 SP1 and later with .NET Framework 4.8 should work without issues.
Windows Vista/XP may work if downgrading to .NET Framework 4.6 (for Vista SP2) or 4.0 (for XP SP3), but are unsupported.
The following drivers are required for OpenBootCamp to work:
- The Apple Keyboard driver (
Keymagic.sys
) for OSX Fn behaviour switching and enabling display brightness shortcuts on Windows 8 and later. KeyAgent.sys
for enabling other special Fn keys and for brightness/volume keys on Windows 7 and lower.MacHALDriver.sys
for keyboard backlight support.
Development builds are available through GitHub Actions.
Alternatively, if you don't have a GitHub account, you can download the latest build from nightly.link.
(You probably want the Release
build, unless you're debugging issues with the program)
Alternatively, you can build the program yourself.
- Install Visual Studio 2022 with the
.NET Desktop Development
workload checked. - Download the code repository, or clone it with
git
. - Extract the downloaded code, if needed.
- Open
OpenBootCamp.sln
in Visual Studio. - Click
Build
>Build Solution
to build everything. - Your output, assuming default build settings, is located in
OpenBootCamp.Service\bin\Debug\net48\
. - ???
- Profit!
- Follow steps 1-3 above to install Visual Studio and download the code.
- Open
Developer Command Prompt for VS 2022
andcd
to your project directory. - Run
msbuild /t:restore
to restore the solution, including NuGet packages. - Run
msbuild OpenBootCamp.sln /p:platform="Any CPU" /p:configuration="Debug"
to build the project, substitutingDebug
withRelease
(orAny CPU
withx86
orx64
) as - Your output should be located in
OpenBootCamp.Service\bin\Debug\net48\
(or similar). - ???
- Profit!
By decompiling Bootcamp.exe
(located at C:\Program Files\Boot Camp
on a Mac running Windows
with Boot Camp installed) with Binary Ninja.
I was going to use ghidra like everyone else, but found Binary Ninja produced more readable code.
I will go more in-depth in another document soon.
Because I was/am unhappy with the Apple-provided Boot Camp services.
Also, reverse-engineering is fun :D (if you know what you're doing, that is)
NOTE: OpenBootCamp does not currently install KeyAgent
and MacHALDriver
for you.
You must install Boot Camp Services in order to use OpenBootCamp for now.
Download the Boot Camp support software for your Mac using Boot Camp Assistant
(or [Brigadier](https://github.com/timsutton/brigadier if you're already on Windows),
then navigate to Drivers\Apple\BootCamp.msi
in 7-Zip. There should be a few .sys files,
but the only ones we care about are KeyAgent.sys
and MacHALDriver.sys
. Copy these
to the Drivers
folder where OpenBootCamp is located.
While you're at it, install the Apple Keyboard drivers if you haven't already
(the installer's called AppleKeyboardInstaller64.exe
, and is in the same folder as BootCamp.msi
).
OpenBootCamp will install the drivers if no other KeyAgent.sys
or MacHALDriver.sys
is installed (coming soon).
If you couldn't find KeyAgent.sys
, but found KeyManager.sys
, your laptop is currently
too new for OpenBootCamp. Come back when someone adds support for these laptops.
I won't be able to do this, as I don't have access to a Mac with this configuration.
Ask nicely in the issues, and I might add your feature if I know how, have time, and I think it'll benefit the project.
Alternatively, create a pull request and add the feature yourself.
No.
No.
🤦♂️
Linux already has support for Apple hardware natively (at least on the laptops I tested it on), so a Linux port would be pointless.
Copyright © 2024 Sparronator9999.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.