pipcet / pearl

GNU/Linux on Apple M1 hardware
GNU General Public License v3.0
35 stars 6 forks source link

4K support for the mini #12

Closed pipcet closed 2 years ago

pipcet commented 3 years ago

I now have access to a mini. It works, but only in Full HD mode. So I got distracted trying to make it have a 4K frame buffer, and I'm now at the point where the hardware hacks to do that are all there and only need to be put together.

Johnnie390 commented 3 years ago

Good news Pipcet. I am looking forward to testing the macho file.

Regards,

Ry

cristim commented 3 years ago

How does one run this macho file? I'm also interested to give it a try

pipcet commented 3 years ago

How does one run this macho file? I'm also interested to give it a try

https://github.com/AsahiLinux/docs/wiki/Developer-Quickstart has some instructions. The basic process is:

<turn off device>
<push and hold the power button until a menu appears>
<select "Options">
<select Utilities->Terminal>
curl url/to/file.macho > file.macho
bputil -nkcas
csrutil disable
kmutil configure-boot -c file.macho -C -v /Volumes/Macintosh\ HD

Follow instructions after each step. This will replace the macos kernel with the pearl macho. To restore to macos, do:

<turn off device>
<push and hold power button>
<select "Options">
<select Utilities->Terminal>
bputil -n

Let me know how it goes for you, I'll try to be of assistance if anything goes wrong :-)

Johnnie390 commented 3 years ago

Hello all,

all that is missing now is the appropriate ".macho" file.

@pip - will the .macho file also come with a Debian (root) file system??

Regards,

Ry

pipcet commented 3 years ago

@Johnnie390 Thanks for reminding me. The one I'm building right now includes USB keyboard support (which is different on the mini than on the macbook, unfortunately), but does not yet include a debian root fs. However, it's possible an external root fs on a USB drive would work. Alternatively, you can create a FAT filesystem partition on the internal nvme and loop-mount a root fs from there.

My suggestion would be to verify the keyboard works, first. Once that works, getting a root fs on there should at least be possible. I'm sorry this is taking longer, but I really needed to know that we have everything to get 4k@60hz on the mini as I consider the standard resolution unusable for anything but early booting...

Johnnie390 commented 3 years ago

@pip thanks for the information.

Ry

pipcet commented 3 years ago

@Johnnie390 By the way, are you using wired ethernet or WiFi? Just wondering which one to fix first...

pipcet commented 3 years ago

Okay, assuming you're on wired ethernet, https://github.com/pipcet/pearl/discussions/13 is for you. The instructions are still quite rough and somewhat more complicated than they need to be, and I'll try to work on that as time permits.

Johnnie390 commented 3 years ago

Good morning Pip, I use both interfaces, but prefer ethernet. What is the "debian.cpio.zst" file?

Regards,

Ry

pipcet commented 3 years ago

It's a Debian "debootstrap" root file system, as a cpio archive, that is created as part of the pearl build process, then compressed with zstd. The idea is that this image is included with pearl.macho to create the Debian-booting .macho, but that's currently broken.

pipcet commented 3 years ago

(It's available from the linked release page, which is the manual release, not the automatic one).

Johnnie390 commented 3 years ago

Initial comment, very busy. USB support (for me) only works via the Thunderbolt port not the standard US 3.0 port. In other words, a USB/Thunderbolt adapter/dongle is required.

Will report back.

pipcet commented 3 years ago

@Johnnie390 Oh, sorry, I thought when you said:

My M1 Mini model (A2348) does not have USB Type-A ports.

you meant that there were no standard USB 3.0 ports. I probably misspoke :-)

It is correct that the standard USB ports, unlike the Type-C ones, need extra work to get going, but I can report that they do work, because that's how my mouse is connected and that works.

I'm still working on bugs and hopefully some scripts to make things easier for people wanting to test. So far, these significant bugs have appeared:

  1. The resolution thing: I'm testing code right now which gives me a 4k resolution, but Debian runs out of memory when running a GNOME desktop at that resolution. I suppose 8 GB isn't enough, I'll try connecting an external USB drive and booting off that.
  2. The ethernet interface's mac address isn't set and defaults to some :00:00:00 address. That obviously is a very bad thing if you have two minis on the same network.
  3. there was a problem reserving memory, which I think I've found and worked around, though a real fix is going to require more digging through the ADT...
  4. The one minute delay after the ifconfig is really annoying, but I haven't found out how to disable it yet.

