redo boot around an explicit system volume and fixed kernel/HAL images, redo volumes and filesystem paths around capabilities instead of drive numbers and kernel CWD state, add a capability/security model with derived and revocable handles and security contexts, add port IPC and rssrv to manage the userspace resource namespace and publish the system volume, move process, dll and path loading to userspace and add process builder syscalls, init now supervises rssrv and the session process, redo the syscall ABI around request structs and four arguments, add a volume manager and proper partition arrival/removal handling so FAT and NTFS mount dynamically, clean up the HAL/DDK boundary so drivers don't depend on HAL internals, save fpu state properly now, the serial driver doesn't hang on a missing port, fix AHCI startup races, fix timeout accounting, fix shared mmap writeback, more smoke tests
This commit is contained in:
1 parent
4add6789ba
commit
f882d339fb
232 files changed
+20934
-8898
No files matched your search
+24
-17
@@ -2,8 +2,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ntlite/ddk/ddk.h>
|
||||
#include <ntlite/ddi/hal_api.h>
|
||||
#include <kernel/hal/hal_apic.h>
|
||||
#include <kernel/hal/hal_api.h>
|
||||
#include <kernel/io_ddk.h>
|
||||
#include <kernel/io_dma.h>
|
||||
#include <kernel/ke_audio.h>
|
||||
@@ -13,12 +12,13 @@
|
||||
#include <kernel/mm_pte.h>
|
||||
|
||||
static const HAL_API* gIoDdkHal;
|
||||
static uintptr_t gIoDdkPhysicalWindowBase;
|
||||
|
||||
// Returns the kernel direct-map alias for a physical address.
|
||||
static void* IoDdkPhysToVirt(uint64_t physicalAddress) {
|
||||
if (!gIoDdkHal || !gIoDdkHal->PhysToVirt)
|
||||
if (!gIoDdkPhysicalWindowBase || physicalAddress > UINTPTR_MAX - gIoDdkPhysicalWindowBase)
|
||||
return (void*)0;
|
||||
return gIoDdkHal->PhysToVirt(physicalAddress);
|
||||
return (void*)(gIoDdkPhysicalWindowBase + (uintptr_t)physicalAddress);
|
||||
}
|
||||
|
||||
// Maps one kernel page through the DDK memory surface.
|
||||
@@ -55,21 +55,28 @@ static void IoDdkPciWrite32(uint16_t segment,
|
||||
gIoDdkHal->Pci.Write32(segment, bus, device, function, offset, value);
|
||||
}
|
||||
|
||||
// Returns the BSP local APIC identifier.
|
||||
static uint32_t IoDdkGetBspLapicId(void) {
|
||||
return HalGetBspLapicId();
|
||||
}
|
||||
|
||||
// Returns whether the platform interrupt controller is using x2APIC mode.
|
||||
static uint8_t IoDdkIsX2ApicEnabled(void) {
|
||||
return HalApicUsingX2Apic();
|
||||
}
|
||||
|
||||
// Allocates one kernel IRQ slot for MSI delivery.
|
||||
static KSTATUS IoDdkAllocateMsiVector(uint8_t* outIrq) {
|
||||
return KeIrqAllocateMsiVector(outIrq);
|
||||
}
|
||||
|
||||
|
||||
// Composes one platform MSI message for an allocated nt-lite IRQ slot.
|
||||
static KSTATUS IoDdkComposeMsiMessage(uint8_t irq, NTL_DDK_MSI_MESSAGE* messageOut) {
|
||||
if (!gIoDdkHal || !messageOut || irq >= 24u)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
|
||||
HAL_MSI_MESSAGE message;
|
||||
KSTATUS status = gIoDdkHal->InterruptController.ComposeMsi((uint8_t)(0x20u + irq), &message);
|
||||
if (!KSUCCESS(status))
|
||||
return status;
|
||||
|
||||
messageOut->Address = message.Address;
|
||||
messageOut->Data = message.Data;
|
||||
messageOut->Reserved = 0;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static const NTL_DDK_DEBUG gIoDdkDebug = {
|
||||
.Print = DbgPrint,
|
||||
.GetFlags = KeGetDebugFlags,
|
||||
@@ -77,6 +84,7 @@ static const NTL_DDK_DEBUG gIoDdkDebug = {
|
||||
|
||||
static const NTL_DDK_INTERRUPT gIoDdkInterrupt = {
|
||||
.AllocateMsiVector = IoDdkAllocateMsiVector,
|
||||
.ComposeMsiMessage = IoDdkComposeMsiMessage,
|
||||
};
|
||||
|
||||
static const NTL_DDK_MEMORY gIoDdkMemory = {
|
||||
@@ -87,8 +95,6 @@ static const NTL_DDK_MEMORY gIoDdkMemory = {
|
||||
static const NTL_DDK_PLATFORM gIoDdkPlatform = {
|
||||
.PciRead32 = IoDdkPciRead32,
|
||||
.PciWrite32 = IoDdkPciWrite32,
|
||||
.GetBspLapicId = IoDdkGetBspLapicId,
|
||||
.IsX2ApicEnabled = IoDdkIsX2ApicEnabled,
|
||||
};
|
||||
|
||||
static const NTL_DDK_SCHEDULER gIoDdkScheduler = {
|
||||
@@ -114,8 +120,9 @@ static NTL_DDK gIoDdk = {
|
||||
};
|
||||
|
||||
// Initializes the kernel-owned DDK table from platform services.
|
||||
void IoInitializeDdk(const HAL_API* hal) {
|
||||
void IoInitializeDdk(const HAL_API* hal, uintptr_t physicalWindowBase) {
|
||||
gIoDdkHal = hal;
|
||||
gIoDdkPhysicalWindowBase = physicalWindowBase;
|
||||
gIoDdk.Audio = KeAudioGetDdk();
|
||||
gIoDdk.Dma = IoGetDmaDdk();
|
||||
gIoDdkTimer.QueryTicks = hal ? hal->Timer.QueryTicks : 0;
|
||||
|
||||
Reference in new issue
Block a user