#
✕ nick:marcan
#asahi-dev · 2021-01-27 12:28
marcan:)
#asahi-dev · 2021-01-27 12:28
marcanI disagree
#asahi-dev · 2021-01-27 12:28
marcanI'm 99% sure we will be able to build good tooling to do this
#asahi-dev · 2021-01-27 12:28
marcanthere's just lots of bugs because apple rushed this all out
#asahi-dev · 2021-01-27 12:28
marcanthere are APIs for importing user stuff to a new install, or for adopted installs
#asahi-dev · 2021-01-27 12:27
marcanyes and no
#asahi-dev · 2021-01-27 12:27
marcanhowever, we can build tooling to avoid that
#asahi-dev · 2021-01-27 12:27
marcanright *now*, you'd have to install macos, make a user, then remove all the garbage and shrink the partition once demoted
#asahi-dev · 2021-01-27 12:26
marcanI will be doing minimal stub boot partitions without a full macos
#asahi-dev · 2021-01-27 12:26
marcanno
#asahi-dev · 2021-01-27 12:26
marcanso then whatever you bootload ends up in the same context
#asahi-dev · 2021-01-27 12:26
marcanyes but you can't *switch* contexts
#asahi-dev · 2021-01-27 12:25
marcanwhen there is a perfectly fine embedded secure element
#asahi-dev · 2021-01-27 12:25
marcanI don't want to have to buy typeC yubikeys and have them eat one port on these macs
#asahi-dev · 2021-01-27 12:25
marcanbecause it's useful
#asahi-dev · 2021-01-27 12:25
marcanwell yes, but macos does that, and I intend to do that too
#asahi-dev · 2021-01-27 12:25
marcanwhich isn't really how things are intended to work
#asahi-dev · 2021-01-27 12:25
marcanthe problem is you're running multiple OSes under one OS context from the firmware's point of view then
#asahi-dev · 2021-01-27 12:24
marcanwell... that's not the approach I'm interested in but have fun :p
#asahi-dev · 2021-01-27 12:24
marcanif you really wanted to do this
#asahi-dev · 2021-01-27 12:24
marcanso you could copy out updates from there
#asahi-dev · 2021-01-27 12:24
marcanfrom linux though, sure
#asahi-dev · 2021-01-27 12:24
marcanas long as you can read APFS, yes, but I'm not putting APFS into m1n1 :p
#asahi-dev · 2021-01-27 12:23
marcanI think the only people interested in this should be people who want to mess around with the darwin kernelcache
#asahi-dev · 2021-01-27 12:22
marcanbecause people will want to be able to do secure macos boot, we should't mix the OSes
#asahi-dev · 2021-01-27 12:22
marcannot reuse a single macos one
#asahi-dev · 2021-01-27 12:22
marcanalso I intend to use a different APFS boot structure for linux anyway
#asahi-dev · 2021-01-27 12:22
marcannever_released: well, we need to do that every update anyway, unless we implement APFS support; at that point it makes more sense to just copy the macOS kernelcache to the linux boot partition as part of the install process I think
#asahi-dev · 2021-01-27 12:21
marcankettenis: yup
#asahi-dev · 2021-01-27 12:08
marcanas long as whatever file format it is has a length (though since the memory is padded with zeroes, we could heuristically use that too, but we should probably not go there)
#asahi-dev · 2021-01-27 12:07
marcanbut m1n1 can copy it out to a more-aligned buffer if we need that for something
#asahi-dev · 2021-01-27 12:06
marcanah yeah 16K
#asahi-dev · 2021-01-27 12:06
marcanmaybe 16K? definitely no smaller than that
#asahi-dev · 2021-01-27 12:06
marcanKASLR alignment from iBoot is 64K as far as I can tell, and we can preserve that in the mach-o
#asahi-dev · 2021-01-27 11:55
marcanfile layout is [m1n1 macho text/rodata/data][payload], memory layout is [firmwares and stuff iBoot puts in RAM][ASLR padding][m1n1 macho text/rodata/data][m1n1 bss][payload..... pad to 64MB][things iBoot passes us, cmdline, adt, etc][free memory.......][framebuffer and maybe other things][top of RAM]
#asahi-dev · 2021-01-27 11:52
marcanshould be able to have a single binary build that does everything this way
#asahi-dev · 2021-01-27 11:52
marcanthis also means I can have a lot of fun with payload formats, e.g. embed a command script by cating it on, very very convenient for end users
#asahi-dev · 2021-01-27 11:51
marcanjust cat it on
#asahi-dev · 2021-01-27 11:51
marcanso we can have up to a 64MB payload with that, no problem
#asahi-dev · 2021-01-27 11:51
marcanI tested up to a 64MB dummy segment off the end of the file and iBoot is perfectly happy with it (and it does not impact boot times visibly)
#asahi-dev · 2021-01-27 11:50
marcanthat means our payload insertion tool is now officially `cat`
#asahi-dev · 2021-01-27 11:50
marcan3) instead, it helpfully behaves as if the load filesize was truncated to the end of the machofile, and zeroes out the rest of the buffer
#asahi-dev · 2021-01-27 11:50
marcan2) iBoot does not panic if a segment load overlaps the end of the file
#asahi-dev · 2021-01-27 11:49
marcan1) iBoot does indeed do proper mach-o loading, and supports noncontiguous segment loads
#asahi-dev · 2021-01-27 11:49
marcanso it turns out
#asahi-dev · 2021-01-27 11:49
marcanohh this is *excellent*!
#asahi-dev · 2021-01-27 11:35
marcanthe m1 does not support nested VM as far as I know
#asahi-dev · 2021-01-27 11:20
marcanactually, I wonder if that works as intended, let me try something
#asahi-dev · 2021-01-27 11:20
marcanprobably just patching a single number in the macho with the payload size
#asahi-dev · 2021-01-27 11:20
marcanbut not a big deal

plus ›