FreeBSD on MacBook Pro (15", 2017)

christopherdumas

New Member

Reaction score: 2
Messages: 2

Hi everyone! This will be my first post on the FreeBSD forum (and, in fact, any forum anywhere). I've used Linux (mostly Debian and later Arch Linux) for most of my life on the computer, but for the last two years or so I've been using a Mac. I've become increasingly unhappy with the attitude of Mac OS X, assuming that I don't know what I'm doing and that I only want to write Apple applications or websites. I recently decided to try out FreeBSD, since it seemed to have all that great stability and integrated-ness that Mac OS X has, but with the open-ness and dev-focused design of Linux.
Anyway, I'm trying to install FreeBSD 11.1-RELEASE on my 2017 MacBook Pro (15", the touch bar one). It boots the bootloader screen fine, and the keyboard works perfectly there. However, as soon as I select a boot option (single- or multi-user), my keyboard stops working, not responding to any keypresses. I really want to install it, instead of just using a VM (VirtualBox makes life really hard because of it not really emulating real hardware.)
Any help would be welcome!
 

Wozzeck.Live

Member

Reaction score: 125
Messages: 78

It seems that the question has already been submitted on this forum regarding a quite recent Apple.

And it seems that question has not been solved, even trying to use

sysutils/uhidd but you can try again, this won't hurt, eventually remove it after.

We don't know why in boot menu swap, the access to the keyboard is not available.

First we can expect that your keyboard is an usb driven keyboard and not a PS2 keyboard.
You can check that going in /dev. If you don't find any psm device, this means all your HID peripherals are USB driven

It could be a problem linked to the USB HUB driving the keyboard that is declared to the system later in the boot process.
Eventually I have some vague souvenirs of some USB Hub not available at early startup on some very old machines at the beginning of USB standard.

One should have to connect the keyboard on some specific USB port of the machine to access the BIOS for example.

Try with an external USB keyboard and tell us if you can get the keyboard work.

On some computer, not specifically Apple, we sometime loose the USB keyboard to access BIOS, but keyboard starts well when Windows OS is up. Generally we remove the backup BIOS cell button, we remove battery/electrical power cord and we wait 24H to be sure that motherboard is fully clean of electricity, and generally it comes back.

In some other cases some functions in the BIOS may interfere with USB.
Recently, I understood that if Intel AMT is not configured of badly configured on some HP Desktop Business Machine, it causes such problems... loosing keyboard repeatedly at early boot stage, but working well when OS is up.

Now that I have set up AMT, there seems to be no problem.
Just check in your BIOS if there are some advanced functions that could interfere with USB

EDIT
-----
Also read this thread, for some keyboards adding an usb_quirk can sometimes solve the problem. This thread explains how to test the quirk and how to apply it permanently. But in case of the Apple, I don't think it will change anything, as I think it had been tested. But anyway one should try to setup the quirk at early boot stage, so this require to setup loader.conf, see this thread.


https://forums.freebsd.org/threads/55717/
 
OP
christopherdumas

christopherdumas

New Member

Reaction score: 2
Messages: 2

Thank you. I was actually talking about the internal keyboard, since I only have one USB-C to USB adaptor (which I have to use for the USB boot stick itself). However, I'll try out your advice if I can get my hands on another one.
 

debguy

Active Member

Reaction score: 11
Messages: 139

I'm extremely happy with Apple: excellent support people and service, BSD userland, great multimedia and games*, free X-code iPhone development (pro versions not home versions come with), and GNU compilers too.

I really don't think they are preventing you from doing anything - it's just that they cannot do everything for you. They have a great desktop (much more than most BSD installers ever get). But they have to support all (many models, and their support bends over backwards to keep older apples running), a yet compete new features with Microsoft: and often are left out of getting apps ported to them. They simply don't have time and likely need people to (ie, write a DirectX equivalent that would attract those wishing to sell such games on the App Store).
 

vitaly-zdanevich

New Member


Messages: 1

Any updates on this? So, is it possible to install and use FreeBSD on MacBook Pro 2017 (with touch bar), with internal keyboard and without other big problems?
 

soongrazer

New Member


Messages: 12

It seems that the question has already been submitted on this forum regarding a quite recent Apple.

And it seems that question has not been solved, even trying to use

sysutils/uhidd but you can try again, this won't hurt, eventually remove it after.

We don't know why in boot menu swap, the access to the keyboard is not available.

First we can expect that your keyboard is an usb driven keyboard and not a PS2 keyboard.
You can check that going in /dev. If you don't find any psm device, this means all your HID peripherals are USB driven

It could be a problem linked to the USB HUB driving the keyboard that is declared to the system later in the boot process.
Eventually I have some vague souvenirs of some USB Hub not available at early startup on some very old machines at the beginning of USB standard.

One should have to connect the keyboard on some specific USB port of the machine to access the BIOS for example.

Try with an external USB keyboard and tell us if you can get the keyboard work.

On some computer, not specifically Apple, we sometime loose the USB keyboard to access BIOS, but keyboard starts well when Windows OS is up. Generally we remove the backup BIOS cell button, we remove battery/electrical power cord and we wait 24H to be sure that motherboard is fully clean of electricity, and generally it comes back.

In some other cases some functions in the BIOS may interfere with USB.
Recently, I understood that if Intel AMT is not configured of badly configured on some HP Desktop Business Machine, it causes such problems... loosing keyboard repeatedly at early boot stage, but working well when OS is up.

Now that I have set up AMT, there seems to be no problem.
Just check in your BIOS if there are some advanced functions that could interfere with USB

EDIT
-----
Also read this thread, for some keyboards adding an usb_quirk can sometimes solve the problem. This thread explains how to test the quirk and how to apply it permanently. But in case of the Apple, I don't think it will change anything, as I think it had been tested. But anyway one should try to setup the quirk at early boot stage, so this require to setup loader.conf, see this thread.


https://forums.freebsd.org/threads/55717/
Linux 5.3 added Apple SPI keyboard and trackpad driver
As described here, the new keyboard and trackpad are attached to SPI controller instead of USB. Support for these drivers are added in Linux kernel 5.3. I think some kind of SPI drivers are needed to communicate with the keyboard and the trackpad on MacBook Pro 15-inch, 2017.

I am booting FreeBSD from a USB flash drive too. I think I am using the same model.
Screenshot 2020-06-30 at 19.07.11.png


I hope this will help in some ways.
 

Sevendogsbsd

Daemon

Reaction score: 571
Messages: 1,025

Just my opinion, but why replace a perfectly good OS on a supported laptop? Personally, I would wait until the install was no longer supported, then install FreeBSD. or run FreeBSD in a VM on the laptop; far less hassle. I didn't spend $2k on this MacBook Pro to rip out the factory OS and install something which doesn't exactly work on it, or work at all.
 

neel

Active Member
Developer

Reaction score: 36
Messages: 114

Just my opinion, but why replace a perfectly good OS on a supported laptop? Personally, I would wait until the install was no longer supported, then install FreeBSD. or run FreeBSD in a VM on the laptop; far less hassle. I didn't spend $2k on this MacBook Pro to rip out the factory OS and install something which doesn't exactly work on it, or work at all.

True, especially since there are cheaper PC laptops which work better with non-macOS and have nearly as good hardware, like Dell XPS, HP Spectre, etc. Or you could spend extra and get a ThinkPad instead.

If it was 2010, then sure maybe a MacBook was better. But the PC industry caught up hardware-wise. Linux/BSD on Macs won't return unless "Apple Silicon" is miles better than Intel/AMD and can boot non-macOS on bare metal in which case porting makes sense.

Disclaimer: I work at Microsoft, but not on Windows or Surface.
 

soongrazer

New Member


Messages: 12

In the attachment, I can see the internal keyboard recognised as a keyboard. In the attachment, “2: udi…” is my external keyboard which is working. “39: udi…” is the Apple Magic Keyboard I suppose.

I got this by running hal-device | grep -i -B 5 -A 38 keyboard. But I cannot use it. Running kbdcontrol -i < /dev/ukbd1 shows that it is busy. kbdcontrol -k /dev/ukbd1 either.

The caps lock is not responding on the internal keyboard after booting into multiuser mode or single user mode. It doesn’t toggle the green light when pressed.

Is there any chance to make the keyboard work?
 

Attachments

  • hal-device.txt
    3.7 KB · Views: 30

Sevendogsbsd

Daemon

Reaction score: 571
Messages: 1,025

True, especially since there are cheaper PC laptops which work better with non-macOS and have nearly as good hardware, like Dell XPS, HP Spectre, etc. Or you could spend extra and get a ThinkPad instead.

If it was 2010, then sure maybe a MacBook was better. But the PC industry caught up hardware-wise. Linux/BSD on Macs won't return unless "Apple Silicon" is miles better than Intel/AMD and can boot non-macOS on bare metal in which case porting makes sense.

Disclaimer: I work at Microsoft, but not on Windows or Surface.

Hardware wise, agree: nothing special about Apple hardware, except it is designed specifically to run MacOS. The fingerprint reader and Touch Bar on this MacBook Pro are pretty cool though. I know other laptops have fingerprint readers, and I have only had one, but it did not work nearly as well as this one.
 

kpedersen

Daemon

Reaction score: 1,262
Messages: 2,189

I know other laptops have fingerprint readers, and I have only had one, but it did not work nearly as well as this one.

My X1 carbon even had a touch bar (it was 3rd gen. So a few years before Apple released theirs).

The touch bar had the escape key on it... made working with vi / vim an absolute nightmare with no tactile feedback.

I was actually disappointed by a lot of things in my X1. It felt more like the consumer range from Lenovo rather than a business laptop.
 

Sevendogsbsd

Daemon

Reaction score: 571
Messages: 1,025

Yeah, my draw to Apple is the OS and the ecosystem. Yes, FOSS OS's do some things better and are certainly more configurable, but I got sick and tired of having to deal with different OS's and data integration across all of them. Now I can just focus on whatever tasks/ideas I am working on and the OS becomes secondary and not my primary focus.

My little HP Elitebook(?) 840 was awesome: m.2 and an SSD, bunch of USB ports, fingerprint reader (never got it to work though), 16GB ram and an I5 (I think). I gave it to one of my kids after I got my MacBook though - I had no need for it any longer.
 
Top