So plenty left to do :-)

Johnnie390 commented 3 years ago

I run a Raspberry PI 4 (8GB) with a 4K@60 hz screen with no problems, according to NMON I still have 6GB free with six Firefox windows open. Something is not correct here. I am again on the road, I will report back.

Regards,

Ry

pipcet commented 3 years ago

Sorry, it was a bit sloppy to say "8 GB isn't enough" as though buying more RAM was the solution. Note I was keeping everything in an uncompressed ram disk, and I was reserving extra memory, and I was using the debian task-gnome-desktop metapackage which pulls in loads of unnecessary stuff, so this was in no way unexpected and does not reflect on the actual day-to-day usability of minis running Linux in general. I fully intend to use my 8 GB mini for quite a while :-) )

Johnnie390 commented 3 years ago

Pip, what is new in this (automatic) release?? Is this documentation - https://github.com/pipcet/pearl/discussions/13 still valid?? Is debian.cpio still needed or has this been superceded by pearl-debian.macho???

pipcet commented 3 years ago

The new pearl-debian.macho file should boot, after a while, straight into a Debian root file system.

debian.cpio is no longer needed.

So #13 is no longer totally valid, though the PCI initialization dance is, unfortunately, still needed for the Ethernet adapter to work. I'll write up some new ones when I can test with my mini :-)

Johnnie390 commented 3 years ago

Pipcet, using today's release (5th of September) of pearl-debian.macho I can reach a desktop (task-gnome-desktop) without any intervention to bring the Ethernet interface online. In other words, all of this echo/binding/unbinding is not necessary any longer (my words).

If I install an LXQT or XFCE desktop, I have problems controlling the resolution (xrandr etc.). With the gnome desktop, I receive this (see screenshot) consistently.

WhatsApp Image 2021-09-05 at 15 51 26

Ry

pipcet commented 3 years ago

Pipcet, using today's release (5th of September) of pearl-debian.macho I can reach a desktop (task-gnome-desktop) without any intervention to bring the Ethernet interface online. In other words, all of this echo/binding/unbinding is not necessary any longer (my words).

Thank you for reporting this. I was hoping it'd be that way.

If I install an LXQT or XFCE desktop, I have problems controlling the resolution (xrandr etc.).

Sorry, I guess the resolution is hardcoded right now. Out of curiosity, which resolution were you going for?

With the gnome desktop, I receive this (see screenshot) consistently.

That looks like you're shutting down your system. Were you? Does it work with the FHD resolution?

In any case, this is a bug and very likely to be my fault. I'll try to reproduce and look into it.

Thanks again! Pip

Johnnie390 commented 3 years ago

Pip,

"Sorry, I guess the resolution is hardcoded right now. Out of curiosity, which resolution were you going for?" - Literally any resolution that would make the desktop manageable. This happened with LXDE, LXQT, Gnome and XFCE.

"That looks like you're shutting down your system. Were you? Does it work with the FHD resolution?" No, the error(s) in the screenshot were caused by an init 5.

Again on the road.

Ry.

pipcet commented 3 years ago

Hello Ry,

"Sorry, I guess the resolution is hardcoded right now. Out of curiosity, which resolution were you going for?" - Literally any resolution that would make the desktop manageable. This happened with LXDE, LXQT, Gnome and XFCE.

I should explain: I was trying to figure out whether to add an option to keep the standard 1920x1080 resolution, or whether we need options for intermediate resolutions right away. We definitely need the former, I think, and I'll work on it.

"That looks like you're shutting down your system. Were you? Does it work with the FHD resolution?" No, the error(s) in the screenshot were caused by an init 5.

Thanks, that helps narrow it down. Just to narrow it down further: you're using an 8 GB machine and that test was run on a ramdisk setup, right?

Again on the road.

Safe travels, Pip

Johnnie390 commented 3 years ago

Pip,

Ramdisk was used. Machine has 16GB.

Ry

pipcet commented 2 years ago

The new DCP driver should avoid these specific issues, I hope, or else we need a new issue :-)