summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2022-10-22Kernel+Base: Introduce MS_NOREGULAR mount flagLiav A
This flag doesn't conform to any POSIX standard nor is found in any OS out there. The idea behind this mount flag is to ensure that only non-regular files will be placed in a filesystem, which includes device nodes, symbolic links, directories, FIFOs and sockets. Currently, the only valid case for using this mount flag is for TmpFS instances, where we want to mount a TmpFS but disallow any kind of regular file and only allow other types of files on the filesystem.
2022-10-22Kernel: Remove the DevTmpFS classLiav A
Although this code worked quite well, it is considered to be a code duplication with the TmpFS code which is more tested and works quite well for a variety of cases. The only valid reason to keep this filesystem was that it enforces that no regular files will be created at all in the filesystem. Later on, we will re-introduce this feature in a sane manner. Therefore, this can be safely removed after SystemServer no longer uses this filesystem type anymore.
2022-10-22Kernel: Add support for device nodes in TmpFSLiav A
Later on we will remove the DevTmpFS code, so in order to support mounting TmpFS instead, we need to be able to create device nodes on the filesystem.
2022-10-20Kernel/aarch64: Stub enough functions to build Random.cppTimon Kruiper
Also update Random.cpp such that it builds for aarch64.
2022-10-20Kernel/aarch64: Store a pointer to the current Thread on ProcessorTimon Kruiper
And also implemented and update the related functions.
2022-10-20Kernel/aarch64: Force kmalloc to return 16 byte aligned pointersTimon Kruiper
KUBSAN complained about a misaligned address when trying to construct the Thread class.
2022-10-20Kernel/aarch64: Stub enough functions to build Process.cppTimon Kruiper
ProcessProcFSTraits.cpp is also added the CMakeLists.
2022-10-20Kernel/aarch64: Stub WaitQueueBlocker::unblock to build WaitQueue.cppTimon Kruiper
2022-10-20Kernel/aarch64: Stub more functions to build Thread.cppTimon Kruiper
2022-10-19Kernel: Don't assume paths to children PID directories in ProcFS codeLiav A
Instead of using absolute paths which is considered an abstraction layer violation between the kernel and userspace, let's not hardcode the path to children PID directories but instead we can use relative path links to them.
2022-10-18Kernel/aarch64: Stub more functions to be able to build Scheduler.cppTimon Kruiper
With all these functions stubbed, Scheduler.cpp is now buidable!
2022-10-18Kernel: Call Processor::are_interrupts_enabled in Scheduler::idle_loopTimon Kruiper
This expresses the intent better, and we shouldn't be calling global functions anyway.
2022-10-18Kernel: Reintroduce `ScopedAddressSpaceSwitcher` to aarch64 buildJesse Buhagiar
2022-10-18Kernel: Reintroduce `Mutex.cpp` to aarch64 buildJesse Buhagiar
A few more stubs have been added to support the building of this file
2022-10-18Kernel: Reintroduce `Credentials.cpp` to aarch64 buildJesse Buhagiar
2022-10-18Kernel: Add more stubs for the Thread classJesse Buhagiar
Slowly getting there...
2022-10-18Kernel: Prevent atomic read/write from failing on nullptrJesse Buhagiar
Having this function return `nullptr` explicitly triggers the compiler's inbuilt checker, as it knows the destination is null. Having this as a static (scoped) variable for now circumvents this problem.
2022-10-18Kernel: Include `KBufferBuilder.cpp` in aarch64 buildJesse Buhagiar
2022-10-18Kernel: Add even more AARCH64 stubsGunnar Beutner
2022-10-18Kernel: Add more AARCH64 stubsGunnar Beutner
2022-10-18Kernel/USB: Refactor USB Pipeb14ckcat
Decompose the current monolithic USBD Pipe interface into several subclasses, one for each pair of endpoint type & direction. This is to make it more clear what data and functionality belongs to which Pipe type, and prevent nonsensical things like trying to execute a control transfer on a non-control pipe. This is important, because the Pipe class is the interface by which USB device drivers will interact with the HCD, so the clearer and more explicit this interface is the better.
2022-10-18Kernel/USB: Adjust USB Pipe bufferb14ckcat
Allocate DMA buffer pages for use within the USBD Pipe class, and allow for the user to specify the size of this buffer, rounding up to the next page boundary.
2022-10-17Kernel/aarch64: Initialize TimeManagement in init.cppTimon Kruiper
Also remove the check for aarch64 in AK/Format.cpp, so now the format functions will prepend the time since boot!
2022-10-17Kernel: Implement TimeManagement for aarch64Timon Kruiper
This sets up the RPi::Timer to trigger an interurpt every 4ms using one of the comparators. The actual time is calculated by looking at the main counter of the RPi::Timer using the Timer::update_time function. A stub for Scheduler::timer_tick is also added, since the TimeManagement code now calls the function.
2022-10-17Kernel/aarch64: Implement HardwareTimer for RPi::TimerTimon Kruiper
This makes the RPi::Timer suitable for use in the TimeManagement code.
2022-10-17Kernel: Correctly calculate delta_ticks when 64-bit counter wraps aroundTimon Kruiper
We never caught this bug in the HPET, since it takes ages for a 64-bit counter to wrap around. Also remove an unnecessary if check.
2022-10-17Kernel/aarch64: Add implementation for Processor::current_in_irqTimon Kruiper
2022-10-17Kernel/aarch64: Add implementation of Processor::is_bootstrap_processorTimon Kruiper
This should really go into a generic Processor class, but there is no such class yet, so a FIXME is added for that.
2022-10-17Kernel: Move InterruptDisabler out of Arch directoryTimon Kruiper
The code in this file is not architecture specific, so it can be moved to the base Kernel directory.
2022-10-17Kernel: Mark Version.h as a dependency of Kernel rather than ALLAndrew Kaster
2022-10-16Kernel: Use more fine-grained content data block granularity in TmpFSLiav A
Instead of just having a giant KBuffer that is not resizeable easily, we use multiple AnonymousVMObjects in one Vector to store them. The idea is to not have to do giant memcpy or memset each time we need to allocate or de-allocate memory for TmpFS inodes, but instead, we can allocate only the desired block range when trying to write to it. Therefore, it is also possible to have data holes in the inode content in case of skipping an entire set of one data block or more when writing to the inode content, thus, making memory usage much more efficient. To ensure we don't run out of virtual memory range, don't allocate a Region in advance to each TmpFSInode, but instead try to allocate a Region on IO operation, and then use that Region to map the VMObjects in IO loop.
2022-10-16Kernel: Add more stubs needed for Thread.cppGunnar Beutner
2022-10-16Kernel: Don't directly include <Kernel/Arch/x86/TrapFrame.h>Gunnar Beutner
This adds a new arch-independent header which in turn includes the correct header for the build architecture.
2022-10-16Kernel: Add VALIDATE_IS_AARCH64 guard macroGunnar Beutner
2022-10-16Kernel: Replace VERIFY_NOT_REACHED with TODO_AARCH64Gunnar Beutner
This makes it easier to differentiate between cases where certain functionality is not implemented vs. cases where a code location should really be unreachable.
2022-10-16Kernel/SysFS: Expose file size of ACPI tables in /sys/firmware/acpiLiav A
It costs us nothing, and some utilities (such as the known file utility) rely on the exposed file size (after doing lstat on it), to show anything useful besides saying the file is "empty".
2022-10-16Kernel: Initialize primitive class member of ACPISysFSComponent to zeroLiav A
2022-10-16Kernel: Add formal Processor::verify_no_spinlocks_held() APIBrian Gianforcaro
In a few places we check `!Processor::in_critical()` to validate that the current processor doesn't hold any kernel spinlocks. Instead lets provide it a first class name for readability. I'll also be adding more of these, so I would rather add more usages of a nice API instead of this implicit/assumed logic.
2022-10-16Kernel: Remove unused /proc/devices nodeLiav A
This node is not used anymore, so let's remove it.
2022-10-15Kernel: Fix build error on AARCH64Gunnar Beutner
This currently fails with: error: #pragma once in main file [-Werror]
2022-10-14Kernel: Add support for the FAT32 filesystemUndefine
This commit adds read-only support for the FAT32 filesystem. It also includes support for long file names.
2022-10-14Kernel: Move Scheduler current time method to the TimeManagement codeLiav A
2022-10-14Kernel: Abstract platform-specific current time methods from SchedulerLiav A
This change ensures that the scheduler doesn't depend on a platform specific or arch-specific code when it initializes itself, but rather we ensure that in compile-time we will generate the appropriate code to find the correct arch-specific current time methods.
2022-10-14Kernel: Read version and git commit hash from baked-in version infokleines Filmröllchen
... instead of hard-coding it in the uname syscall.
2022-10-14Kernel: Move sys$uname to use TypedTransferkleines Filmröllchen
This should equate to roughly the same code but improve typechecking.
2022-10-14Kernel: Bake version information into the Kernelkleines Filmröllchen
This is done by generating a Kernel/Version.h header with major version, minor version, and git hash.
2022-10-14Kernel+LibC: Add registers for AARCH64 in __mcontextGunnar Beutner
2022-10-14Kernel: Remove -nodefaultlibs compiler optionsGunnar Beutner
This was necessary until a few months ago because of b0rked toolchain options.
2022-10-14Kernel: Implement userspace support for syscalls on AARCH64Gunnar Beutner
There are no guarantees that the final syscall API will look like this but at least for now this lets us compile the userland binaries.
2022-10-13Kernel: Add StdLib.cpp and UserOrKernelBuffer.cpp to aarch64 buildTimon Kruiper
Also remove UserOrKernelBuffer::{read, write} and __stack_chk_fail from Dummy.cpp and init.cpp respectively.