Commit Graph

10 Commits

Author SHA1 Message Date
Elliot Nunn
6c199998f0 Lots of work on Address Spaces 2018-04-27 21:52:08 +08:00
Elliot Nunn
dd4e2ef845 Reverse PPC-68k context switching (incomplete) 2018-04-15 17:00:11 +08:00
Elliot Nunn
123c1e4bee Work on the scheduler and interrupt handling code 2018-03-30 10:27:12 +08:00
Elliot Nunn
c7d4cdd367 Reverse power management functions
This is part of the work to get the mini running well. The
kcPowerDispatch and kcCacheDispatch entry points were explored. The dead
code implementing a Timer "Heartbeat" was also used to label some
structures better.
2018-03-17 20:24:02 +08:00
Elliot Nunn
7bee860e40 Reverse the CPU plugin mechanism
CPU plugins are code fragment resources that allow the NanoKernel to
perform CPU-specific functions, such as starting or stopping a processor
core or getting core temperature. They live in the Apple CPU Plugins
file. The Power Manager selects a plugin at boot (or doesn't), prepares
and holds it in memory, and registers it with the NanoKernel using
MPRegisterCpuPlugin(). The NanoKernel can then call any of the plugin's
entry points synchronously using its SIGP() function, which is also
exposed via the MPCpuPlugin() call. The plugin return path is tricky,
but involved the ReturnFromInterrupt trap instruction in the emulator
ROM code.

The CPU plugin calling convention is described in the SIGP comments. CPU
plugins operate in the blue address space, but with interrupts disabled
and supervisor mode on.

This code was reversed to get the Mac mini working. It is not clear how
the Power Manager determines CPU temperature when there are no CPU
registers to do this.
2018-03-09 20:30:37 +08:00
Elliot Nunn
7fdc813d8f Reverse userspace sync primitives
Namely queues, semaphores, critical regions, event groups and
"notifications". The MP calls implementing these services have been
named after their MPLibrary wrapper functions. This convention will be
followed in the future (no more NKCreateEvent).
2018-02-18 01:24:20 +08:00
Elliot Nunn
f0696e5ceb Fix a mistake with the coherence group structure
There is a global linked list of all coherence groups. Coherence groups
and CPUs have a one-to-many relationship.
2018-02-18 01:24:20 +08:00
Elliot Nunn
423b809e87 Update Area struct
Most Area fields and flags now have meaningful names, thanks largely to
Daniel's reversal work.
2018-02-18 01:24:19 +08:00
Elliot Nunn
b27256fbb6 Reverse Event Group MP calls 2018-02-18 01:24:18 +08:00
Elliot Nunn
c5c5b784cb Initial commit 2018-02-18 01:24:10 +08:00