#
#asahi-re · 2022-10-06 10:16
Jamie[m]cool
#asahi-re · 2022-10-06 10:14
rqou_next i would need to dump some frame params, and actually implement the piodma copy
#asahi-re · 2022-10-06 10:14
rqou_this actually gets all the way through to enabling the codec hardware IRQs
#asahi-re · 2022-10-06 10:14
rqou_i need to sleep, but here you go: https://github.com/rqou/m1-avd-reverse-engineering/blob/main/avd_emu.py
#asahi-re · 2022-10-06 10:13
rqou_anyways
#asahi-re · 2022-10-06 10:13
rqou_although we _might_ be able to play SD trailers etc. that don't require a secure boot chain
#asahi-re · 2022-10-06 10:13
rqou_i was going to ignore anything related to fairplay for now
#asahi-re · 2022-10-06 10:11
Jamie[m]if it lets us do fairplay then fairplay is broken
#asahi-re · 2022-10-06 10:11
chadmed[m]like do we even need to worry about fairplay at all?
#asahi-re · 2022-10-06 10:11
chadmed[m]surely it will be possible to come up with something with a simpler interface than what apple have done
#asahi-re · 2022-10-06 10:09
rqou_might be less confusing than apple's
#asahi-re · 2022-10-06 10:09
rqou_maybe
#asahi-re · 2022-10-06 10:09
Jamie[m]if this works out we can outdo lina by writing not just the kernel module in rust but also the firmware :P
#asahi-re · 2022-10-06 10:05
Jamie[m]yeah i just put MEMSRC at +4 directly after CFG instead of leaving a gap haha
#asahi-re · 2022-10-06 10:04
Jamie[m]that would explain some mistakes :P
#asahi-re · 2022-10-06 10:04
Jamie[m]oh i think i typed all these peripheral names from tunables into binaryninja by hand lmao
#asahi-re · 2022-10-06 10:03
Jamie[m]hmm yep i sure do
#asahi-re · 2022-10-06 10:01
rqou_i think you have it wrong
#asahi-re · 2022-10-06 10:01
Jamie[m]btw have i got my offsets wrong or is DMACFGMEMSRC serving a dual purpose where it seems to be read from as a "is the dma currently busy" register?
#asahi-re · 2022-10-06 10:01
Jamie[m]sweet
#asahi-re · 2022-10-06 10:01
Jamie[m]awesome i hadn't seen this stuff
#asahi-re · 2022-10-06 10:01
rqou_ok, all except RUN_CONTROL
#asahi-re · 2022-10-06 10:00
rqou_https://github.com/rqou/m1n1/blob/avd/proxyclient/m1n1/hw/avd.py#L214
#asahi-re · 2022-10-06 10:00
rqou_as well as all of mailbox (which has been there for... quite a while)
#asahi-re · 2022-10-06 10:00
Jamie[m]oh sweeet
#asahi-re · 2022-10-06 10:00
rqou_https://github.com/rqou/m1n1/blob/avd/proxyclient/m1n1/hw/avd.py#L95
#asahi-re · 2022-10-06 10:00
rqou_but yeah, PIODMA has been pushed for a few days now
#asahi-re · 2022-10-06 09:59
rqou_no idea about any of the other actually-video-related DMA
#asahi-re · 2022-10-06 09:59
rqou_the "PIODMA" block itself is used only in the dumbest possible way by the firmware
#asahi-re · 2022-10-06 09:58
Jamie[m](part of my reason for doing this was to isolate and understand the behaviour of the DMA peripherals, but I get the impression that you already understand them much more than I do)
#asahi-re · 2022-10-06 09:57
Jamie[m]i guess that is easier than REing the firmware with all the dynamic varaiables that actually just point to 0x10000000 haha :P:P
#asahi-re · 2022-10-06 09:57
rqou_the emulated firmware gets all the way to trying to poke the PIODMA peripheral now
#asahi-re · 2022-10-06 09:57
rqou_oh right now i'm doing something slightly different of "feed captured commands into an emulated firmware and see what it spits out"
#asahi-re · 2022-10-06 09:53
Jamie[m]**todo: figure out how to make the real-device exception handlers not interfere with the sram by putting stuff on the stack
#asahi-re · 2022-10-06 09:53
Jamie[m]+ run the whole thing under hv'd macos, watching using hooks on the peripherals etc
#asahi-re · 2022-10-06 09:52
Jamie[m]+ double-check that there's memory barrier stuff to ensure all the sram region accesses are immediately reflected (if necessary?)
#asahi-re · 2022-10-06 09:52
Jamie[m]+ hook it up so that the sram region is backed by the actual real sram region, as are the decoder/dma/etc peripherals
#asahi-re · 2022-10-06 09:52
Jamie[m]+ use hv to override writes to the firmware region, instead writing a firmware where all the exception vectors just go to a while(true) {} that doesn't touch memory*
#asahi-re · 2022-10-06 09:52
Jamie[m]so the strategy i had in mind is:
#asahi-re · 2022-10-06 09:46
Jamie[m]niceee
#asahi-re · 2022-10-06 09:45
rqou_https://i.imgur.com/BT6MZqN.png
#asahi-re · 2022-10-06 09:43
Jamie[m]oh good haha
#asahi-re · 2022-10-06 09:43
j`eyJamie[m]: on irc we see the > ;)
#asahi-re · 2022-10-06 09:42
Jamie[m]oh cool
#asahi-re · 2022-10-06 09:42
rqou_fake mailbox
#asahi-re · 2022-10-06 09:42
rqou_100% software right now
#asahi-re · 2022-10-06 09:42
rqou_no i'm not
#asahi-re · 2022-10-06 09:41
Jamie[m]awesome
#asahi-re · 2022-10-06 09:41
Jamie[m]yeah you must be if mailbox is working right?
#asahi-re · 2022-10-06 09:41
Jamie[m]are you forwarding peripheral register access to the real peripherals?

plus ›