mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-14 00:39:16 +00:00
Kernel/memory-test
This commit is contained in:
@ -1,343 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <driver.hpp>
|
||||
|
||||
#include <memory.hpp>
|
||||
#include <ints.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../kernel.h"
|
||||
#include "../../DAPI.hpp"
|
||||
#include "../../Fex.hpp"
|
||||
#include "api.hpp"
|
||||
|
||||
NewLock(DriverInitLock);
|
||||
NewLock(DriverInterruptLock);
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
void Driver::Panic()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
size_t DriversNum = Drivers.size();
|
||||
debug("%ld drivers loaded, [DUIDs: %ld]", DriversNum, DriverUIDs);
|
||||
debug("driver size %ld", DriversNum);
|
||||
#endif
|
||||
|
||||
foreach (auto drv in Drivers)
|
||||
{
|
||||
KernelCallback callback{};
|
||||
callback.Reason = StopReason;
|
||||
DriverManager->IOCB(drv.DriverUID, &callback);
|
||||
|
||||
for (size_t j = 0; j < sizeof(drv.InterruptHook) / sizeof(drv.InterruptHook[0]); j++)
|
||||
{
|
||||
if (!drv.InterruptHook[j])
|
||||
continue;
|
||||
drv.InterruptHook[j]->Disable();
|
||||
debug("Interrupt hook %#lx disabled", drv.InterruptHook[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Driver::UnloadAllDrivers()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
size_t DriversNum = Drivers.size();
|
||||
debug("%ld drivers loaded, [DUIDs: %ld]", DriversNum, DriverUIDs);
|
||||
debug("driver size %ld", DriversNum);
|
||||
#endif
|
||||
|
||||
foreach (auto drv in Drivers)
|
||||
{
|
||||
KernelCallback callback{};
|
||||
callback.Reason = StopReason;
|
||||
debug("Stopping & unloading driver %ld [%#lx]", drv.DriverUID, drv.Address);
|
||||
DriverManager->IOCB(drv.DriverUID, &callback);
|
||||
|
||||
for (size_t j = 0; j < sizeof(drv.InterruptHook) / sizeof(drv.InterruptHook[0]); j++)
|
||||
{
|
||||
if (!drv.InterruptHook[j])
|
||||
continue;
|
||||
debug("Interrupt hook %#lx", drv.InterruptHook[j]);
|
||||
delete drv.InterruptHook[j], drv.InterruptHook[j] = nullptr;
|
||||
}
|
||||
if (drv.MemTrk)
|
||||
delete drv.MemTrk, drv.MemTrk = nullptr;
|
||||
}
|
||||
Drivers.clear();
|
||||
}
|
||||
|
||||
bool Driver::UnloadDriver(unsigned long DUID)
|
||||
{
|
||||
debug("Searching for driver %ld", DUID);
|
||||
|
||||
foreach (auto drv in Drivers)
|
||||
{
|
||||
if (drv.DriverUID == DUID)
|
||||
{
|
||||
KernelCallback callback{};
|
||||
callback.Reason = StopReason;
|
||||
debug("Stopping and unloading driver %ld [%#lx]", drv.DriverUID, drv.Address);
|
||||
this->IOCB(drv.DriverUID, &callback);
|
||||
|
||||
for (size_t j = 0; j < sizeof(drv.InterruptHook) / sizeof(drv.InterruptHook[0]); j++)
|
||||
{
|
||||
if (!drv.InterruptHook[j])
|
||||
continue;
|
||||
debug("Interrupt hook %#lx", drv.InterruptHook[j]);
|
||||
delete drv.InterruptHook[j], drv.InterruptHook[j] = nullptr;
|
||||
}
|
||||
delete drv.MemTrk, drv.MemTrk = nullptr;
|
||||
Drivers.remove(drv);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int Driver::IOCB(unsigned long DUID, void *KCB)
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
if (Drv.DriverUID == DUID)
|
||||
{
|
||||
FexExtended *DrvExtHdr = (FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS);
|
||||
int ret = ((int (*)(void *))((uintptr_t)DrvExtHdr->Driver.Callback + (uintptr_t)Drv.Address))(KCB);
|
||||
__sync;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
DriverCode Driver::CallDriverEntryPoint(void *fex, void *KAPIAddress)
|
||||
{
|
||||
memcpy(KAPIAddress, &KernelAPITemplate, sizeof(KernelAPI));
|
||||
|
||||
((KernelAPI *)KAPIAddress)->Info.Offset = (unsigned long)fex;
|
||||
((KernelAPI *)KAPIAddress)->Info.DriverUID = DriverUIDs++;
|
||||
((KernelAPI *)KAPIAddress)->Info.KernelDebug = DebuggerIsAttached;
|
||||
|
||||
#ifdef DEBUG
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
debug("DRIVER: %s HAS DRIVER ID %ld", fexExtended->Driver.Name, ((KernelAPI *)KAPIAddress)->Info.DriverUID);
|
||||
#endif
|
||||
|
||||
debug("Calling driver entry point ( %#lx %ld )", (unsigned long)fex, ((KernelAPI *)KAPIAddress)->Info.DriverUID);
|
||||
int ret = ((int (*)(KernelAPI *))((uintptr_t)((Fex *)fex)->EntryPoint + (uintptr_t)fex))(((KernelAPI *)KAPIAddress));
|
||||
|
||||
if (DriverReturnCode::OK != ret)
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
return DriverCode::OK;
|
||||
}
|
||||
|
||||
DriverCode Driver::LoadDriver(uintptr_t DriverAddress, uintptr_t Size)
|
||||
{
|
||||
Fex *DrvHdr = (Fex *)DriverAddress;
|
||||
if (DrvHdr->Magic[0] != 'F' || DrvHdr->Magic[1] != 'E' || DrvHdr->Magic[2] != 'X' || DrvHdr->Magic[3] != '\0')
|
||||
{
|
||||
if (Size > 0x1000)
|
||||
{
|
||||
Fex *ElfDrvHdr = (Fex *)(DriverAddress + 0x1000);
|
||||
if (ElfDrvHdr->Magic[0] != 'F' || ElfDrvHdr->Magic[1] != 'E' || ElfDrvHdr->Magic[2] != 'X' || ElfDrvHdr->Magic[3] != '\0')
|
||||
return DriverCode::INVALID_FEX_HEADER;
|
||||
else
|
||||
{
|
||||
debug("Fex Magic: \"%s\"; Type: %d; OS: %d; EntryPoint: %#lx", ElfDrvHdr->Magic, ElfDrvHdr->Type, ElfDrvHdr->OS, ElfDrvHdr->EntryPoint);
|
||||
|
||||
if (ElfDrvHdr->Type == FexFormatType::FexFormatType_Driver)
|
||||
{
|
||||
FexExtended *ElfDrvExtHdr = (FexExtended *)((uintptr_t)ElfDrvHdr + EXTENDED_SECTION_ADDRESS);
|
||||
debug("Name: \"%s\"; Type: %d; Callback: %#lx", ElfDrvExtHdr->Driver.Name, ElfDrvExtHdr->Driver.Type, ElfDrvExtHdr->Driver.Callback);
|
||||
|
||||
if (ElfDrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_PCI)
|
||||
return this->DriverLoadBindPCI(ElfDrvExtHdr, DriverAddress, Size, true);
|
||||
else if (ElfDrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_INTERRUPT)
|
||||
return this->DriverLoadBindInterrupt(ElfDrvExtHdr, DriverAddress, Size, true);
|
||||
else if (ElfDrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_PROCESS)
|
||||
return this->DriverLoadBindProcess(ElfDrvExtHdr, DriverAddress, Size, true);
|
||||
else if (ElfDrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_INPUT)
|
||||
return this->DriverLoadBindInput(ElfDrvExtHdr, DriverAddress, Size, true);
|
||||
else
|
||||
error("Unknown driver bind type: %d", ElfDrvExtHdr->Driver.Bind.Type);
|
||||
}
|
||||
else
|
||||
return DriverCode::NOT_DRIVER;
|
||||
}
|
||||
}
|
||||
else
|
||||
return DriverCode::INVALID_FEX_HEADER;
|
||||
}
|
||||
debug("Fex Magic: \"%s\"; Type: %d; OS: %d; EntryPoint: %#lx", DrvHdr->Magic, DrvHdr->Type, DrvHdr->OS, DrvHdr->EntryPoint);
|
||||
|
||||
if (DrvHdr->Type == FexFormatType::FexFormatType_Driver)
|
||||
{
|
||||
FexExtended *DrvExtHdr = (FexExtended *)((uintptr_t)DrvHdr + EXTENDED_SECTION_ADDRESS);
|
||||
debug("Name: \"%s\"; Type: %d; Callback: %#lx", DrvExtHdr->Driver.Name, DrvExtHdr->Driver.Type, DrvExtHdr->Driver.Callback);
|
||||
|
||||
if (DrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_PCI)
|
||||
return this->DriverLoadBindPCI(DrvExtHdr, DriverAddress, Size);
|
||||
else if (DrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_INTERRUPT)
|
||||
return this->DriverLoadBindInterrupt(DrvExtHdr, DriverAddress, Size);
|
||||
else if (DrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_PROCESS)
|
||||
return this->DriverLoadBindProcess(DrvExtHdr, DriverAddress, Size);
|
||||
else if (DrvExtHdr->Driver.Bind.Type == DriverBindType::BIND_INPUT)
|
||||
return this->DriverLoadBindInput(DrvExtHdr, DriverAddress, Size);
|
||||
else
|
||||
error("Unknown driver bind type: %d", DrvExtHdr->Driver.Bind.Type);
|
||||
}
|
||||
else
|
||||
return DriverCode::NOT_DRIVER;
|
||||
return DriverCode::ERROR;
|
||||
}
|
||||
|
||||
Driver::Driver()
|
||||
{
|
||||
SmartCriticalSection(DriverInitLock);
|
||||
|
||||
std::string DriverConfigFile = Config.DriverDirectory;
|
||||
DriverConfigFile << "/config.ini";
|
||||
fixme("Loading driver config file: %s", DriverConfigFile.c_str());
|
||||
|
||||
VirtualFileSystem::File DriverDirectory = vfs->Open(Config.DriverDirectory);
|
||||
if (DriverDirectory.IsOK())
|
||||
{
|
||||
foreach (auto driver in DriverDirectory.node->Children)
|
||||
if (driver->Flags == VirtualFileSystem::NodeFlags::FILE)
|
||||
if (cwk_path_has_extension(driver->Name))
|
||||
{
|
||||
const char *extension;
|
||||
size_t extension_length;
|
||||
cwk_path_get_extension(driver->Name, &extension, &extension_length);
|
||||
debug("Driver: %s; Extension: %s", driver->Name, extension);
|
||||
if (strcmp(extension, ".fex") == 0 || strcmp(extension, ".elf") == 0)
|
||||
{
|
||||
uintptr_t ret = this->LoadDriver(driver->Address, driver->Length);
|
||||
char RetString[128];
|
||||
if (ret == DriverCode::OK)
|
||||
strncpy(RetString, "\e058C19OK", 10);
|
||||
else if (ret == DriverCode::NOT_AVAILABLE)
|
||||
strncpy(RetString, "\eFF7900NOT AVAILABLE", 21);
|
||||
else
|
||||
sprintf(RetString, "\eE85230FAILED (%#lx)", ret);
|
||||
KPrint("%s %s", driver->Name, RetString);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
KPrint("\eE85230Failed to open driver directory: %s! (Status: %#lx)", Config.DriverDirectory, DriverDirectory.Status);
|
||||
CPU::Stop();
|
||||
}
|
||||
vfs->Close(DriverDirectory);
|
||||
}
|
||||
|
||||
Driver::~Driver()
|
||||
{
|
||||
debug("Destructor called");
|
||||
this->UnloadAllDrivers();
|
||||
}
|
||||
|
||||
#if defined(a64)
|
||||
SafeFunction void DriverInterruptHook::OnInterruptReceived(CPU::x64::TrapFrame *Frame)
|
||||
#elif defined(a32)
|
||||
SafeFunction void DriverInterruptHook::OnInterruptReceived(CPU::x32::TrapFrame *Frame)
|
||||
#elif defined(aa64)
|
||||
SafeFunction void DriverInterruptHook::OnInterruptReceived(CPU::aarch64::TrapFrame *Frame)
|
||||
#endif
|
||||
{
|
||||
SmartLock(DriverInterruptLock); /* Lock in case of multiple interrupts firing at the same time */
|
||||
if (!this->Enabled)
|
||||
{
|
||||
debug("Interrupt hook is not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Handle.InterruptCallback)
|
||||
{
|
||||
#if defined(a86)
|
||||
uint64_t IntNum = Frame->InterruptNumber - 32;
|
||||
#elif defined(aa64)
|
||||
uint64_t IntNum = Frame->InterruptNumber;
|
||||
#endif
|
||||
warn("Interrupt callback for %ld is not set for driver %ld!", IntNum, Handle.DriverUID);
|
||||
return;
|
||||
}
|
||||
CPURegisters regs;
|
||||
#if defined(a64)
|
||||
regs.r15 = Frame->r15;
|
||||
regs.r14 = Frame->r14;
|
||||
regs.r13 = Frame->r13;
|
||||
regs.r12 = Frame->r12;
|
||||
regs.r11 = Frame->r11;
|
||||
regs.r10 = Frame->r10;
|
||||
regs.r9 = Frame->r9;
|
||||
regs.r8 = Frame->r8;
|
||||
|
||||
regs.rbp = Frame->rbp;
|
||||
regs.rdi = Frame->rdi;
|
||||
regs.rsi = Frame->rsi;
|
||||
regs.rdx = Frame->rdx;
|
||||
regs.rcx = Frame->rcx;
|
||||
regs.rbx = Frame->rbx;
|
||||
regs.rax = Frame->rax;
|
||||
|
||||
regs.InterruptNumber = Frame->InterruptNumber;
|
||||
regs.ErrorCode = Frame->ErrorCode;
|
||||
regs.rip = Frame->rip;
|
||||
regs.cs = Frame->cs;
|
||||
regs.rflags = Frame->rflags.raw;
|
||||
regs.rsp = Frame->rsp;
|
||||
regs.ss = Frame->ss;
|
||||
#elif defined(a32)
|
||||
regs.ebp = Frame->ebp;
|
||||
regs.edi = Frame->edi;
|
||||
regs.esi = Frame->esi;
|
||||
regs.edx = Frame->edx;
|
||||
regs.ecx = Frame->ecx;
|
||||
regs.ebx = Frame->ebx;
|
||||
regs.eax = Frame->eax;
|
||||
|
||||
regs.InterruptNumber = Frame->InterruptNumber;
|
||||
regs.ErrorCode = Frame->ErrorCode;
|
||||
regs.eip = Frame->eip;
|
||||
regs.cs = Frame->cs;
|
||||
regs.eflags = Frame->eflags.raw;
|
||||
regs.esp = Frame->esp;
|
||||
regs.ss = Frame->ss;
|
||||
#elif defined(aa64)
|
||||
#endif
|
||||
((int (*)(void *))(Handle.InterruptCallback))(®s);
|
||||
UNUSED(Frame);
|
||||
}
|
||||
|
||||
DriverInterruptHook::DriverInterruptHook(int Interrupt, DriverFile Handle) : Interrupts::Handler(Interrupt)
|
||||
{
|
||||
this->Handle = Handle;
|
||||
#if defined(a86)
|
||||
trace("Interrupt %d hooked to driver %ld", Interrupt, Handle.DriverUID);
|
||||
#elif defined(aa64)
|
||||
trace("Interrupt %d hooked to driver %ld", Interrupt, Handle.DriverUID);
|
||||
#endif
|
||||
}
|
||||
}
|
@ -1,203 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <driver.hpp>
|
||||
|
||||
#include <dumper.hpp>
|
||||
#include <lock.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
#include "../../Fex.hpp"
|
||||
#include "api.hpp"
|
||||
|
||||
// show debug messages
|
||||
// #define DEBUG_DRIVER_API 1
|
||||
|
||||
#ifdef DEBUG_DRIVER_API
|
||||
#define drvdbg(m, ...) debug(m, ##__VA_ARGS__)
|
||||
#else
|
||||
#define drvdbg(m, ...)
|
||||
#endif
|
||||
|
||||
NewLock(DriverDisplayPrintLock);
|
||||
|
||||
void DriverDebugPrint(char *String, unsigned long DriverUID) { trace("[%ld] %s", DriverUID, String); }
|
||||
|
||||
void DriverDisplayPrint(char *String)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
for (unsigned long i = 0; i < strlen(String); i++)
|
||||
Display->Print(String[i], 0, true);
|
||||
}
|
||||
|
||||
void *RequestPage(unsigned long Size)
|
||||
{
|
||||
void *ret = KernelAllocator.RequestPages(Size + 1);
|
||||
drvdbg("Allocated %ld pages (%#lx-%#lx)", Size, (unsigned long)ret, (unsigned long)ret + FROM_PAGES(Size));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FreePage(void *Page, unsigned long Size)
|
||||
{
|
||||
drvdbg("Freeing %ld pages (%#lx-%#lx)", Size, (unsigned long)Page, (unsigned long)Page + FROM_PAGES(Size));
|
||||
KernelAllocator.FreePages(Page, Size + 1);
|
||||
}
|
||||
|
||||
void MapMemory(void *VirtualAddress, void *PhysicalAddress, unsigned long Flags)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
drvdbg("Mapping %#lx to %#lx with flags %#lx...", (unsigned long)VirtualAddress, (unsigned long)PhysicalAddress, Flags);
|
||||
Memory::Virtual(KernelPageTable).Map(VirtualAddress, PhysicalAddress, Flags);
|
||||
}
|
||||
|
||||
void UnmapMemory(void *VirtualAddress)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
drvdbg("Unmapping %#lx...", (unsigned long)VirtualAddress);
|
||||
Memory::Virtual(KernelPageTable).Unmap(VirtualAddress);
|
||||
}
|
||||
|
||||
void *Drivermemcpy(void *Destination, void *Source, unsigned long Size)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
drvdbg("Copying %ld bytes from %#lx-%#lx to %#lx-%#lx...", Size,
|
||||
(unsigned long)Source, (unsigned long)Source + Size,
|
||||
(unsigned long)Destination, (unsigned long)Destination + Size);
|
||||
return memcpy(Destination, Source, Size);
|
||||
}
|
||||
|
||||
void *Drivermemset(void *Destination, int Value, unsigned long Size)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
drvdbg("Setting value %#x at %#lx-%#lx (%ld bytes)...", Value,
|
||||
(unsigned long)Destination, (unsigned long)Destination + Size,
|
||||
Size);
|
||||
return memset(Destination, Value, Size);
|
||||
}
|
||||
|
||||
void DriverNetSend(unsigned int DriverID, unsigned char *Data, unsigned short Size)
|
||||
{
|
||||
// This is useless I guess...
|
||||
if (NIManager)
|
||||
NIManager->DrvSend(DriverID, Data, Size);
|
||||
}
|
||||
|
||||
void DriverNetReceive(unsigned int DriverID, unsigned char *Data, unsigned short Size)
|
||||
{
|
||||
if (NIManager)
|
||||
NIManager->DrvReceive(DriverID, Data, Size);
|
||||
}
|
||||
|
||||
void DriverAHCIDiskRead(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port)
|
||||
{
|
||||
DumpData("DriverDiskRead", Data, SectorCount * 512);
|
||||
UNUSED(DriverID);
|
||||
UNUSED(Sector);
|
||||
UNUSED(Port);
|
||||
}
|
||||
|
||||
void DriverAHCIDiskWrite(unsigned int DriverID, unsigned long Sector, unsigned char *Data, unsigned int SectorCount, unsigned char Port)
|
||||
{
|
||||
DumpData("DriverDiskWrite", Data, SectorCount * 512);
|
||||
UNUSED(DriverID);
|
||||
UNUSED(Sector);
|
||||
UNUSED(Port);
|
||||
}
|
||||
|
||||
char *DriverPCIGetDeviceName(unsigned int VendorID, unsigned int DeviceID)
|
||||
{
|
||||
UNUSED(VendorID);
|
||||
UNUSED(DeviceID);
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
unsigned int DriverGetWidth()
|
||||
{
|
||||
/* TODO: We won't rely only on display buffers, what about graphics drivers and changing resolutions? */
|
||||
return Display->GetBuffer(0)->Width;
|
||||
}
|
||||
|
||||
unsigned int DriverGetHeight()
|
||||
{
|
||||
/* TODO: We won't rely only on display buffers, what about graphics drivers and changing resolutions? */
|
||||
return Display->GetBuffer(0)->Height;
|
||||
}
|
||||
|
||||
void DriverSleep(unsigned long Milliseconds)
|
||||
{
|
||||
SmartLock(DriverDisplayPrintLock);
|
||||
drvdbg("Sleeping for %ld milliseconds...", Milliseconds);
|
||||
if (TaskManager)
|
||||
TaskManager->Sleep(Milliseconds);
|
||||
else
|
||||
TimeManager->Sleep(Milliseconds, Time::Units::Milliseconds);
|
||||
}
|
||||
|
||||
int Driversprintf(char *Buffer, const char *Format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, Format);
|
||||
int ret = vsprintf(Buffer, Format, args);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
KernelAPI KernelAPITemplate = {
|
||||
.Version = {
|
||||
.Major = 0,
|
||||
.Minor = 0,
|
||||
.Patch = 1},
|
||||
.Info = {
|
||||
.Offset = 0,
|
||||
.DriverUID = 0,
|
||||
.KernelDebug = false,
|
||||
},
|
||||
.Memory = {
|
||||
.PageSize = PAGE_SIZE,
|
||||
.RequestPage = RequestPage,
|
||||
.FreePage = FreePage,
|
||||
.Map = MapMemory,
|
||||
.Unmap = UnmapMemory,
|
||||
},
|
||||
.PCI = {
|
||||
.GetDeviceName = DriverPCIGetDeviceName,
|
||||
},
|
||||
.Util = {
|
||||
.DebugPrint = DriverDebugPrint,
|
||||
.DisplayPrint = DriverDisplayPrint,
|
||||
.memcpy = Drivermemcpy,
|
||||
.memset = Drivermemset,
|
||||
.Sleep = DriverSleep,
|
||||
.sprintf = Driversprintf,
|
||||
},
|
||||
.Command = {
|
||||
.Network = {
|
||||
.SendPacket = DriverNetSend,
|
||||
.ReceivePacket = DriverNetReceive,
|
||||
},
|
||||
.Disk = {
|
||||
.AHCI = {
|
||||
.ReadSector = DriverAHCIDiskRead,
|
||||
.WriteSector = DriverAHCIDiskWrite,
|
||||
},
|
||||
},
|
||||
},
|
||||
.Display = {
|
||||
.GetWidth = DriverGetWidth,
|
||||
.GetHeight = DriverGetHeight,
|
||||
},
|
||||
};
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../kernel.h"
|
||||
#include "../../../DAPI.hpp"
|
||||
#include "../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::DriverLoadBindInput(void *DrvExtHdr, uintptr_t DriverAddress, size_t Size, bool IsElf)
|
||||
{
|
||||
UNUSED(DrvExtHdr);
|
||||
UNUSED(IsElf);
|
||||
Memory::MemMgr *mem = new Memory::MemMgr(nullptr, TaskManager->GetCurrentProcess()->memDirectory);
|
||||
Fex *fex = (Fex *)mem->RequestPages(TO_PAGES(Size + 1));
|
||||
memcpy(fex, (void *)DriverAddress, Size);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
debug("Driver allocated at %#lx-%#lx", fex, (uintptr_t)fex + Size);
|
||||
#ifdef DEBUG
|
||||
uint8_t *result = md5File((uint8_t *)fex, Size);
|
||||
debug("MD5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]);
|
||||
kfree(result);
|
||||
#endif
|
||||
KernelAPI *KAPI = (KernelAPI *)mem->RequestPages(TO_PAGES(sizeof(KernelAPI) + 1));
|
||||
|
||||
if (CallDriverEntryPoint(fex, KAPI) != DriverCode::OK)
|
||||
{
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
debug("Starting driver %s (offset: %#lx)", fexExtended->Driver.Name, fex);
|
||||
|
||||
switch (fexExtended->Driver.Type)
|
||||
{
|
||||
case FexDriverType::FexDriverType_Input:
|
||||
return BindInputInput(mem, fex);
|
||||
default:
|
||||
{
|
||||
warn("Unknown driver type: %d", fexExtended->Driver.Type);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::UNKNOWN_DRIVER_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../kernel.h"
|
||||
#include "../../../DAPI.hpp"
|
||||
#include "../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::DriverLoadBindInterrupt(void *DrvExtHdr, uintptr_t DriverAddress, size_t Size, bool IsElf)
|
||||
{
|
||||
UNUSED(DrvExtHdr);
|
||||
UNUSED(IsElf);
|
||||
Memory::MemMgr *mem = new Memory::MemMgr(nullptr, TaskManager->GetCurrentProcess()->memDirectory);
|
||||
Fex *fex = (Fex *)mem->RequestPages(TO_PAGES(Size + 1));
|
||||
memcpy(fex, (void *)DriverAddress, Size);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
debug("Driver allocated at %#lx-%#lx", fex, (uintptr_t)fex + Size);
|
||||
#ifdef DEBUG
|
||||
uint8_t *result = md5File((uint8_t *)fex, Size);
|
||||
debug("MD5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]);
|
||||
kfree(result);
|
||||
#endif
|
||||
KernelAPI *KAPI = (KernelAPI *)mem->RequestPages(TO_PAGES(sizeof(KernelAPI) + 1));
|
||||
|
||||
if (CallDriverEntryPoint(fex, KAPI) != DriverCode::OK)
|
||||
{
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
debug("Starting driver %s (offset: %#lx)", fexExtended->Driver.Name, fex);
|
||||
|
||||
switch (fexExtended->Driver.Type)
|
||||
{
|
||||
case FexDriverType::FexDriverType_Generic:
|
||||
return BindInterruptGeneric(mem, fex);
|
||||
case FexDriverType::FexDriverType_Display:
|
||||
return BindInterruptDisplay(mem, fex);
|
||||
case FexDriverType::FexDriverType_Network:
|
||||
return BindInterruptNetwork(mem, fex);
|
||||
case FexDriverType::FexDriverType_Storage:
|
||||
return BindInterruptStorage(mem, fex);
|
||||
case FexDriverType::FexDriverType_FileSystem:
|
||||
return BindInterruptFileSystem(mem, fex);
|
||||
case FexDriverType::FexDriverType_Input:
|
||||
return BindInterruptInput(mem, fex);
|
||||
case FexDriverType::FexDriverType_Audio:
|
||||
return BindInterruptAudio(mem, fex);
|
||||
default:
|
||||
{
|
||||
warn("Unknown driver type: %d", fexExtended->Driver.Type);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::UNKNOWN_DRIVER_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../kernel.h"
|
||||
#include "../../../DAPI.hpp"
|
||||
#include "../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
void Driver::MapPCIAddresses(PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
debug("Header Type: %d", PCIDevice->HeaderType);
|
||||
switch (PCIDevice->HeaderType)
|
||||
{
|
||||
case 0: // PCI Header 0
|
||||
{
|
||||
uint32_t BAR[6] = {0};
|
||||
size_t BARsSize[6] = {0};
|
||||
|
||||
BAR[0] = ((PCI::PCIHeader0 *)PCIDevice)->BAR0;
|
||||
BAR[1] = ((PCI::PCIHeader0 *)PCIDevice)->BAR1;
|
||||
BAR[2] = ((PCI::PCIHeader0 *)PCIDevice)->BAR2;
|
||||
BAR[3] = ((PCI::PCIHeader0 *)PCIDevice)->BAR3;
|
||||
BAR[4] = ((PCI::PCIHeader0 *)PCIDevice)->BAR4;
|
||||
BAR[5] = ((PCI::PCIHeader0 *)PCIDevice)->BAR5;
|
||||
|
||||
#ifdef DEBUG
|
||||
uintptr_t BAR_Type = BAR[0] & 1;
|
||||
uintptr_t BAR_IOBase = BAR[1] & (~3);
|
||||
uintptr_t BAR_MemoryBase = BAR[0] & (~15);
|
||||
|
||||
debug("Type: %d; IOBase: %#lx; MemoryBase: %#lx", BAR_Type, BAR_IOBase, BAR_MemoryBase);
|
||||
#endif
|
||||
|
||||
/* BARs Size */
|
||||
for (short i = 0; i < 6; i++)
|
||||
{
|
||||
if (BAR[i] == 0)
|
||||
continue;
|
||||
|
||||
if ((BAR[i] & 1) == 0) // Memory Base
|
||||
{
|
||||
((PCI::PCIHeader0 *)PCIDevice)->BAR0 = 0xFFFFFFFF;
|
||||
size_t size = ((PCI::PCIHeader0 *)PCIDevice)->BAR0;
|
||||
((PCI::PCIHeader0 *)PCIDevice)->BAR0 = BAR[i];
|
||||
BARsSize[i] = size & (~15);
|
||||
BARsSize[i] = ~BARsSize[i] + 1;
|
||||
BARsSize[i] = BARsSize[i] & 0xFFFFFFFF;
|
||||
debug("BAR%d %#lx size: %d", i, BAR[i], BARsSize[i]);
|
||||
}
|
||||
else if ((BAR[i] & 1) == 1) // I/O Base
|
||||
{
|
||||
((PCI::PCIHeader0 *)PCIDevice)->BAR1 = 0xFFFFFFFF;
|
||||
size_t size = ((PCI::PCIHeader0 *)PCIDevice)->BAR1;
|
||||
((PCI::PCIHeader0 *)PCIDevice)->BAR1 = BAR[i];
|
||||
BARsSize[i] = size & (~3);
|
||||
BARsSize[i] = ~BARsSize[i] + 1;
|
||||
BARsSize[i] = BARsSize[i] & 0xFFFF;
|
||||
debug("BAR%d %#lx size: %d", i, BAR[i], BARsSize[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Mapping the BARs */
|
||||
for (short i = 0; i < 6; i++)
|
||||
{
|
||||
if (BAR[i] == 0)
|
||||
continue;
|
||||
|
||||
if ((BAR[i] & 1) == 0) // Memory Base
|
||||
{
|
||||
uintptr_t BARBase = BAR[i] & (~15);
|
||||
size_t BARSize = BARsSize[i];
|
||||
|
||||
debug("Mapping BAR%d %#lx-%#lx", i, BARBase, BARBase + BARSize);
|
||||
Memory::Virtual().Map((void *)BARBase, (void *)BARBase, BARSize, Memory::PTFlag::RW | Memory::PTFlag::PWT);
|
||||
}
|
||||
else if ((BAR[i] & 1) == 1) // I/O Base
|
||||
{
|
||||
uintptr_t BARBase = BAR[i] & (~3);
|
||||
size_t BARSize = BARsSize[i];
|
||||
|
||||
debug("Mapping BAR%d %#x-%#x", i, BARBase, BARBase + BARSize);
|
||||
Memory::Virtual().Map((void *)BARBase, (void *)BARBase, BARSize, Memory::PTFlag::RW | Memory::PTFlag::PWT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: // PCI Header 1 (PCI-to-PCI Bridge)
|
||||
{
|
||||
fixme("PCI Header 1 (PCI-to-PCI Bridge) not implemented yet");
|
||||
break;
|
||||
}
|
||||
case 2: // PCI Header 2 (PCI-to-CardBus Bridge)
|
||||
{
|
||||
fixme("PCI Header 2 (PCI-to-CardBus Bridge) not implemented yet");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
error("Unknown header type %d", PCIDevice->HeaderType);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverCode Driver::DriverLoadBindPCI(void *DrvExtHdr, uintptr_t DriverAddress, size_t Size, bool IsElf)
|
||||
{
|
||||
UNUSED(IsElf);
|
||||
for (unsigned long Vidx = 0; Vidx < sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.VendorID) / sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.VendorID[0]); Vidx++)
|
||||
{
|
||||
for (unsigned long Didx = 0; Didx < sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.DeviceID) / sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.DeviceID[0]); Didx++)
|
||||
{
|
||||
if (Vidx >= sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.VendorID) && Didx >= sizeof(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.DeviceID))
|
||||
break;
|
||||
|
||||
if (((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.VendorID[Vidx] == 0 || ((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.DeviceID[Didx] == 0)
|
||||
continue;
|
||||
|
||||
std::vector<PCI::PCIDeviceHeader *> devices = PCIManager->FindPCIDevice(((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.VendorID[Vidx], ((FexExtended *)DrvExtHdr)->Driver.Bind.PCI.DeviceID[Didx]);
|
||||
if (devices.size() == 0)
|
||||
continue;
|
||||
|
||||
foreach (auto PCIDevice in devices)
|
||||
{
|
||||
debug("[%ld] VendorID: %#x; DeviceID: %#x", devices.size(), PCIDevice->VendorID, PCIDevice->DeviceID);
|
||||
Memory::MemMgr *mem = new Memory::MemMgr(nullptr, TaskManager->GetCurrentProcess()->memDirectory);
|
||||
Fex *fex = (Fex *)mem->RequestPages(TO_PAGES(Size + 1));
|
||||
memcpy(fex, (void *)DriverAddress, Size);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
debug("Driver allocated at %#lx-%#lx", fex, (uintptr_t)fex + Size);
|
||||
#ifdef DEBUG
|
||||
uint8_t *result = md5File((uint8_t *)fex, Size);
|
||||
debug("MD5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]);
|
||||
kfree(result);
|
||||
#endif
|
||||
KernelAPI *KAPI = (KernelAPI *)mem->RequestPages(TO_PAGES(sizeof(KernelAPI) + 1));
|
||||
|
||||
if (CallDriverEntryPoint(fex, KAPI) != DriverCode::OK)
|
||||
{
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
debug("Starting driver %s", fexExtended->Driver.Name);
|
||||
|
||||
MapPCIAddresses(PCIDevice);
|
||||
|
||||
switch (fexExtended->Driver.Type)
|
||||
{
|
||||
case FexDriverType::FexDriverType_Generic:
|
||||
return BindPCIGeneric(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_Display:
|
||||
return BindPCIDisplay(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_Network:
|
||||
return BindPCINetwork(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_Storage:
|
||||
return BindPCIStorage(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_FileSystem:
|
||||
return BindPCIFileSystem(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_Input:
|
||||
return BindPCIInput(mem, fex, PCIDevice);
|
||||
case FexDriverType::FexDriverType_Audio:
|
||||
return BindPCIAudio(mem, fex, PCIDevice);
|
||||
default:
|
||||
{
|
||||
warn("Unknown driver type: %d", fexExtended->Driver.Type);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::UNKNOWN_DRIVER_TYPE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return DriverCode::PCI_DEVICE_NOT_FOUND;
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../kernel.h"
|
||||
#include "../../../DAPI.hpp"
|
||||
#include "../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::DriverLoadBindProcess(void *DrvExtHdr, uintptr_t DriverAddress, size_t Size, bool IsElf)
|
||||
{
|
||||
fixme("Process driver: %s", ((FexExtended *)DrvExtHdr)->Driver.Name);
|
||||
UNUSED(Size);
|
||||
UNUSED(DriverAddress);
|
||||
UNUSED(IsElf);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputAudio(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputDisplay(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputFileSystem(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputGeneric(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputInput(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
KernelCallback KCallback{};
|
||||
|
||||
fixme("Input driver: %s", fexExtended->Driver.Name);
|
||||
KCallback.RawPtr = nullptr;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
delete mem, mem = nullptr;
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet != DriverReturnCode::OK)
|
||||
{
|
||||
delete mem, mem = nullptr;
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
fixme("Input driver: %s", fexExtended->Driver.Name);
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.MemTrk = mem,
|
||||
};
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputNetwork(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInputStorage(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptAudio(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Audio driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptDisplay(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Display driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptFileSystem(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Filesystem driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptGeneric(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Generic driver: %s", fexExtended->Driver.Name);
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptInput(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
debug("Searching for conflicting drivers...");
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if ((fe->Driver.TypeFlags & FexDriverInputTypes_Mouse &&
|
||||
fexExtended->Driver.TypeFlags & FexDriverInputTypes_Mouse) ||
|
||||
(fe->Driver.TypeFlags & FexDriverInputTypes_Keyboard &&
|
||||
fexExtended->Driver.TypeFlags & FexDriverInputTypes_Keyboard))
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if ((fe->Driver.TypeFlags & FexDriverInputTypes_Mouse &&
|
||||
fexExtended->Driver.TypeFlags & FexDriverInputTypes_Mouse) ||
|
||||
(fe->Driver.TypeFlags & FexDriverInputTypes_Keyboard &&
|
||||
fexExtended->Driver.TypeFlags & FexDriverInputTypes_Keyboard))
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
if (fexExtended->Driver.InterruptCallback)
|
||||
{
|
||||
for (unsigned long i = 0; i < sizeof(fexExtended->Driver.Bind.Interrupt.Vector) / sizeof(fexExtended->Driver.Bind.Interrupt.Vector[0]); i++)
|
||||
{
|
||||
if (fexExtended->Driver.Bind.Interrupt.Vector[i] == 0)
|
||||
break;
|
||||
DrvFile.InterruptHook[i] = new DriverInterruptHook(fexExtended->Driver.Bind.Interrupt.Vector[i], DrvFile);
|
||||
}
|
||||
}
|
||||
|
||||
KernelCallback KCallback{};
|
||||
KCallback.RawPtr = nullptr;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet != DriverReturnCode::OK)
|
||||
{
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptNetwork(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Network driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindInterruptStorage(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
if (fexExtended->Driver.InterruptCallback)
|
||||
{
|
||||
for (unsigned long i = 0; i < sizeof(fexExtended->Driver.Bind.Interrupt.Vector) / sizeof(fexExtended->Driver.Bind.Interrupt.Vector[0]); i++)
|
||||
{
|
||||
if (fexExtended->Driver.Bind.Interrupt.Vector[i] == 0)
|
||||
break;
|
||||
DrvFile.InterruptHook[i] = new DriverInterruptHook(fexExtended->Driver.Bind.Interrupt.Vector[i], DrvFile);
|
||||
}
|
||||
}
|
||||
|
||||
KernelCallback KCallback{};
|
||||
KCallback.RawPtr = nullptr;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet != DriverReturnCode::OK)
|
||||
{
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIAudio(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
if (fexExtended->Driver.InterruptCallback)
|
||||
DrvFile.InterruptHook[0] = new DriverInterruptHook(((int)((PCI::PCIHeader0 *)PCIDevice)->InterruptLine), DrvFile);
|
||||
|
||||
KernelCallback KCallback{};
|
||||
KCallback.RawPtr = PCIDevice;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet == DriverReturnCode::OK)
|
||||
trace("Device found for driver: %s", fexExtended->Driver.Name);
|
||||
else
|
||||
{
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIDisplay(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
UNUSED(PCIDevice);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Display driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIFileSystem(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
UNUSED(PCIDevice);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Filesystem driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIGeneric(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
UNUSED(PCIDevice);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Generic driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIInput(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
UNUSED(PCIDevice);
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fixme("Input driver: %s", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCINetwork(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
if (fexExtended->Driver.InterruptCallback)
|
||||
DrvFile.InterruptHook[0] = new DriverInterruptHook(((int)((PCI::PCIHeader0 *)PCIDevice)->InterruptLine), DrvFile);
|
||||
|
||||
KernelCallback KCallback{};
|
||||
KCallback.RawPtr = PCIDevice;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet == DriverReturnCode::OK)
|
||||
trace("Device found for driver: %s", fexExtended->Driver.Name);
|
||||
else
|
||||
{
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindPCIStorage(Memory::MemMgr *mem, void *fex, PCI::PCIDeviceHeader *PCIDevice)
|
||||
{
|
||||
FexExtended *fexExtended = (FexExtended *)((uintptr_t)fex + EXTENDED_SECTION_ADDRESS);
|
||||
|
||||
if (fexExtended->Driver.OverrideOnConflict)
|
||||
{
|
||||
std::vector<uint64_t> DriversToRemove = std::vector<uint64_t>();
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
|
||||
DriversToRemove.push_back(Drv.DriverUID);
|
||||
}
|
||||
|
||||
foreach (auto DrvID in DriversToRemove)
|
||||
{
|
||||
if (!this->UnloadDriver(DrvID))
|
||||
{
|
||||
error("Failed to unload conflicting driver %d", DrvID);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (auto Drv in Drivers)
|
||||
{
|
||||
FexExtended *fe = ((FexExtended *)((uintptr_t)Drv.Address + EXTENDED_SECTION_ADDRESS));
|
||||
|
||||
if (fe->Driver.OverrideOnConflict)
|
||||
{
|
||||
debug("Driver %s is conflicting with %s", fe->Driver.Name, fexExtended->Driver.Name);
|
||||
return DriverCode::DRIVER_CONFLICT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DriverFile DrvFile = {
|
||||
.Enabled = true,
|
||||
.DriverUID = this->DriverUIDs - 1,
|
||||
.Address = (void *)fex,
|
||||
.InterruptCallback = (void *)((uintptr_t)fex + (uintptr_t)fexExtended->Driver.InterruptCallback),
|
||||
.MemTrk = mem,
|
||||
};
|
||||
if (fexExtended->Driver.InterruptCallback)
|
||||
DrvFile.InterruptHook[0] = new DriverInterruptHook(((int)((PCI::PCIHeader0 *)PCIDevice)->InterruptLine), DrvFile);
|
||||
|
||||
KernelCallback KCallback{};
|
||||
KCallback.RawPtr = PCIDevice;
|
||||
KCallback.Reason = CallbackReason::ConfigurationReason;
|
||||
int CallbackRet = ((int (*)(KernelCallback *))((uintptr_t)fexExtended->Driver.Callback + (uintptr_t)fex))(&KCallback);
|
||||
|
||||
if (CallbackRet == DriverReturnCode::NOT_IMPLEMENTED)
|
||||
{
|
||||
error("Driver %s is not implemented", fexExtended->Driver.Name);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
else if (CallbackRet == DriverReturnCode::OK)
|
||||
trace("Device found for driver: %s", fexExtended->Driver.Name);
|
||||
else
|
||||
{
|
||||
error("Driver %s returned error %d", fexExtended->Driver.Name, CallbackRet);
|
||||
delete mem, mem = nullptr;
|
||||
return DriverCode::DRIVER_RETURNED_ERROR;
|
||||
}
|
||||
|
||||
Drivers.push_back(DrvFile);
|
||||
return DriverCode::OK;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessAudio(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessDisplay(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessFileSystem(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessGeneric(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessInput(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessNetwork(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../api.hpp"
|
||||
|
||||
#include <ints.hpp>
|
||||
#include <memory.hpp>
|
||||
#include <task.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <printf.h>
|
||||
#include <cwalk.h>
|
||||
#include <md5.h>
|
||||
|
||||
#include "../../../../kernel.h"
|
||||
#include "../../../../DAPI.hpp"
|
||||
#include "../../../../Fex.hpp"
|
||||
|
||||
namespace Driver
|
||||
{
|
||||
DriverCode Driver::BindProcessStorage(Memory::MemMgr *mem, void *fex)
|
||||
{
|
||||
UNUSED(mem);
|
||||
UNUSED(fex);
|
||||
return DriverCode::NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FENNIX_KERNEL_DRIVER_API_H__
|
||||
#define __FENNIX_KERNEL_DRIVER_API_H__
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#include "../../DAPI.hpp"
|
||||
|
||||
extern KernelAPI KernelAPITemplate;
|
||||
|
||||
#endif // !__FENNIX_KERNEL_DRIVER_API_H__
|
Reference in New Issue
Block a user