forked from latentPrion/zambesii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced changes to the kernel's boot sequence in line with my curr…
…ent vision for a clean bootup. The kernel is being made into a much more microkernel-esque form factor, and soon it will be highly message passing, and far more organized. We now have Memory Management from very early on in the boot sequence. This is quickly followed by process spawning and threading, and soon by scheduling. Effectively, this causes the kernel to behave like a microkernel. We will strongly postpone the initialization of IRQs, since our original reason for initializing IRQs so early was to facilitate the early petting of watchdog devices. Instead, we will require that chipsets with watchdog devices include some kind of mechanism for ensuring that they pet their own watchdog device in a chipset-specific manner, which the kernel is not required to know about. This enables us to offload all chipset/device related setup to much later on in the boot sequence. This patch also sees the end of the __korientation and __kcpuPowerOn sequences as identifiable thread entities, and demotes them to execution sequences only. We've removed completely all ground for per-CPU threads to stand on, in their /former/ appearance. They are now quite literally addressable per-CPU thread objects. Each CPU has its own pCPU thread. Over the next few patches, we should have stabilized this new per-CPU threading format, and thereby stabilized the entire kernel source. I will split the changes in this patch into 3 main sections. Per-CPU Threads: CpuStream: * Renamed CpuStream::baseInit() to CpuStream::initializeBaseState(). * Split CpuStream::initializeBaseState() into base state initialization (GDT + CpuStream pointer load into DR0), and exception initialization. __korientation and __kcpuPowerOn: * __korientation has generally been removed. * __korientationPowerStack has been offloaded into a global symbol and we can now retrieve it through the global. * New abstraction for the BSP CPU: We need at various times to know whether or not it is the first time the BSP CPU is being detected or initialized. Previously the logic for determining this was mediocre and weak. Now we have introduced a proper set of states for specifying exactly which iteration of initialization or hotplug the BSP CPU is in. * Introduced FIRSTPLUG, HOTPLUG and NOTBSP state values. * Introduced matching state query methods into the CpuStream class. * As a result, removed all flags which previously indicated BSP status: (CPUSTREAM_FLAGS_BSP, and so on). * All CpuStream member objects and member classes take a BSP plug status variable in their constructors. Keep in mind that we can probably abstract this into a global. It is unlikely to change oft enough to require locking either. Or even be reference enough for locking on it to be a performance hindrance. * Every CPU now has its own PowerThread, and its own PowerStack. * MessageStream is now a member of Thread and not of _TaskContext. Kernel boot sequence: * DebugPipe __kdebug instance is initialized much earlier now, so we have printing very early on in the boot sequence. General: * New method to determine whether or not a CPU is the BSP CPU: CpuStream::isBspCpu(). * Class Stream is now a template and it accepts a parameter which determines the type of its member "parent" pointer. * We can later make this derive from a StreamBase class, which can be used for polymorphism, in whatever form we implement such polymorphism later on in the kernel.
- Loading branch information
1 parent
2f63ee1
commit 8804624
Showing
45 changed files
with
600 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.