diff --git a/Core/Driver/Driver.cpp b/Core/Driver/Driver.cpp index e263cf1..2f667ed 100644 --- a/Core/Driver/Driver.cpp +++ b/Core/Driver/Driver.cpp @@ -24,7 +24,7 @@ #include #include -#include "../../Drivers/drv.hpp" +#include "../../Modules/drv.hpp" #include "../../kernel.h" #include "../../DAPI.hpp" #include "../../Fex.hpp" diff --git a/Kernel.cpp b/Kernel.cpp index 9ef29ec..f81541d 100644 --- a/Kernel.cpp +++ b/Kernel.cpp @@ -205,7 +205,6 @@ PCI::PCI *PCIManager = nullptr; Tasking::Task *TaskManager = nullptr; Time::time *TimeManager = nullptr; VirtualFileSystem::Virtual *vfs = nullptr; -VirtualFileSystem::Virtual *bootanim_vfs = nullptr; KernelConfig Config = { .AllocatorType = Memory::MemoryAllocatorType::XallocV1, @@ -403,9 +402,6 @@ EXTERNC NIF void Main() KPrint("Initializing Filesystem..."); vfs = new VirtualFileSystem::Virtual; - if (Config.BootAnimation) - bootanim_vfs = new VirtualFileSystem::Virtual; - for (size_t i = 0; i < MAX_MODULES; i++) { if (!bInfo.Modules[i].Address) @@ -418,13 +414,6 @@ EXTERNC NIF void Main() if (!initrd++) new VirtualFileSystem::USTAR((uintptr_t)bInfo.Modules[i].Address, vfs); } - if (strcmp(bInfo.Modules[i].CommandLine, "bootanim") == 0 && Config.BootAnimation) - { - debug("Found bootanim at %p", bInfo.Modules[i].Address); - static char bootanim = 0; - if (!bootanim++) - new VirtualFileSystem::USTAR((uintptr_t)bInfo.Modules[i].Address, bootanim_vfs); - } } if (vfs->GetRootNode()->Children.size() == 0) @@ -436,45 +425,42 @@ EXTERNC NIF void Main() vfs->CreateRoot("/", &null_op); } - if (!vfs->PathExists("/system")) - vfs->Create("/system", NodeFlags::DIRECTORY); - - if (!vfs->PathExists("/system/dev")) - DevFS = vfs->Create("/system/dev", NodeFlags::DIRECTORY); + if (!vfs->PathExists("/dev")) + DevFS = vfs->Create("/dev", NodeFlags::DIRECTORY); else { - File dev = vfs->Open("/system/dev"); + File dev = vfs->Open("/dev"); if (dev.node->Flags != NodeFlags::DIRECTORY) { - KPrint("\eE85230/system/dev is not a directory! Halting..."); + KPrint("\eE85230/dev is not a directory! Halting..."); CPU::Stop(); } vfs->Close(dev); DevFS = dev.node; } - if (!vfs->PathExists("/system/mnt")) - MntFS = vfs->Create("/system/mnt", NodeFlags::DIRECTORY); + if (!vfs->PathExists("/mnt")) + MntFS = vfs->Create("/mnt", NodeFlags::DIRECTORY); else { - File mnt = vfs->Open("/system/mnt"); + File mnt = vfs->Open("/mnt"); if (mnt.node->Flags != NodeFlags::DIRECTORY) { - KPrint("\eE85230/system/mnt is not a directory! Halting..."); + KPrint("\eE85230/mnt is not a directory! Halting..."); CPU::Stop(); } vfs->Close(mnt); MntFS = mnt.node; } - if (!vfs->PathExists("/system/proc")) - ProcFS = vfs->Create("/system/proc", NodeFlags::DIRECTORY); + if (!vfs->PathExists("/proc")) + ProcFS = vfs->Create("/proc", NodeFlags::DIRECTORY); else { - File proc = vfs->Open("/system/proc", nullptr); + File proc = vfs->Open("/proc", nullptr); if (proc.node->Flags != NodeFlags::DIRECTORY) { - KPrint("\eE85230/system/proc is not a directory! Halting..."); + KPrint("\eE85230/proc is not a directory! Halting..."); CPU::Stop(); } vfs->Close(proc); @@ -571,9 +557,6 @@ EXTERNC __no_stack_protector void BeforeShutdown(bool Reboot) if (vfs) delete vfs, vfs = nullptr; - if (bootanim_vfs) - delete bootanim_vfs, bootanim_vfs = nullptr; - if (TimeManager) delete TimeManager, TimeManager = nullptr; diff --git a/KernelThread.cpp b/KernelThread.cpp index d8cf019..888342e 100644 --- a/KernelThread.cpp +++ b/KernelThread.cpp @@ -258,9 +258,9 @@ void TestSyscallsKernel() Execute::SpawnData SpawnInit() { const char *envp[5] = { - "PATH=/system:/system/bin", + "PATH=/bin:/usr/bin", "TERM=tty", - "HOME=/", + "HOME=/root", "USER=root", nullptr}; @@ -283,11 +283,11 @@ void BootLogoAnimationThread() char BootAnimPath[16]; while (FrameCount < 27) { - sprintf(BootAnimPath, "%ld.tga", FrameCount); - File ba = bootanim_vfs->Open(BootAnimPath); + sprintf(BootAnimPath, "/etc/boot/%ld.tga", FrameCount); + File ba = vfs->Open(BootAnimPath); if (!ba.IsOK()) { - bootanim_vfs->Close(ba); + vfs->Close(ba); debug("Failed to load boot animation frame %s", BootAnimPath); break; } @@ -295,7 +295,7 @@ void BootLogoAnimationThread() FrameSizes[FrameCount] = s_cst(uint32_t, ba.node->Length); Frames[FrameCount] = new uint8_t[ba.node->Length]; memcpy((void *)Frames[FrameCount], (void *)ba.node->Address, ba.node->Length); - bootanim_vfs->Close(ba); + vfs->Close(ba); FrameCount++; } @@ -436,7 +436,7 @@ void KernelMainThread() KPrint("Initializing Disk Manager..."); DiskManager = new Disk::Manager; - KPrint("Loading Drivers..."); + KPrint("Loading Modules..."); DriverManager = new Driver::Driver; DriverManager->LoadDrivers(); diff --git a/Makefile b/Makefile index e0c445b..7cd3973 100644 --- a/Makefile +++ b/Makefile @@ -200,4 +200,4 @@ endif $(NM) $@ clean: - rm -f *.bin *.o *.elf *.sym kernel.map kernel_dump.map kernel_dump_intel.map $(OBJ) $(STACK_USAGE_OBJ) $(GCNO_OBJ) $(KERNEL_FILENAME) + rm -f kernel.map kernel_dump.map kernel_dump_intel.map $(OBJ) $(STACK_USAGE_OBJ) $(GCNO_OBJ) $(KERNEL_FILENAME) diff --git a/Drivers/AHCI/AdvancedHostControllerInterface.cpp b/Modules/AHCI/AdvancedHostControllerInterface.cpp similarity index 100% rename from Drivers/AHCI/AdvancedHostControllerInterface.cpp rename to Modules/AHCI/AdvancedHostControllerInterface.cpp diff --git a/Drivers/AHCI/ahci.hpp b/Modules/AHCI/ahci.hpp similarity index 100% rename from Drivers/AHCI/ahci.hpp rename to Modules/AHCI/ahci.hpp diff --git a/Drivers/ATA/AdvancedTechnologyAttachment.cpp b/Modules/ATA/AdvancedTechnologyAttachment.cpp similarity index 100% rename from Drivers/ATA/AdvancedTechnologyAttachment.cpp rename to Modules/ATA/AdvancedTechnologyAttachment.cpp diff --git a/Drivers/ATA/ata.hpp b/Modules/ATA/ata.hpp similarity index 100% rename from Drivers/ATA/ata.hpp rename to Modules/ATA/ata.hpp diff --git a/Drivers/AdvancedMicroDevices/PCNET.cpp b/Modules/AdvancedMicroDevices/PCNET.cpp similarity index 100% rename from Drivers/AdvancedMicroDevices/PCNET.cpp rename to Modules/AdvancedMicroDevices/PCNET.cpp diff --git a/Drivers/AdvancedMicroDevices/pcnet.hpp b/Modules/AdvancedMicroDevices/pcnet.hpp similarity index 100% rename from Drivers/AdvancedMicroDevices/pcnet.hpp rename to Modules/AdvancedMicroDevices/pcnet.hpp diff --git a/Drivers/AudioCodec97/AudioCodec97.cpp b/Modules/AudioCodec97/AudioCodec97.cpp similarity index 100% rename from Drivers/AudioCodec97/AudioCodec97.cpp rename to Modules/AudioCodec97/AudioCodec97.cpp diff --git a/Drivers/AudioCodec97/ac97.hpp b/Modules/AudioCodec97/ac97.hpp similarity index 100% rename from Drivers/AudioCodec97/ac97.hpp rename to Modules/AudioCodec97/ac97.hpp diff --git a/Drivers/BuiltinDriverLoader.cpp b/Modules/BuiltinDriverLoader.cpp similarity index 100% rename from Drivers/BuiltinDriverLoader.cpp rename to Modules/BuiltinDriverLoader.cpp diff --git a/Drivers/Intel/Gigabit.cpp b/Modules/Intel/Gigabit.cpp similarity index 100% rename from Drivers/Intel/Gigabit.cpp rename to Modules/Intel/Gigabit.cpp diff --git a/Drivers/Intel/gigabit.hpp b/Modules/Intel/gigabit.hpp similarity index 100% rename from Drivers/Intel/gigabit.hpp rename to Modules/Intel/gigabit.hpp diff --git a/Drivers/PersonalSystem2/Mouse.cpp b/Modules/PersonalSystem2/Mouse.cpp similarity index 100% rename from Drivers/PersonalSystem2/Mouse.cpp rename to Modules/PersonalSystem2/Mouse.cpp diff --git a/Drivers/PersonalSystem2/mouse.hpp b/Modules/PersonalSystem2/mouse.hpp similarity index 100% rename from Drivers/PersonalSystem2/mouse.hpp rename to Modules/PersonalSystem2/mouse.hpp diff --git a/Drivers/Realtek/RTL8139.cpp b/Modules/Realtek/RTL8139.cpp similarity index 100% rename from Drivers/Realtek/RTL8139.cpp rename to Modules/Realtek/RTL8139.cpp diff --git a/Drivers/Realtek/rtl8139.hpp b/Modules/Realtek/rtl8139.hpp similarity index 100% rename from Drivers/Realtek/rtl8139.hpp rename to Modules/Realtek/rtl8139.hpp diff --git a/Drivers/VMware/Mouse.cpp b/Modules/VMware/Mouse.cpp similarity index 100% rename from Drivers/VMware/Mouse.cpp rename to Modules/VMware/Mouse.cpp diff --git a/Drivers/VMware/mouse.hpp b/Modules/VMware/mouse.hpp similarity index 100% rename from Drivers/VMware/mouse.hpp rename to Modules/VMware/mouse.hpp diff --git a/Drivers/drv.hpp b/Modules/drv.hpp similarity index 100% rename from Drivers/drv.hpp rename to Modules/drv.hpp diff --git a/Recovery/RecoveryMain.cpp b/Recovery/RecoveryMain.cpp index 453eec2..1145508 100644 --- a/Recovery/RecoveryMain.cpp +++ b/Recovery/RecoveryMain.cpp @@ -47,7 +47,7 @@ namespace Recovery WidgetCollection *wdgDbgWin = nullptr; Window *DbgWin = nullptr; - char *AudioFile = (char *)"/home/default/Music/Ludwig van Beethoven - Fur Elise.mp3"; + char *AudioFile = (char *)"none"; void PlayAudio() { @@ -185,13 +185,6 @@ namespace Recovery void BufBight90() { Display->SetBrightness(90, 200); } void BufBight100() { Display->SetBrightness(100, 200); } - // void audio_dev_connected() { AudioFile = (char *)"/system/config/audio/media/dev_connected.mp3"; } - // void audio_dev_disconnected() { AudioFile = (char *)"/system/config/audio/media/dev_disconnected.mp3"; } - // void audio_dev_error() { AudioFile = (char *)"/system/config/audio/media/dev_error.mp3"; } - // void audio_error() { AudioFile = (char *)"/system/config/audio/media/error.mp3"; } - // void audio_notification() { AudioFile = (char *)"/system/config/audio/media/notification.mp3"; } - // void audio_warning() { AudioFile = (char *)"/system/config/audio/media/warning.mp3"; } - void KernelRecovery::RecoveryThread() { while (wdgDbgWin == nullptr || DbgWin == nullptr) diff --git a/SystemCalls/Native.cpp b/SystemCalls/Native.cpp index 5c72c7f..3d19ddc 100644 --- a/SystemCalls/Native.cpp +++ b/SystemCalls/Native.cpp @@ -149,13 +149,13 @@ static uintptr_t sys_kernelctl(SyscallsFrame *Frame, enum KCtl Command, uint64_t switch (retries) { case 0: - FullPath = "/system/lib/"; + FullPath = "/lib/"; break; case 1: - FullPath = "/system/lib64/"; + FullPath = "/usr/lib/"; break; case 2: - FullPath = "/system/"; + FullPath = "/"; break; case 3: { diff --git a/include/filesystem/mounts.hpp b/include/filesystem/mounts.hpp index 71cafaf..b6f46e3 100644 --- a/include/filesystem/mounts.hpp +++ b/include/filesystem/mounts.hpp @@ -24,7 +24,7 @@ namespace VirtualFileSystem { - /* Manage /system/dev */ + /* Manage /dev */ class Device { public: @@ -33,7 +33,7 @@ namespace VirtualFileSystem ~Device(); }; - /* Manage /system/mnt */ + /* Manage /mnt */ class Mount { public: @@ -43,7 +43,7 @@ namespace VirtualFileSystem ~Mount(); }; - /* Manage /system/prc */ + /* Manage /prc */ class Process { public: @@ -51,7 +51,7 @@ namespace VirtualFileSystem ~Process(); }; - /* Manage /system/drv */ + /* Manage /drv */ class Driver { public: @@ -60,7 +60,7 @@ namespace VirtualFileSystem ~Driver(); }; - /* Manage /system/net */ + /* Manage /net */ class Network { public: @@ -69,7 +69,7 @@ namespace VirtualFileSystem ~Network(); }; - /* Manage /system/dev/serialX */ + /* Manage /dev/serialX */ class Serial { public: @@ -77,7 +77,7 @@ namespace VirtualFileSystem ~Serial(); }; - /* Manage /system/dev/random */ + /* Manage /dev/random */ class Random { public: @@ -85,7 +85,7 @@ namespace VirtualFileSystem ~Random(); }; - /* Manage /system/dev/null */ + /* Manage /dev/null */ class Null { public: @@ -93,7 +93,7 @@ namespace VirtualFileSystem ~Null(); }; - /* Manage /system/dev/zero */ + /* Manage /dev/zero */ class Zero { public: @@ -101,7 +101,7 @@ namespace VirtualFileSystem ~Zero(); }; - /* Manage /system/dev/fbX */ + /* Manage /dev/fbX */ class FB { public: diff --git a/kernel.h b/kernel.h index 77edfc1..e9f482c 100644 --- a/kernel.h +++ b/kernel.h @@ -55,7 +55,6 @@ extern KernelConfig Config; extern Tasking::Task *TaskManager; extern Time::time *TimeManager; extern VirtualFileSystem::Virtual *vfs; -extern VirtualFileSystem::Virtual *bootanim_vfs; extern Driver::Driver *DriverManager; extern Disk::Manager *DiskManager; extern NetworkInterfaceManager::NetworkInterface *NIManager;