#
✕ nick:modwizcode
#asahi-dev · 2021-02-14 16:07
modwizcodeit's a pretty neat little minimal threading system
#asahi-dev · 2021-02-14 16:07
modwizcodeI should finish my documentation of some of the OS primitives in IOS
#asahi-dev · 2021-02-14 16:07
modwizcodeYeah I think so. I follow some random IOS emulation related issue still on the github
#asahi-dev · 2021-02-14 16:07
modwizcodeYou posted the skyeye stuff eventually but that was about it
#asahi-dev · 2021-02-14 16:07
modwizcodeI looked for more info anyway ;)
#asahi-dev · 2021-02-14 16:06
modwizcodeyeah I don't think you ever actually fully discussed that anywhere
#asahi-dev · 2021-02-14 16:06
modwizcodeor was that you throwing dolphin+skyeye together?
#asahi-dev · 2021-02-14 16:06
modwizcodeI think I tried to look at that once but I don't know if I really dug in enough
#asahi-dev · 2021-02-14 16:05
modwizcodeQEMU->CXXRTL+SPICE ;p
#asahi-dev · 2021-02-14 16:04
modwizcodeI agree though that it will likely be stubs
#asahi-dev · 2021-02-14 16:04
modwizcodeIt would be pointless to just emulate enough for Linux to work since there's already plenty of non-apple ARM64 platforms in QEMU.
#asahi-dev · 2021-02-14 16:03
modwizcodeAt least until I'm aware of exactly what can be relaxed.
#asahi-dev · 2021-02-14 16:02
modwizcodeThe point of my work on emulation is partially to allow as indistinguishable from hardware as is reasonably possible
#asahi-dev · 2021-02-14 15:59
modwizcodeI have no experience with USB stuff directly, is that something kind of standard, but vendor specific?
#asahi-dev · 2021-02-14 15:58
modwizcodemarcan: have you played with the USB controllers at all? I'm probably going to throw a dwc3 peripheral at the right address and export it in the device tree, hopefully I don't need to add apple specific quirks.
#asahi-dev · 2021-02-14 15:56
modwizcodeThe sanest way is to abuse the thread local "current_cpu" variable and hope that the mmio access is from the same thread (which seems to be always true for now but it's a hack). Defining core local memory maps is possible, but then the peripheral can't control the mapping fully so the code ends up all over the place.
#asahi-dev · 2021-02-14 15:55
modwizcodeThe biggest issue I've encountered was with working on AIC. There's no proper way to sanely define core local aliases.
#asahi-dev · 2021-02-14 15:54
modwizcodein fact there's hardly any convention for anything in qemu. even file names are randomly distributed between "-" seperators and "_"
#asahi-dev · 2021-02-14 15:54
modwizcodeBut there's very little convention for this.
#asahi-dev · 2021-02-14 15:53
modwizcodeI'm trying to not couple things to the "M1" code (as I refer to the SoC device complex) since I'm assuming that future SoC's will potentially be different enough to merit their own distinct SoC
#asahi-dev · 2021-02-14 15:52
modwizcodeIdk how much you know about qemu but given what you know about the core, do you think it will end up being best to put those register defs in their own "apple core" specific CPU handling file? Or just stuff them in with the 64-bit core types?
#asahi-dev · 2021-02-14 15:50
modwizcodeokay I guess that's more semantics. It's part of a register that has some chicken bits isn't it? Or maybe just my confusion
#asahi-dev · 2021-02-14 15:47
modwizcodeI've been wondering how much to emulate the chicken bit registers. I think some of them I'll have to emulate for real (Fast IPIs) the rest probably need minor emulator so I can get "read as written" which requires handler support in QEMU I think
#asahi-dev · 2021-02-14 15:46
modwizcodeThat's... interesting
#asahi-dev · 2021-02-13 04:24
modwizcodedidn't winocm have some project related to this?
#asahi-dev · 2021-02-13 04:24
modwizcodeThat's the one peripheral they provide an example driver structure for too :p
#asahi-dev · 2021-02-13 04:24
modwizcodeYeah but I can write an AIC driver :p
#asahi-dev · 2021-02-13 01:27
modwizcodeStill need to add bounds checking
#asahi-dev · 2021-02-13 01:27
modwizcodeAh I just screwed up the script when I was trying to solve the policy issue. Works on the emulator now.
#asahi-dev · 2021-02-13 01:23
modwizcodeit's the conversion step... hmm
#asahi-dev · 2021-02-13 01:11
modwizcodehmm no that still doesn't quite look right
#asahi-dev · 2021-02-13 01:05
modwizcodeAlso on qemu it uh... causes some issues but I think it's assuming a bigger display, it shouldn't assume the display size but I'll test with a larger one and comment on the PR if I figure anything out, could be a bug I don't know
#asahi-dev · 2021-02-13 01:05
modwizcodeI fixed it but I think another way probably should be found there's a good reason for that policy choice
#asahi-dev · 2021-02-13 01:04
modwizcodeThat font thing caused an issue because by default imagemagick (at least on Ubuntu 20.10) has a policy denying file read or something
#asahi-dev · 2021-02-12 19:56
modwizcodeYeah there is some stuff that I think is there for startup that might expose little differences. Parsing through the code is difficult with how spreadout it is, it actually is sometimes a lot better to throw it at the emulator and look for failures
#asahi-dev · 2021-02-12 19:53
modwizcodeOne thing I'm actually planning to do at some point here is compile the open source release of Xnu and throw it at the emulator. From what I understand there's few to no drivers in that source though, but I think there's Darwin port projects that might be able to supply some basic drivers (or I could probably write my own for serial port at least)
#asahi-dev · 2021-02-12 19:51
modwizcodeLuckily other people do and it's not too hard to compile and test so in the future that will not be a problem
#asahi-dev · 2021-02-12 19:51
modwizcodeI can't do that testing myself because I don't have a mac of my own to legally do that with
#asahi-dev · 2021-02-12 19:51
modwizcodeThat's the other issue
#asahi-dev · 2021-02-12 19:51
modwizcodeA lot of stuff will need to be understood better though. The M1 cpu cores have features that are not documented at all, and macOS certainly will use them.
#asahi-dev · 2021-02-12 19:50
modwizcodeThat's the goal eventually. I think it's key to understanding the hardware to have a parallel functional implementation based on that understanding. If the drivers + emulation != results that are expected, it means somewhere something is wrong.
#asahi-dev · 2021-02-12 19:38
modwizcodeTheoretically because Linux has drivers for a ton of stuff at this point you can just plug in whatever you want on the QEMU side and then tell linux about it via device tree, but that's not my goal since that isn't a true emulation of an M1 mac and it would be useless for running something like macOS
#asahi-dev · 2021-02-12 19:37
modwizcodeBut at this point I expect a lot of overlap with existing peripherals (at least higher level ones), like I'm hoping I can reuse the NVMe peripheral code
#asahi-dev · 2021-02-12 19:36
modwizcodeHave to wait for more hardware docs I think though.
#asahi-dev · 2021-02-12 19:36
modwizcodeEventually yes
#asahi-dev · 2021-02-12 19:29
modwizcodeIt's fun to see the IPIs firing as I do stuff. You can see that linux assigns the IRQs for the serial port to go to cpu0, then when you type a character you see an IPI fire from cpu0 to another core for each character
#asahi-dev · 2021-02-12 19:28
modwizcodeIf marcan gets the big.LITTLE thing working it should show up correctly too (hopefully anyway) since they're exposed with the correct IDs and everything
#asahi-dev · 2021-02-12 19:28
modwizcodeYes indeed :)
#asahi-dev · 2021-02-12 19:27
modwizcodeI need to get it to present a more complete ADT to get a vanilla build of M1N1 to boot with it though, I've got a fork of M1N1 that works but it's just for testing.
#asahi-dev · 2021-02-12 19:26
modwizcodeI'm not very happy with a lot of the code because it seems really inefficient in a lot of places, but that can always be resolved later.

plus ›