#asahi-re · 2025-10-05 22:18
fl0_idnnym 944k for me#asahi-re · 2025-10-05 22:09
nnymconfigure-boot -c m1n1.bin --raw --entry-point 2048 --lowest-virtual-address 0 -v /Volumes/test` and it still runs for less than a second.#asahi-re · 2025-10-05 22:09
nnymI had an m1n1 that ran for around a minute or 2 before rebooting on my T6041, made some changes (defined `BRINGUP`), reverted them, and built it again and now it lasts less than a second. I purged `build/` before rebuilding to be sure but its SHA-256 hash changed after I did that while the source code was the same; so I copied it again, verified its hash, and ran `kmutil#asahi-re · 2025-10-05 21:05
nnymI ran `du -h build/m1n1.bin` a little earlier and saw that it was around 70K; now it's over 900K. Is that possible or am I misremembering?#asahi-re · 2025-10-05 17:39
jannauit would be an usb-c to usb-c cable and it requires a special setup. or just connect two apple silicon macs#asahi-re · 2025-10-05 17:33
nnymThat would disable more than just the broken code though. And with a Macbook, would you use a USB-C to RS-232 cable in that case?#asahi-re · 2025-10-05 17:21
jannauit's called BRINGUP because it's intended for bringup of new devices#asahi-re · 2025-10-05 17:21
jannauyou wouldn't use it on any device where USB is already working#asahi-re · 2025-10-05 17:20
jannauyou avoid the crash and can inspect data only available on the device and possible even causing the crash#asahi-re · 2025-10-05 17:14
nnymWhy would you do it in the latter case? Does it make debugging easier somehow?#asahi-re · 2025-10-05 16:25
chaos_princess(or when current code breaks something and causes a crash)#asahi-re · 2025-10-05 16:24
chaos_princessit is for cases where nothing except serial works yet#asahi-re · 2025-10-05 16:20
nnymDefining `BRINGUP` in m1n1 seems to only disable things and causes only the white apple to show while booting. If I can otherwise see the Asahi logo and a log, is defining it useless?#asahi-re · 2025-10-04 18:27
alexalteachaos_princess, ok that makes sense, thanks. so far drivers expose /dev/accel/ane0..3, I'll have libane pick aneN via round robin, unless explicitly stated#asahi-re · 2025-10-04 17:37
chaos_princessvideo stuff follows a similar pattern. As for apps - they don't even really have a say if os will use the ANE at all and not decide to run it on gpu instead. and yes, looks like only one ANE instance is used by macos#asahi-re · 2025-10-04 16:12
alexalteaalso, I'm assuming that each .hwx model only needs ONE ane node to run... I haven't seen anything resembling sync primitives so hopefully there's no cooperation between nodes#asahi-re · 2025-10-04 16:09
alexalteaand if so, any insights on how such engines are selected in macos to run a task? are engines selected by macos system libs? or do have apps a say in which ones to use?#asahi-re · 2025-10-04 16:08
alexalteahas anybody encountered this pattern in other devices? (multiple independent engines)#asahi-re · 2025-10-04 16:07
alexalteaeiln documented this at https://github.com/eiln/ane/blob/33a61249d773f8f50c02ab0b9fe5b2db58346751/docs/ane-boards.md#asahi-re · 2025-10-04 16:07
alexalteaonly one question remains: some apple machines have several ane nodes (ane0, ane1, ane2, ane3), which seem completely independent from each other (I guess each have their own DARTs too?)#asahi-re · 2025-10-04 16:07
alexalteaI've added m2 (h14) support to eiln's ane drivers, which were m1 (h13) only. I've made some changes to the uapi and userland library, so that it can load models directly from .hwx files without prior conversion to the custom .anec format#asahi-re · 2025-09-29 08:22
BOMBOCLAT9-=[ 3https://ppnetworks.it9 ]=- 4VPS 1G PROMO .HU 1,20€/mo #asahi-re · 2025-09-07 23:58
kvhi, can someone provide a hint on how the encoder address offset inside the command buffer was determined#asahi-re · 2025-07-20 12:08
graphinethanks nickchan, I actually found a helper function in pongoos device_clock_by_name.#asahi-re · 2025-07-18 11:12
nickchanand since you mentioned pongoOS I should assume you are on the older SoCs in which case the ID is the uint8 id1 property in the struct#asahi-re · 2025-07-18 11:11
nickchanpmgr_adt_power_enable() pmgr_adt_power_disable() and the clock-gates property on a device node is the id property in the pmgr device struct#asahi-re · 2025-07-18 11:10
nickchangraphine: if you come back and read the logs then about that question it should all be handled by m1n1's src/pmgr.c already#asahi-re · 2025-07-16 23:32
graphineNoob question, is there any documentation about finding clock-gate register to enable devices? I'm actually running from pongoOS so pretty limited.#asahi-re · 2025-06-17 20:26
chaos_princessthe usual approach is that you run macos using m1n1 as a hypervisor and see what it does. Except on m4 you can't because of sptm, so the first step is figuring out how to put both macos and sptm into a hypervisor.#asahi-re · 2025-06-17 20:22
QameHey, sorry if my question is dumb. I'm trying to add support for Mac Mini M4 on m1n1, and reading the source code I think I'm getting an idea on what I should be adding but how do I go on about figuring out the values that I need, things liek chickens or what not.#asahi-re · 2025-04-24 12:31
nickchanone to set where to eret into after the cpu comes out of reset and one that locks down the kernel (this one is just going to be implemented as no op)#asahi-re · 2025-04-24 12:30
nickchanand a7-a9 has el3 but since the monitor has a grand total of two smc can just implement in m1n1#asahi-re · 2025-04-24 12:30
nickchanthis is on a10x. a11 has more APRR stuff to care about but a10 already have the basics, don't think that would be a problem#asahi-re · 2025-04-24 12:16
nickchannow it is possible to call any m1n1 functions#asahi-re · 2025-04-24 12:16
nickchan1. set pan, spsel 2. save gpr to kernel stack 3. save ttbr0_el1 tcr_el1 mair_el1 to kernel stack 4. recover m1n1's ttbr0 5. recover m1n1's mair 6. barrier instructions 7. branch into m1n1 8. set sp to m1n1's stack#asahi-re · 2025-04-24 12:15
nickchanand to reenter m1n1 context from kernel's vbar in high addr it goes like this:#asahi-re · 2025-04-24 12:14
nickchansandwiched#asahi-re · 2025-04-24 12:14
nickchanso the m1n1 stack remain usable (m1n1 is sandwidthed between xnu and top of kernel data so xnu's init pagetables will have m1n1 mapped)#asahi-re · 2025-04-24 12:13
sven*if we do the tracing via patching xnu#asahi-re · 2025-04-24 12:13
svenif we do the tracing all this work you've been doing sounds like a good base to start from though#asahi-re · 2025-04-24 12:13
nickchanthis one is kind of hacked around by writing magic values to x2 and patching how the kernel setup its stack after a cpu reset#asahi-re · 2025-04-24 12:13
svenso i still wonder if we'll have to resort to patching xnu for tracing m4+ or if it's easier to virtualize GL2, etc. #asahi-re · 2025-04-24 12:12
nickchandue to lack of wfi retention the cpu actually comes out of reset a lot and this one is tricking because unlike during bootup the kernel is *already* patched with undefined instructions#asahi-re · 2025-04-24 12:11
nickchani think this is a meltdown mitigation?#asahi-re · 2025-04-24 12:10
nickchananother problem is that when xnu is switching into EL0 xnu unmaps basically all of kernel memory by increasing t1sz in tcr, this is unacceptable for tracing, though just skipping the t1sz modifcation is enough#asahi-re · 2025-04-24 12:10
nickchannote some nop only patches like kernel lockdown patches are still applied on boot#asahi-re · 2025-04-24 12:08
nickchanso on boot do not apply tracing patches till xnu rebases its pc when branching into shellcode from a hooked ret#asahi-re · 2025-04-24 12:07
nickchannow xnu uses ttbr1 so restoring m1n1 context is not a big problem in general... just like dealing with yet another userland thread... problem is of course before xnu rebases its pc to high address#asahi-re · 2025-04-24 12:04
nickchanprevious stage is pongoOS and the security and seprom stuff is typical jailbreak patches nothing special there