ChanServ changed the topic of #asahi-re to: Asahi Linux: porting Linux to Apple Silicon macs | Hardware / boot process / firmware interface reverse engineering | WARNING: this channel (only) may contain binary reverse engineering discussion | RE policy: https://alx.sh/re (MANDATORY READ) | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-re
mofux[m] has joined #asahi-re
<nik875[m]> alright i watched one of marcan's streams and got as far as attempting to change boot policy for a second macos installation on my target device
<nik875[m]> running bputil -nkcas in 1tr gave me this error:
<nik875[m]> Boot objects update failed for /Volumes/macOS RE: Error Domain=BYErrorDomain Code=401 "Failed to create local policy" UserInfo=(NSLocalizedDescription=Failed to create local policy, NSUnderlyingError=®x60000009d380 (Error Domain=com.apple.bootpolicy Code=11 "AP boot mode (11)" UserInfo={NSLocalizedDescription=AP boot mode (11)}}}
<nik875[m]> anyone know what might be going on here
<nik875[m]> * on here?
AlbertoBasaglia[m] has joined #asahi-re
joerosenberg[m] has joined #asahi-re
dani0611[m] has joined #asahi-re
nunoxyz[m] has joined #asahi-re
<nik875[m]> possibly more helpful error from when i tried to run csrutil disable:... (full message at https://matrix.org/_matrix/media/r0/download/matrix.org/gpGIEiXTVFaBESwsGxDUgHEv)
<chadmed> you need to bless the partition youre trying to change the boot policy for so that its the nominated startup disk
<nik875[m]> so do the option-click thing for always use?
<chadmed> on versions of macOS >12.0, the system-wide 1TR is no longer used and the SEP "pairs" the recovery from the nominated startup disk to be the 1TR environment. if you try to change security settings on a volume that isnt paired to that particular rOS then it doesnt work
<chadmed> yep
ceinem has quit [Quit: Textual IRC Client: www.textualapp.com]
<amarioguy> nik875[m]: make sure you're in 1TR
<amarioguy> oh lol it's answered nvm
<nik875[m]> another error at the same step, running csrutil disable gives:
<nik875[m]> The OS environment does not allow changing security configuration options.
<marcan> you're not in 1tr
<marcan> "AP boot mode" means it's not 1TR
<marcan> that means you didn't do the power button hold dance properly
<nik875[m]> okay okay hang on
<nik875[m]> i thought that you held the power button for 5 seconds during startup to go to startup options
<marcan> yes, you do
<nik875[m]> then you select options to enter macos recovery, then select the second macos installation
<marcan> but if you double tap it, accidentally release it, etc. you can end up in startup options that is *not* 1TR
<marcan> 1TR is not just "startup options"
<nik875[m]> huh
<marcan> 1TR is a very specific mode that is more stringent in the exact thing you did
<nik875[m]> that's probably the issue then lol, lemme try again
<marcan> make sure the machine is fully off, wait a few extra seconds
<marcan> then press once and do not let go until startup options appears
<marcan> the pairing thing is something else; you can only change boot settings for the volume that is currently the default boot volume. both are required.
<marcan> one way to end up in both of those situations is to double-tap power. that gets you into system recoveryOS, which is neither 1TR nor paired to anything
<marcan> so that could be what you did
<nik875[m]> Out of curiosity, is there any way to tell once you’re in recoveryOS whether it’s 1tr?
<marcan> `bputil -d` should tell you
<marcan> look for "Current OS environment:"
<marcan> one of 'macOS', 'one true recoveryOS', 'recoveryOS'
<marcan> could be "OS Type" instead, in another version
<nik875[m]> marcan: that worked, thanks!
<nik875[m]> next question i have is how to install m1n1 as a custom boot object, does that just mean run the asahi installer for m1n1?
<nik875[m]> or is there some special configuration that links m1n1 to the macos partition?
<amarioguy> nik875[m]: nowadays i believe you just allocate some free space and the asahi installer will more or less do it for you
<amarioguy> but you can use kmutil to do it as well, if for example the partition you wish to associate m1n1 with is a macOS install
<amarioguy> kmutil configure-boot will have the details (entry-point is 2048, lowest-virtual-address is 0
<nik875[m]> I used kmutil on the macOS partition according to the hypervisor documentation, is that what you mean?
<amarioguy> hm?
<amarioguy> what was the command you used
<nik875[m]> Kmutil create with a lot of options that I copy pasted
<amarioguy> oh no
<amarioguy> this needs to be done from 1tr again
<nik875[m]> Rip lol, what’s wrong with that?
<amarioguy> the hypervisor page is what creates a kernelcache
<amarioguy> that command is for linking the kernel/kexts together to make a dev kernelcache that's bootable with m1n1
<amarioguy> so you can use symbols apple provides via the KDK
<nik875[m]> Is that not what we want lol?
<amarioguy> that's what you want if you need to create a kernelcache
<amarioguy> your question was to install a custom boot object
<amarioguy> you need to be in 1tr to actually install the custom boot object
<nik875[m]> Well yes, installing a custom boot object is part of the documentation for setting up the hypervisor
<amarioguy> you're on step 4 right?
<nik875[m]> Yes
<amarioguy> creating the kernelcache is one thing, setting m1n1 as a custom boot object is another (the command to set the boot object is kmutil configure-boot -c [path to m1n1.bin] --entry-point 2048 --lowest-virtual-address 0)
<amarioguy> remember that you need to be in 1tr to *actually set* the boot object
PhilippvK has joined #asahi-re
<nik875[m]> Where is the m1n1 bin? The build from the repo is supposed to be on the host machine I thought?
<chadmed> you have to copy it over to the rOS environment somehow
<amarioguy> ^
<chadmed> you can either use scp or start the python http server in the build dir and use curl
<amarioguy> i believe macOS volumes are accessible from rOS too
<nik875[m]> Huh okay, I can scp it
phiologe has quit [Ping timeout: 480 seconds]
<nik875[m]> Missing the —volume argument it seems
<amarioguy> btw i can say now that from very very initial testing
<amarioguy> m2 does in fact support maintenance interrupts now lol
<amarioguy> idk if this was found out already but here you go
<nik875[m]> nik875[m]: Also says “could not find mount point” when I select the correct volume, even after running diskutil mount
<amarioguy> (on maintenance interrupts ICH_MISR_EL2 is configurable and register changes behaves as the spec says it should, furthermore having maintenance interrupts pending and enabling virtual interrupts results in an interrupt storm as there's no handling for this)
<amarioguy> in m1n1 anyways
<amarioguy> nik875[m]: general dev questions usually go in asahi-dev
<nik875[m]> Kk
doggkruse has joined #asahi-re
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<marcan> you don't need to create a kernelcache, you can just use a retail one
<marcan> we need to stop pushing that story, 99% of the time it's not necessary. I haven't used dev kernelcaches in forever.
<marcan> those were only useful for some really early hypervisor debugging
bisko has joined #asahi-re
CatDentures has joined #asahi-re
nicolas17 has quit [Ping timeout: 480 seconds]
eeqk[m] has joined #asahi-re
MajorBiscuit has joined #asahi-re
everfree has quit [Quit: leaving]
everfree has joined #asahi-re
the_lanetly_052 has joined #asahi-re
<j`ey> amarioguy: interesting, do you have linux running? maybe you can try enable the maint irq, if not maybe markan or jann4u can
MajorBiscuit has quit [Quit: WeeChat 3.5]
TiangangYang[m] has joined #asahi-re
dingodoppelt_ has quit [Quit: ZNC 1.9.x-git-170-9be0cae1 - https://znc.in]
dingodoppelt has joined #asahi-re
<amarioguy> j'ey: i can do enablement on that sure
<amarioguy> still gotta fix the i2c stuff as well anyways so i can do this soon enough
<amarioguy> though i do want to do some more testing on this before i commit to making the patch series lol
CatDentures has quit [Quit: leaving]
MajorBiscuit has joined #asahi-re
<marcan> you want to talk to maz (who isn't here) about the kvm stuff
<amarioguy> gotcha
Guest6943 has quit []
DragoonAethis has joined #asahi-re
mini0n has joined #asahi-re
nicolas17 has joined #asahi-re
duban has quit [Ping timeout: 480 seconds]
duban has joined #asahi-re
doggkruse has joined #asahi-re
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doggkruse has joined #asahi-re
MajorBiscuit has quit [Ping timeout: 480 seconds]
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doggkruse has joined #asahi-re
the_lanetly_052 has quit [Ping timeout: 480 seconds]
MajorBiscuit has joined #asahi-re
mini0n has quit [Read error: Connection reset by peer]
doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doggkruse has joined #asahi-re
MajorBiscuit has quit [Ping timeout: 480 seconds]
nsklaus_ has quit [Read error: Connection reset by peer]
nsklaus has joined #asahi-re
nsklaus has quit [Read error: Connection reset by peer]
nsklaus has joined #asahi-re
MajorBiscuit has joined #asahi-re
MajorBiscuit has quit [Ping timeout: 480 seconds]
surgeon[m] has joined #asahi-re