summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2021-07-11Kernel: Remove some no-longer-needed C library functionsAndreas Kling
Now that we no longer demangle symbols in the kernel, we don't need to provide stuff like malloc(), memchr(), free(), etc to the demangler.
2021-07-11Kernel: VERIFY_NOT_REACHED in un-sized operator deleteAndreas Kling
All deletes in kernel code should now be of known size. :^)
2021-07-11Kernel: Use kfree_sized() in KStringAndreas Kling
2021-07-11Kernel: Add kfree_sized(), kfree() with a known allocation sizeAndreas Kling
C++14 gave us sized operator delete, but we haven't been taking advantage of it. Let's get to a point where it can help us by adding kfree_sized(void*, size_t).
2021-07-11Kernel: Use Forward.h headers moreAndreas Kling
2021-07-11Kernel: Make KLexicalPath::basename() more compliantMax Wipfli
This removes some assertions from KLexicalPath::basename() by supporting paths with trailing slashes, empty paths, paths consisting of only slashes and paths with ending "." and ".." segments.
2021-07-11Kernel: Make various T::class_name() and similar return StringViewAndreas Kling
Instead of returning char const*, we can also give you a StringView.
2021-07-11Kernel: Rename ProcFSComponentsRegistrar => ProcFSComponentRegistryAndreas Kling
This matches the formatting used in SysFS.
2021-07-11Kernel: Remove friend classes from ProcFSComponentsRegistrarAndreas Kling
2021-07-11Kernel: Rename SysFS related classes in BIOS codeAndreas Kling
Give them names that sound related to SysFS.
2021-07-11Kernel: Use nested namespace declarations in ACPI codeAndreas Kling
2021-07-11Kernel: Rename SysFS related classes in ACPI codeAndreas Kling
Give them names that sound related to SysFS.
2021-07-11Kernel: Replace "Folder" => "Directory" everywhereAndreas Kling
Folders are a GUI concept, file systems have directories. :^)
2021-07-11Kernel: Rename SysFS related classes in PCI codeAndreas Kling
Give them names that sound related to SysFS.
2021-07-11Kernel: Remove pointless lock/unlock in SysFS constructorAndreas Kling
2021-07-11Kernel: Remove all friend declarations from SysFSComponentRegistryAndreas Kling
Let them access the class using public API instead.
2021-07-11Kernel: Move SystemExposed.* => FileSystem/SysFSComponent.*Andreas Kling
2021-07-11Kernel: Remove some dead code and unused includes in SysFS filesAndreas Kling
2021-07-11Kernel: Move SysFS forward declarations to FileSystem/Forward.hAndreas Kling
2021-07-11Kernel: Rename SystemExposedFolder => SysFSDirectoryAndreas Kling
"Folder" is a GUI concept, let's call this "Directory". Also, "System" is completely generic, so let's be more specific and call this "SysFS..."
2021-07-11Kernel: Rename SystemExposedComponent => SysFSComponentAndreas Kling
2021-07-11Kernel: Rename SystemRegistrar => SysFSComponentRegistryAndreas Kling
2021-07-11Kernel: Remove unnecessary includes in FileSystem.{cpp,h}Andreas Kling
2021-07-11Kernel: Remove unnecessary String allocation in SystemExposedFolderAndreas Kling
2021-07-11Kerne: Switch SysFS to east-const styleAndreas Kling
2021-07-11Kernel: Switch Custody to east-const styleAndreas Kling
2021-07-11Kernel: Only allow looking up Mounts by InodeIdentifierAndreas Kling
Let's simplify the interface by not allowing lookup by Inode&.
2021-07-11Kernel: Make VirtualFileSystem::Mount a top-level classAndreas Kling
And move it to its own compilation unit.
2021-07-11Kernel: Rename BlockBasedFS => BlockBasedFileSystemAndreas Kling
2021-07-11Kernel: Rename FileBackedFS => FileBackedFileSystemAndreas Kling
2021-07-11Kernel: Make VirtualFileSystem::sync() staticAndreas Kling
2021-07-11Kernel: Rename VFS => VirtualFileSystemAndreas Kling
2021-07-11Kernel: Rename FS => FileSystemAndreas Kling
This matches our common naming style better.
2021-07-10Kernel: Logic fix in the pledge syscallRalf Donau
Pledge should check m_has_promises. Calling pledge("", nullptr) does not fail on an already pledged process anymore.
2021-07-10Kernel: Make VirtIO GPU buffer flipping more spec compliantTom
The spec requires a flush after setting the new buffer resource id, which is required by QEMUs SDL backend but not the GTK backend. This brings us in line with the spec and makes it work for the SDL backend.
2021-07-10Kernel+Userland: Make the stack alignment comply with the System V ABIGunnar Beutner
The System V ABI for both x86 and x86_64 requires that the stack pointer is 16-byte aligned on entry. Previously we did not align the stack pointer properly. As far as "main" was concerned the stack alignment was correct even without this patch due to how the C++ _start function and the kernel interacted, i.e. the kernel misaligned the stack as far as the ABI was concerned but that misalignment (read: it was properly aligned for a regular function call - but misaligned in terms of what the ABI dictates) was actually expected by our _start function.
2021-07-09LibPthread+Kernel: Add pthread_kill() and the thread_kill syscallAli Mohammad Pur
2021-07-09Kernel: Support multiport for VirtIOConsolex-yl
This involves refactoring VirtIOConsole into VirtIOConsole and VirtIOConsolePort. VirtIOConsole is the VirtIODevice, it owns multiple VirtIOConsolePorts as well as two control queues. Each VirtIOConsolePort is a CharacterDevice.
2021-07-09Kernel: Add support for reading from VirtIOConsolex-yl
This allows two-way communication with the host through a VirtIOConsole. This is necessary for features like clipboard sharing.
2021-07-09Kernel: Stop booting and print if PAE is not supported by the processorLuke
We currently require PAE and not having it causes us to crash. This turns that crash into an error message.
2021-07-08Kernel: Return an already destructed PhysicalPage to the allocatorsTom
By making sure the PhysicalPage instance is fully destructed the allocators will have a chance to reclaim the PhysicalPageEntry for free-list purposes. Just pass them the physical address of the page that was freed, which is enough to lookup the PhysicalPageEntry later.
2021-07-08Kernel: Move PhysicalPage classes out of the heap into an arrayTom
By moving the PhysicalPage classes out of the kernel heap into a static array, one for each physical page, we can avoid the added overhead and easily find them by indexing into an array. This also wraps the PhysicalPage into a PhysicalPageEntry, which allows us to re-use each slot with information where to find the next free page.
2021-07-08Kernel: Use PAE to allow accessing all physical memory beyond 4GBTom
We already use PAE for the NX bit, but this changes the PhysicalAddress structure to be able to hold 64 bit physical addresses. This allows us to use all the available physical memory.
2021-07-08Kernel: Add `memchr` and `malloc` to StdLib.cppDaniel Bertalan
These are needed by `libcxxabi`'s demangle support. `memchr` is taken straight-up from the `LibC/string.cpp` source code.
2021-07-08Kernel: Use range-for wherever possibleDaniel Bertalan
2021-07-08AK+Kernel: Fix perfect forwarding constructors shadowing othersDaniel Bertalan
If a non-const lvalue reference is passed to these constructors, the converting constructor will be selected instead of the desired copy/move constructor. Since I needed to touch `KResultOr` anyway, I made the forwarding converting constructor use `forward<U>` instead of `move`. This meant that previously, if a lvalue was passed to it, a move operation took place even if no `move()` was called on it. Member initializers and if-else statements have been changed to match our current coding style.
2021-07-08Everywhere: Mark debug-only functions `[[maybe_unused]]`Daniel Bertalan
These functions are only used from within `dbgln_if` calls, so in certain build configurations, they go unused. Similarly to variables, we now signal to the compiler that we understand that these are not always in use.
2021-07-08Kernel: Pledge promises accessible via /proc/PID/pledgeRalf Donau
2021-07-07Kernel: Map non-page-aligned text segments correctlyDaniel Bertalan
`.text` segments with non-aligned offsets had their lengths applied to the first page's base address. This meant that in some cases the last PAGE_SIZE - 1 bytes weren't mapped. Previously, it did not cause any problems as the GNU ld insists on aligning everything; but that's not the case with the LLVM toolchain.
2021-07-07Kernel: Print if image has become too large againLiav A
Instead of just disabling interrupts and halting when entering the C++ section, just halt with a printed message indicating the error.