top | item 27898187

Reverse-Engineering the Mali G78

122 points| caution | 4 years ago |collabora.com

30 comments

order
[+] anonymousiam|4 years ago|reply
Over 30 years ago, I was doing some OS9 (Microware, not Apple) development on a 68k embedded target. I needed a PIO driver that could do bi-directional I/O. The OS came with a PIO driver, but it wouldn't let you switch directions. I approached the vendor with several options:

1) I will pay you to write another driver with this functionality.

2) License the driver source code to me and I will do it.

For reasons I do not remember, they would not do either.

I ended up reversing their PIO driver and implementing a version with the functionality I needed. I was uneasy about doing this, but we never sold or distributed the work so it was probably legal. (The development was for an in-house application with just one target.)

[+] rektide|4 years ago|reply
such colossal public good.

kind of weird to me that we still have so few phones that have started running mainline. there's a lot of postmarketOS phones, but my understanding is they Helium/libhybris which mixes in a ton of the Android support infrastructure/drivers to do the job. i could be overly concerned, but there being so few distributions & such specific distributions targeting phones is exactly the good this work OUGHT to be unlocking, & it just seems like progress in making that happen is disorganized / not really happening, alas alas alas.

getting a toe-hold in, where we start to see self-determinism on what our devices run, would be such a compelling & powerful vision. i really hope we can start to see that!

ubuntu touch targets the Pixel3. i'd be curious to know what they did. PinePhone & Purism really took it from the top, have their own hardware that starts in a more easy-to-work with set up. but I don't see why that would be required to get a decent regular linux distro (arch, debian) running on a phone, with a gui (sans many device drivers!).

[+] MayeulC|4 years ago|reply
Last time I looked, few pmos devices used libhybris. They're mostly downstream kernels with no GPU acceleration, though they're getting progressively mainlined.

Mainlined phones generally try to leverage OSS drivers where possible.

[+] opan|4 years ago|reply
Some of the better-supported pmOS devices are running mainline, such as the OnePlus 6.
[+] ant6n|4 years ago|reply
How would a Linux phone be wrt security? I just had my iphone stolen, don't have to worry too much about data loss because it's unlikely somebody will crack into it.

I don't think that's true for Android, but I'm not sure about Linux phones.

[+] nicoburns|4 years ago|reply
I don't understand why ARM don't just release the source to their drivers. Seems like they'd have a lot to gain and little to lose bu doing so.
[+] bsder|4 years ago|reply
Patents. Graphics and video are patent minefields.

If you don't officially release the documentation, opposing companies find it much harder to sue you for patent infringement.

[+] ironman1478|4 years ago|reply
I haven't worked with their GPUs but I do work with their camera ISPs. I suspect that their reason might be that that seeing how to write software against the chip sort of gives away the secret sauce for how the chip works. I don't know if I would agree with that, but you can kind of intuit the design of chip based on its interface. How much values that provides is unclear though :/.

Also, they do charge customers for that code and it costs money to support/customize it work customer use cases. I suspect that's another part of the equation.

[+] fulafel|4 years ago|reply
Transparency and openness are things that in-house lawyers probably attack by default. They point all imagined risks re patents and bugs, liability, reputation, and security, and they specialize in CYA arguments.
[+] tyingq|4 years ago|reply
Patents they have a license to use, but not to share, or fear of infringing some unknown patent, so they don't want to say much.
[+] brandmeyer|4 years ago|reply
AMD rationalized closed-source driver development as a defense against the release of hardware trade secrets.
[+] fulafel|4 years ago|reply
This was good for a chuckle:

> On Android, we must cross-compile from a desktop with the Android Native Development Kit, ironically software that doesn’t run on Arm processors.

[+] defer|4 years ago|reply
Heh, I do android platform development for a living. Most devices are obviously ARM but you can't compile android on arm processors.
[+] pabs3|4 years ago|reply
They probably could have avoided needing to cross-compile by using a chroot under Android. There are lots of tools, and also the manual way.

https://wiki.debian.org/ChrootOnAndroid

[+] the-dude|4 years ago|reply
They were sure they could avoid using chroot by doing a cross-compile.

I am pretty sure Collabora know what they are doing.