#
#asahi-re · 2022-10-03 20:28
rqou_this part is created by CAvdApComm*::ConfigurePioHdr*
#asahi-re · 2022-10-03 20:27
rqou_it's all a really confusing mess
#asahi-re · 2022-10-03 20:27
rqou_which is copied into cortex-m3 sram at address 10003070 + (some idx that i don't understand yet) * 0x16d8
#asahi-re · 2022-10-03 20:26
rqou_for h.264 the first chunk at offset +0x0 is 0xB0 32-bit words
#asahi-re · 2022-10-03 20:26
rqou_but the sub-parts do
#asahi-re · 2022-10-03 20:26
rqou_the 0xb7504 doesn't change with codec
#asahi-re · 2022-10-03 20:25
jannauwhich codec do you use? h264?
#asahi-re · 2022-10-03 20:24
rqou_it's made up of a bunch of sub-blocks, and the 0x60 command has pointers to various bits of it
#asahi-re · 2022-10-03 20:24
rqou_frame params seem to be 0xb7504 bytes total, but it's not one contiguous thing
#asahi-re · 2022-10-03 20:23
jannaumy understanding of the architecture is that it probably maps well onto the v4l2 stateless decoder API: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-stateless-decoder.html
#asahi-re · 2022-10-03 20:21
jannaudo you know how large the metadata in 5)? how large are the frame params?
#asahi-re · 2022-10-03 20:16
rqou_the metadata seems to be called "frame params" by the driver and is filled in by CAHDec*::populate* functions
#asahi-re · 2022-10-03 20:07
rqou_frame data is _probably_ in DART stream 0, and i have no idea how it's tied in with the metadata
#asahi-re · 2022-10-03 20:07
rqou_no, it's just metadata
#asahi-re · 2022-10-03 19:55
jannauis 5) the frame data?
#asahi-re · 2022-10-03 19:33
rqou_6) ??? 7) profit (haven't gotten to this bit yet)
#asahi-re · 2022-10-03 19:33
rqou_5) the APIODMA block copies even more data (from main memory) into the cortex-m3 sram
#asahi-re · 2022-10-03 19:33
rqou_4) cortex-m3 reads some of the command fields and pokes the address into the APIODMA block, and then waits for it to finish
#asahi-re · 2022-10-03 19:32
rqou_3) driver sends the address of the command it just wrote into the cortex-m3 mailbox
#asahi-re · 2022-10-03 19:32
rqou_so far the data flow as i understand it is: 1) driver writes "frame params" into main memory mapped by DART stream 1 2) driver writes a 0x60 byte command by directly poking it into cortex-m3 sram
#asahi-re · 2022-10-03 19:30
rqou_for extra funsies, this base address is hardcoded in the kext, it's not read from the ADT
#asahi-re · 2022-10-03 19:27
rqou_attempting to access the DART causes the dma engine to explicitly report a fault, but other accesses like main memory seem to just get stuck
#asahi-re · 2022-10-03 19:25
rqou_definitely can't access the DART
#asahi-re · 2022-10-03 19:25
rqou_so it might be able to access the other avd peripheral registers too, but tbd
#asahi-re · 2022-10-03 19:25
rqou_marcan: the macos driver programs the dma base address to point to the piodma hardware block itself, but then all dma packets that the driver emits seem to target the cortex-m sram via an additional offset
#asahi-re · 2022-10-03 18:24
marcanas long as that DMA engine can only DMA to/from stuff behind a DART and its own internal SRAM, it's fine
#asahi-re · 2022-10-03 18:24
marcanrqou_: this isn't particularly surprising; SMC is similar, it has its SRAM it can access (at the real physical address) but it doesn't have access to everything else
#asahi-re · 2022-10-03 11:08
rqou_what a clusterfuck of an architecture
#asahi-re · 2022-10-03 11:08
rqou_also, afaict (need to double-check) this DMA engine is being used... to just copy even more data into the cortex-m3 data memory
#asahi-re · 2022-10-03 10:59
rqou_this dma engine seems to be called "APIODMA" and also exists (in seemingly identical fashion) in the hardware scaler
#asahi-re · 2022-10-03 10:58
rqou_finally got back into doing some AVD re, and it turns out the cortex-m3 inside the avd has access to a dma engine that can write to physical addresses. afaict not _arbitrary_ addresses (i.e. i tried to write to a DART TTBR and it failed, and a write to main memory seemed to have been dropped), but i'm not sure how restrictions on it are configured/enforced
#asahi-re · 2022-09-23 18:26
ChaosPrincessits more ios jailbreakers that know a lot about how it works internally
#asahi-re · 2022-09-23 18:25
ChaosPrincessi dont think there is much interest in reversing iboot here, we know it's boot protocol, and thats kinda all we need
#asahi-re · 2022-09-23 18:25
kiritokamuibut thanks
#asahi-re · 2022-09-23 18:25
kiritokamuiI don't know how you do that
#asahi-re · 2022-09-23 18:24
kiritokamuiit must be really difficult to reverse engineer that kind of program
#asahi-re · 2022-09-23 18:24
kiritokamuioh
#asahi-re · 2022-09-23 18:24
ChaosPrincessbasically - proprietary apple magic
#asahi-re · 2022-09-23 18:24
ChaosPrincessiBoot
#asahi-re · 2022-09-23 18:23
kiritokamuiI just wanted to know what is the bootloader of Darwin/MacOS system by curiosity(like on linux, its generally Grub)
#asahi-re · 2022-09-23 18:22
kiritokamuiI have installed asahi
#asahi-re · 2022-09-23 18:22
kiritokamuiI have a Macbook Air M1 2020
#asahi-re · 2022-09-23 18:22
kiritokamuihi
#asahi-re · 2022-09-18 20:59
quaffpotion[m]Hello!
#asahi-re · 2022-09-08 01:03
chadmedi dont think anything there is going to be useful to us at the end of the day, it's just an interesting curiosity
#asahi-re · 2022-09-08 01:02
chadmedit makes sense to me given what we know of where apple's designs started but its clear that if there was any common lineage that apple have significantly deviated
#asahi-re · 2022-09-08 01:02
chadmedyeah have a read of drivers/media/platform/samsung/s5p-mfc/s5p-mfc-dec.c and lmk what you think
#asahi-re · 2022-09-08 01:01
chadmedi got hyperfocused on trying to work out what those values were at the top of its memory range that m1n1 reckons are pmgr things, but im starting to think that they might just actually be pmgr things based on what youve found
#asahi-re · 2022-09-08 01:00
Jamie[m]ooo that samsung link sounds interesting
#asahi-re · 2022-09-08 01:00
chadmeddidnt realise youd gotten so far

plus ›