#
…

2022-04-13

00:37jakebot has quit [Quit: The Lounge - https://thelounge.chat]
00:37jakebot has joined #asahi-re
00:57yuyichao_ has quit [Ping timeout: 480 seconds]
01:10chadmed_ has joined #asahi-re
01:10chadmed has quit [Read error: Connection reset by peer]
01:16zopieux has quit [Read error: Connection reset by peer]
01:39yuyichao_ has joined #asahi-re
02:14jakebot has quit [Quit: The Lounge - https://thelounge.chat]
02:17xet7 has joined #asahi-re
02:39xet7 has quit [Remote host closed the connection]
02:50PhilippvK has joined #asahi-re
02:53phiologe has quit [Ping timeout: 480 seconds]
03:29nicolas17 has quit [Quit: Konversation terminated!]
04:13balrog has quit [Quit: Bye]
04:13balrog has joined #asahi-re
04:13Ariadne has quit [Read error: Connection reset by peer]
04:14Ariadne has joined #asahi-re
04:30eaxk[m]<rqou_> "marcan: where does it make sense..." <- Does it work
04:31kode54eaxk[m]: it's a user space python script, I think
04:32kode54so it's only an example of what a regular driver needs to do
04:32eaxk[m]got it thanks
04:56rqou_yup, userspace python proof of concept / demonstration
04:57rqou_very much from the "unclean" side of the clean-room RE process as well
04:57rqou_somebody would need to write a real linux kernel-mode driver in C that complies with upstream conventions based on it
04:59rqou_i'm probably not a good choice for that because my sweng skills are weaker than my RE skills, and i am not familiar with linux kernel conventions at all
04:59rqou_but yes, it does "work"
04:59rqou_i could successfully OBEX files to my phone and play audio via A2DP
05:00marcanI think that belongs in its own repo, we don't really have a place for that
05:00rqou_fair enough, i'll just keep it on my github
05:01marcanif you had written as a m1n1 script that exposes the HCI on the host side that would've 1) been hilarious, and 2) fit in proxyclient/ :)
05:01marcan*written it
05:01rqou_trying to figure out how to init pcie from m1n1 seemed hard
05:01marcanyeah, I should write that up TBH
05:01chadmed_m1n1 control over bluetooth when :P
05:01marcannot the first time I've wanted it
05:02rqou_not sure if that would have been more or less hilarious than seeing `def interrupt_handler()` in python
05:08rqou_anyways, i'm not opposed to writing a proper driver for the bluetooth myself, but it would need people (i.e. marcan) to be okay with it from an IP/copyright perspective, and also I would need a lot of guidance on kernel/upstream conventions (never having done any of that myself)
05:10rqou_otherwise it is very likely that i driver i would write would end up with problems such as "that dril tweet"-style "PCIe ring buffers: MAstered. firmware loading:This ones hard"
05:10marcanI'd have to take a look re the IP perspective, but you seem to be pretty prolific at reversing the hardware so feel free to keep doing that, that is very helpful :)
05:10rqou_er, i also worked at broadcom a long time ago (not on anything related to wifi/bt chips, but still)
05:11rqou_on top of having thrown tons of macos into ghidra
05:11marcanI mean, sven interned at Apple a long time ago
05:11rqou_guess that's fine then
05:12marcanif the work wasn't related and/or it's so long ago it's irrelevant and any NDAs are expired, it doesn't matter
05:12rqou_i have banned myself from ever touching the broadcom 1570 facetimehd driver because i saw the internal datasheet for it
05:12marcanit'd be different if you'd worked on these particular subsystems recently, of course
05:12marcanthat's reasonable, yeah
05:12rqou_also the RE'd driver for that probably has lots of stuff copied from macos
05:13marcanyeah, that kind of thing is what we're trying to avoid...
05:14marcangenerally, I always said we can't do textbook cleanroom because that's just too much overhead and we can't easily construct the documentation wall with the people we have (and it's not a legal requirement anyway, that's a myth)
05:15marcan*but* certainly, if folks come by and like to stick on one side of that wall, we'll certainly go with it and it helps
05:15rqou_yeah i'm pretty familiar with how the wall works (at least under US law)
05:15rqou_i find i'm much better at RE though
05:15marcanso if you enjoy doing the RE bit and writing PoCs and want to leave the kernel munging to others, that's encouraged and having a split between two people, even if not a strict documentation wall, still increases our legal defense in case anything happens
05:17marcanI was pretty happy with your JPEG stuff; I haven't looked at BT but from the sound of it there's enough shared concepts with WiFi that it sounds unlikely that we'd carry infringing stuff over across the layers from your PoC to a Linux driver (as long as whoever does the Linux side knows what they're doing with all this)
05:18marcanif anything there's going to be copypasta from *brcmfmac*, not from your PoC
05:18rqou_possibly
05:18rqou_btw bluetooth will need to be added to the firmware munging installer script
05:18rqou_but i don't understand the details of how that works
05:19rqou_it uses the same island codenames though
05:19marcanwe need to first understand how firmware selection happens in macOS, i.e. what hardware IDs we need to pick one
05:19rqou_yeah idk it's controlled somewhere in userspace i think
05:19rqou_far from anything i looked at
05:19marcanthis is why I added the last minute "package all the raw firmwares tarball" thing to the installer
05:19rqou_i just copied the files i needed for my own hardware
05:19marcanI'll ship a userspace tool to re-run the firmware extraction from linux and update it
05:19marcanso existing users need to do nothing
05:20rqou_you also need a calibration blob from the ADT
05:21rqou_which is submitted over HCI commands
05:21rqou_dunno how that should be handled
05:21marcanno surprise there either, we need to forward that into the DT in m1n1
05:22marcanI also suspect we're missing something along those lines for WiFi, since people report worse performance under Linux even though we use the same firmware/txcal/clm blobs
05:22rqou_i mean, there's a "wifi-calibration-msf" whatever that is
05:23rqou_i had assumed that you had sorted that out already
05:23marcanwe aren't using that one yet :)
05:23marcanneed to figure out how it gets sent
05:24rqou_btw bluetooth has two calibration blobs, but i don't know why one is different from the other or how they're chosen
05:24rqou_which is also fun
05:26marcanIIRC that wifical stuff was in OTP on the T2s, so it makes sense that apple put it in the ADT on these since it seems they've stopped using OTP for anything device-specific
05:26marcanjust need to figure out how it gets sent over
05:27rqou_i wonder if the seemoo people know?
05:27rqou_some of their stuff has been vaguely helpful for overall big picture understanding, but it's all a bit dated / not quite looking at the same areas
05:28marcanah wait, I'm dumb, I do have brcm,cal-blob implemented already
05:29marcanm1n1 just doesn't pass it through yet :D
05:29marcanor does it?
05:29marcanwait it does
05:29marcandamn my memory is crap lol
05:29marcanso yeah, I guess we do pass that through if I'm not mistaken
05:29marcan(haven't touched wifi since january)
05:29marcantoo many things inside my head lately...
05:29rqou_yeah, bluetooth needs bluetooth-taurus-calibration-bf
05:30rqou_i have no idea why it's not using bluetooth-taurus-calibration
05:30marcansee src/kboot.c:561
05:30marcanso anyway, bluetooth would be identical to that
05:30rqou_oh yeah i see that
05:30rqou_does that actually get uploaded properly?
05:30marcanit should
05:31marcangrep for "calload" in the asahi branch brcmfmac source
05:31rqou_fwiw i never noticed any issues with wifi
05:32marcanit does *work* but some people have reported worse performance than macos in identical situations
05:32marcanI need to do a controlled test myself and see
05:37rqou_anyways, since this is the -re channel where cursed stuff can be discussed, i ran `strings` on the camera firmware a while back and suspect that some of the information from the `facetimehd` driver carries over
05:37rqou_at least the command names are the same
05:38marcanlike the ISP firmware?
05:38marcanlike high level commands?
05:38rqou_the facetimehd chip on older macbooks is mostly non-broadcom IP, broadcom only did the pcie and ram
05:38rqou_even the internal datasheet was missing everything else
05:38marcanwhat cpu did that use? some arm?
05:39rqou_if you actually load the REd facetimehd driver it prints the ISP boot log to dmesg
05:39marcanoh it literally has a thing called isp too, heh
05:40rqou_but yeah, APOLLO-ISP-APPLE
05:40rqou_[3110795.099205] FWMSG: Disclaimer : Copyright (c) APPLE Inc. All Rights Reserved.
05:40rqou_[3110795.099243] FWMSG: Linked on : Jul 25 2015 - 08:48:55
05:40rqou_[3110795.099223] FWMSG: Application : adc [release]
05:40rqou_[3110795.099276] FWMSG: H4ISPAPPLE : 11536
05:40rqou_[3110795.099261] FWMSG: Release : S2ISP-01.43.00
05:40rqou_[3110795.099290] FWMSG: H4ISPCD : 4081
05:40rqou_[3110795.099321] FWMSG: ffw : 4143
05:40rqou_[3110795.099343] FWMSG: Tool-chain : iPhone OS - 7.0.3 [clang/clang++]
05:41rqou_so yeah, it runs a 32-bit ARM of some kind
05:42rqou_basically all apple stuff, even though everyone out there thinks it's a "broadcom webcam chip"
05:42marcansounds like they probably ported the actual processing into RTKit then
05:42marcanISP is a 64-bit chinook or so, so definitely not a direct transfer
05:42marcanbut they've done this with lots of other copros
05:43rqou_i wonder if the old facetimehd chip was some kind of test of putting apple custom IP into a macbook?
05:44marcanI wouldn't call it a test, they've been doing this over time with everything
05:44rqou_iirc the T1 touchbar macs were next
05:44marcanbut now broadcom+pcie is starting to sound like this bluetooth thing :p
05:45marcanapple platforms increasingly have more and more custom silicon
05:45rqou_yeah, having seen the (mostly empty) internal datasheet for the old webcam is a big part of why i suspected the bluetooth pcie is custom
05:45marcanlike the jack codec on the new macs, unclear if CS will release a public equivalent or not but so far it's pretty different from existing public ones
05:45marcantheir PMUs are by Dialog but also quite custom, e.g. the RTC is totally different
05:45marcanBroadcom is out making custom wifi/bt chips for them
05:46marcantheir NAND flash chips are off the shelf flash + custom controller dies, running 64-bit chinooks again (yes really, every flash chip in these things has a 64-bit ARM)
05:46rqou_yup, saw your tweets about that
05:47marcanalso their display TCONs are custom AIUI and have been for a while (though related to public ones)
05:48rqou_btw the bluetooth has a _ton_ of vendor-specific commands
05:48rqou_some of which the seemoo people seem to have somehow figured out https://github.com/seemoo-lab/internalblue/blob/master/internalblue/hci.py
05:48rqou_and some of which aren't even in there
05:53alexsv has joined #asahi-re
05:55rqou_btw marcan have you had a chance to take a look at my t8110 dart code for m1n1?
05:55rqou_feel free to yell at me for doing a huge copypasta
05:57rqou_the code itself is basically all m1n1 code, but i got a bunch of register names and bit positions by dumping the DWARF data from the KDK
05:58rqou_e.g. that's how i figured out that bit1 of the PTE is probably "uncacheable"
06:10jannaurqou_: is there a reason why it's no integrated into dart.py? it probably uses the same pte format as dart-t6000 are
06:14rqou_reason? yes. good reason? probably not
06:14rqou_i duplicated the code before i was sure about the page table format (and suspected it had additional page table levels)
06:14rqou_i then realized it didn't, at least not in the t600x
06:16rqou_also i ended up removing the L0 logic because t8110 obviously didn't have it, and afterwards i was lazy and didn't want to figure out the appropriate place to stick if statements to unify the code
06:17alexsv has quit [Ping timeout: 480 seconds]
06:18rqou_especially since the original dart code wasn't particularly well parameterized over device type
06:24svenmight make sense to integrate it into dart.py
06:25svenproxyclient is deliberately full of hacks but at least merging the dart variants into a single file should be doable :D
06:26the_lanetly_052___ has joined #asahi-re
06:27boardwalk has quit [Quit: Ping timeout (120 seconds)]
06:28boardwalk has joined #asahi-re
06:32the_lanetly_052__ has quit [Ping timeout: 480 seconds]
07:03boardwalk has quit [Quit: Ping timeout (120 seconds)]
07:03boardwalk has joined #asahi-re
07:18user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:23zopieux has joined #asahi-re
10:04r_rei[m] has joined #asahi-re
10:05the_lanetly_052___ has quit [Remote host closed the connection]
10:06the_lanetly_052___ has joined #asahi-re
10:21millenialhacker has joined #asahi-re
10:24jakebot has joined #asahi-re
11:28PhilippvK has quit [Quit: No Ping reply in 180 seconds.]
11:29phiologe has joined #asahi-re
11:45millenialhacker has quit [Quit: Konversation terminated!]
11:47millenialhacker has joined #asahi-re
12:03the_lanetly_052___ has quit [Remote host closed the connection]
12:04the_lanetly_052___ has joined #asahi-re
12:11kameks has joined #asahi-re
12:31Shiz has joined #asahi-re
12:59xet7 has joined #asahi-re
13:07Shiz has quit [Ping timeout: 480 seconds]
13:17robinp has quit [Remote host closed the connection]
13:33kameks has quit [Ping timeout: 480 seconds]
13:37willow[m]1 has joined #asahi-re
13:43yuyichao_ has quit [Ping timeout: 480 seconds]
13:56bisko has joined #asahi-re
13:56xet7 has quit [Remote host closed the connection]
14:01bisko has quit []
14:04yuyichao_ has joined #asahi-re
14:13bisko has joined #asahi-re
14:16bisko has quit []
14:28millenialhacker has quit [Quit: Konversation terminated!]
14:39alexsv has joined #asahi-re
14:41roxfan2 has joined #asahi-re
14:46roxfan has quit [Ping timeout: 480 seconds]
14:59millenialhacker has joined #asahi-re
14:59millenialhacker has quit []
14:59bisko has joined #asahi-re
15:00bisko has quit []
15:05bisko has joined #asahi-re
15:16bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:20yrlf has quit [Quit: The Lounge - https://thelounge.chat]
15:21yrlf has joined #asahi-re
15:24bisko has joined #asahi-re
15:33bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:56bisko has joined #asahi-re
16:23bisko has quit [Read error: Connection reset by peer]
16:24nicolas17 has joined #asahi-re
16:24bisko has joined #asahi-re
16:42bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:47bisko has joined #asahi-re
16:50bisko has quit []
17:03bisko has joined #asahi-re
17:06Misthios has quit [Quit: Misthios]
17:07Misthios has joined #asahi-re
17:07roxfan2 is now known as roxfan
17:20bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:56nicolas17 has quit [Quit: Konversation terminated!]
18:25user982492 has joined #asahi-re
18:29user982492 has quit []
18:32bisko has joined #asahi-re
18:37bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:39bisko has joined #asahi-re
18:48user982492 has joined #asahi-re
18:50bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:12user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:19bisko has joined #asahi-re
19:38bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:42bisko has joined #asahi-re
19:52bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:26Major_Biscuit has joined #asahi-re
20:44Major_Biscuit has quit [Ping timeout: 480 seconds]
21:05alexsv has quit [Ping timeout: 480 seconds]
21:12Major_Biscuit has joined #asahi-re
22:03user982492 has joined #asahi-re
22:06Major_Biscuit has quit [Ping timeout: 480 seconds]
23:36user982492 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:42user982492 has joined #asahi-re
23:43nicolas17 has joined #asahi-re
…