#
✕ nick:pipcet[m]
#asahi · 2021-05-06 14:36
pipcet[m]okay, so I've had to patch a single insn in the kernel and mess with the device tree a bit, but I can get a usable macos desktop chain-loaded through m1n1 now. Can't wait for the hypervisor!
#asahi · 2021-05-05 18:38
pipcet[m]...okay, macos lets me have a different image, and that chainloads a little. I must have done something wrong in the recovery terminal
#asahi · 2021-05-05 18:28
pipcet[m]good night, and sorry for the confusion.
#asahi · 2021-05-05 18:26
pipcet[m]will play with it if it does and I can get at the kernelcache...
#asahi · 2021-05-05 18:23
pipcet[m]cool :-)
#asahi · 2021-05-05 18:12
pipcet[m]well, that's that mystery resolved then.
#asahi · 2021-05-05 18:10
pipcet[m]and I don't have an x86_64 mac I could have confused that with.
#asahi · 2021-05-05 18:10
pipcet[m]it says "Darwin Kernel Version 20.3.0...RELEASE_ARM64_T8101"
#asahi · 2021-05-05 18:04
pipcet[m]cool!
#asahi · 2021-05-05 18:04
pipcet[m]and?
#asahi · 2021-05-05 18:02
pipcet[m](great, it forgot my backlight brightness settings again)
#asahi · 2021-05-05 18:00
pipcet[m]maybe it's the limited rot-13 code edition.
#asahi · 2021-05-05 17:59
pipcet[m]I'd appreciate any help, but it looks like my concerns seem specific to my machine so far (purchased in March)
#asahi · 2021-05-05 17:57
pipcet[m]nope
#asahi · 2021-05-05 17:56
pipcet[m]yes.
#asahi · 2021-05-05 17:55
pipcet[m]it doesn't look encrypted. repetitive, compresses well. Just not valid insns.
#asahi · 2021-05-05 17:52
pipcet[m]if it's a new apple trick we should probably work with the older version for now
#asahi · 2021-05-05 17:52
pipcet[m]that would be awesome!
#asahi · 2021-05-05 17:50
pipcet[m]let me boot into macos
#asahi · 2021-05-05 17:47
pipcet[m]yes. it does seem like a valid mach-o to me.
#asahi · 2021-05-05 17:44
pipcet[m]https://pastebin.com/KWGHtuZw
#asahi · 2021-05-05 17:43
pipcet[m]possibly. the same line here gives no hits that are actual msr insns.
#asahi · 2021-05-05 17:40
pipcet[m]it's a macho here.
#asahi · 2021-05-05 17:39
pipcet[m]marcan: excellent news! As I said, on my device the kernel cache does not contain plain aarch64 instructions, and doesn't boot when installed as a custom kernel.
#asahi · 2021-05-05 16:03
pipcet[m]yrlf: there are plenty of tricks we can play without a hypervisor...
#asahi · 2021-05-05 16:02
pipcet[m]the macho does not contain instructions that objdump or the CPU understand
#asahi · 2021-05-05 16:02
pipcet[m]what would you even jump to?
#asahi · 2021-05-05 16:00
pipcet[m]yes, I have. And I've run into problems. That's why I think it's hard.
#asahi · 2021-05-05 15:59
pipcet[m]and we're going to have to do it anyway before the hypervisor would be very useful
#asahi · 2021-05-05 15:59
pipcet[m]why "going to be", though? If it's the easy part we should do it first, to see whether it isn't actually tricky or impossible.
#asahi · 2021-05-05 15:58
pipcet[m]maybe we're both partly right and both parts are easy
#asahi · 2021-05-05 15:57
pipcet[m]you appear to be saying that it should be trivial to boot macos from, say, Linux, and the difficult bit is getting a hypervisor in. I think it's the opposite.
#asahi · 2021-05-05 15:55
pipcet[m]memory image of a working macos system? Hardware state while it's running?
#asahi · 2021-05-05 15:52
pipcet[m]but so far the "load xnu and jump to it" part doesn't seem trivial to me. If it is, we should get that done first, I think, because that would give us debugging information even without a hypervisor.
#asahi · 2021-05-05 15:51
pipcet[m]maybe it's a macos version thing, and older machos work fine.
#asahi · 2021-05-05 15:49
pipcet[m]the data section is fine, the code section...isn't.
#asahi · 2021-05-05 15:48
pipcet[m]running objdump on them produces gibberish :-)
#asahi · 2021-05-05 15:48
pipcet[m]so which macho would we use? The .kc machos do not have plain AArch64 instructions in them.
#asahi · 2021-05-05 15:45
pipcet[m]"writing code that loads xnu" is the problematic part, I fear.
#asahi · 2021-05-05 15:17
pipcet[m]sorry, https://worthdoingbadly.com/xnuqemu3/
#asahi · 2021-05-05 15:16
pipcet[m]or to emulate it (https://worthdoingbadly.com/xnuqemu2/ doesn't work on actual kernels), or to get a memory image of a running macos system (I don't suppose they have /dev/mem :-) ), or anything like that? Because without a way of doing that, I don't see how all this hypervisor work will ever pay off.
#asahi · 2021-05-05 15:15
pipcet[m]do we have any way at all of loading macos if it isn't currently configured to be the boot OS? I tried installing the macos .macho as a custom kernel but could not get that to boot.
#asahi · 2021-05-05 11:54
pipcet[m]sven: I don't think we want grub in userspace, but I suspect we'd be happier with the device tree mangling in userspace. The main problem kexec has and had is that the old kernel may leave hardware in a bad state, and that's not an issue for us as the first kernel doesn't even need to touch the interrupt controller or anything.
#asahi · 2021-05-04 19:01
pipcet[m](my horrible scheme is to pass the ADT to a minimal kernel without device drivers, which doesn't need a device tree, builds one from the ADT, then passes that to the real kernel via kexec(). works fine so far. All Linux though, but I can kexec() m1n1)
#asahi · 2021-05-04 18:55
pipcet[m]I was merely wondering whether anyone had done the work for freebsd on arm64 :-)
#asahi · 2021-05-04 18:37
pipcet[m]kexec loads Linux ELF files, so I don't see why not. Should be easy to fix if it doesn't work.
#asahi · 2021-05-04 17:39
pipcet[m]can kexec execute FreeBSD kernels?
#asahi · 2021-05-02 22:17
pipcet[m]absolutely amazing. I'm really impressed by the progress there :-)
#asahi · 2021-04-29 23:48
pipcet[m]huh. So I guess the instruction and data caches are nearly coherent?
#asahi · 2021-04-29 15:33
pipcet[m]i2s is mentioned in the TI docs, yes.

plus ›