summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2022-04-02Kernel: Add all memory files to aarch64 and fix resulting linker errorsJames Mintram
2022-04-02Kernel: Re-add AK files to aarch64James Mintram
2022-04-02Kernel: Make MemoryManager compile on aarch64James Mintram
2022-04-02Kernel: Make handle_crash available to aarch64James Mintram
2022-04-02Kernel: Make PageDirectory.cpp compile on aarch64James Mintram
2022-04-02Kernel: Make PhysicalRegion.cpp compile on aarch64James Mintram
2022-04-02Kernel: Make AddressSpace.cpp compile on aarch64James Mintram
2022-04-02Kernel: Make Region.cpp compile on aarch64James Mintram
2022-04-02Kernel: Add missing new/delete and kcalloc to dummy.cppJames Mintram
2022-04-02Kernel: Re-add dummy.cpp and remove duplicate definitionsJames Mintram
2022-04-02Kernel: Add idle_thread() to aarch64 Processor.hJames Mintram
2022-04-02Kernel: Add PAGE_MASK to an aarch64 CPU headerJames Mintram
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-04-01Kernel: Stop debug spam when using read on /dev/mem deviceLiav A
This is not really useful and quite annoying so let's disable it by default.
2022-04-01Kernel: Stop debug spam when using mmap on /dev/mem deviceLiav A
This is not really useful and quite annoying so let's disable it by default.
2022-04-01Kernel: Declare Device major and minor data member numbers as constLiav A
This is just another "safety guard" to ensure these numbers don't ever change after being set for a certain Device at construction time.
2022-04-01Kernel: Allow SysFS components to have non-zero sizeLiav A
This is important for dmidecode because it does an fstat on the DMI blobs, trying to figure out their size. Because we already know the size of the blobs when creating the SysFS components, there's no performance penalty whatsoever, and this allows dmidecode to not use the /dev/mem device as a fallback.
2022-04-01Kernel: Declare DMI SysFS BIOS classes as finalLiav A
2022-04-01Kernel: Declare blob sizes of SysFS BIOS classes as constLiav A
2022-04-01Kernel: Initialize primitive data members of SysFS BIOS classesLiav A
2022-03-30Kernel: Fix storage device read/write for request length < block sizePankaj Raghav
The current implementation of read/write will fail in StorageDevice when the request length is less than the block size of the underlying device. Fix it by calculating the offset within a block for such cases and using it for copying data from the bounce buffer.
2022-03-29Kernel: Disallow elevating pledge promises with no_error setAli Mohammad Pur
8233da33985bf834685bc215a8a9ed261e674f5f introduced a not-so-subtle bug where an application with an existing pledge set containing `no_error` could elevate its pledge set by pledging _anything_, this commit makes sure that no new promise is accepted.
2022-03-28Kernel: Propagate HIDManagement initialisation error to initLorenz Steinert
Initialisation errors for HIDManagement are now returned to the init. In the init we assert by MUST if we get an error.
2022-03-28Kernel/Devices/HID: Propagate errors of HIDDevices properlyLorenz Steinert
Some error indication was done by returning bool. This was changed to propagate the error by ErrorOr from the underlying functions. The returntype of the underlying functions was also changed to propagate the error.
2022-03-27Kernel: Support all AMD-defined CPUID feature flags for EAX=80000001hLinus Groh
We're now able to detect all the AMD-defined CPUID feature flags from ECX/EDX for EAX=80000001h :^)
2022-03-27Kernel: Support all Intel-defined extended CPUID feature flags for EAX=7Linus Groh
We're now able to detect all the extended CPUID feature flags from EBX/ECX/EDX for EAX=7 :^)
2022-03-27Kernel: Support all Intel-defined CPUID feature flags for EAX=1Linus Groh
We're now able to detect all the regular CPUID feature flags from ECX/EDX for EAX=1 :^) None of the new ones are being used for anything yet, but they will show up in /proc/cpuinfo and subsequently lscpu and SystemMonitor. Note that I replaced the periods from the SSE 4.1 and 4.2 instructions with underscores, which matches the internal enum names, Linux's /proc/cpuinfo and the general pattern of replacing special characters with underscores to limit feature names to [a-z0-9_]. The enum member stringification has been moved to a new function for better re-usability and to avoid cluttering up Processor.cpp.
2022-03-27Kernel: Implement CPUFeature as an ArbitrarySizedEnumLinus Groh
This will make it possible to add many, many more CPU features - more than the current limit 32 and later limit of 64 if we stick with an enum class to be specific :^)
2022-03-27Kernel: Fix whack formatting of the CPUID constructorLinus Groh
2022-03-27Kernel: Reorder code in Processor::cpu_detect() for readabilityLinus Groh
Checks of ECX go before EDX, and the bit indices are now ordered properly. Additionally, handling of the EDX[11] bit has been moved into a lambda function to keep the series of if statements neatly together. All of this makes it *a lot* easier to follow along and compare the implementation to the tables in the Intel manual, e.g. to find missing checks.
2022-03-27Kernel: Change the BSP Processor instance to not have a constructorTom
This solves a problem where any non-trivial member in the global BSP Processor instance would get re-initialized (improperly), losing data that was already initialized earlier.
2022-03-27Kernel: Remove hardcoded values for block size in IDEChannelPankaj Raghav
2022-03-27Kernel: Remove hardcoded values for block size in RamdiskPankaj Raghav
Instead of using the hardcoded 512 in Ramdisk, retrieve the block size value from the AsyncBlockDeviceRequest struct.
2022-03-27Kernel: Expose block size in AsyncBlockDeviceRequest structPankaj Raghav
Expose the block size variable via a member function in the AsyncBlockDeviceRequest so that the driver doesn't need to assume any value such as 512 bytes.
2022-03-27Kernel: Use buffer_size from AsyncBlockDevice structPankaj Raghav
The underlying driver does not need to recalculate the buffer size as it is passed in the AsyncBlockDevice struct anyway. This also helps in removing any assumptions of the underlying block size of the device.
2022-03-26Kernel: Add a 'no_error' pledge promiseAli Mohammad Pur
This makes pledge() ignore promises that would otherwise cause it to fail with EPERM, which is very useful for allowing programs to run under a "jail" so to speak, without having them termiate early due to a failing pledge() call.
2022-03-26Kernel: Add a way to print the pseudo name of attached TTY of a processLiav A
Contrary to the past, we don't attempt to assume the real name of a TTY device, but instead, we generate a pseudo name only when needed to do so which is still OK because we don't break abstraction layer rules and we still can provide userspace with the required information.
2022-03-24Kernel: Add a 'disable_kaslr' kernel command line parameterIdan Horowitz
This parameter can be used to disable the KASLR mechanism.
2022-03-24Kernel: Move {strnlen, strcmp, memcmp, strncmp, strstr} to MiniStdLibIdan Horowitz
This lets the Prekernel also use these simple (and standalone) C functions.
2022-03-23Kernel: Use the whole kernel PD range when randomizing the KASLR offsetIdan Horowitz
Now that we reclaim the memory range that is created by KASLR before the start of the kernel image, there's no need to be conservative with the KASLR offset.
2022-03-22Kernel: Don't assume paths of TTYs and pseudo terminals anymoreLiav A
The obsolete ttyname and ptsname syscalls are removed. LibC doesn't rely on these anymore, and it helps simplifying the Kernel in many places, so it's an overall an improvement. In addition to that, /proc/PID/tty node is removed too as it is not needed anymore by userspace to get the attached TTY of a process, as /dev/tty (which is already a character device) represents that as well.
2022-03-22Kernel/TTY: Implement TIOCGPTN ioctl for MasterPTYLiav A
This ioctl operation will allow userspace to determine the index number of a MasterPTY after opening /dev/ptmx and actually getting an internal file descriptor of MasterPTY.
2022-03-22Kernel: Create SelfTTYDevice class to help replace /dev/tty symlinkLiav A
This will replace the /dev/tty symlink created by SystemServer, so instead of a symlink, a character device will be created. When doing read(2), write(2) and ioctl(2) on this device, it will "redirect" these operations to the attached TTY of the current process.
2022-03-22Kernel: Add and use bitwise operators to CPUFeatureHendiadyoin1
2022-03-22Kernel: Use the pre-image kernel memory range introduced by KASLRIdan Horowitz
This ensures we don't just waste the memory range between the default base load address and the actual load address that was shifted by the KASLR offset.
2022-03-22Kernel: Keep kernel base load address 2 MiB alignedIdan Horowitz
This requirement comes from the fact the Prekernel mapping logic only uses 2 MiB pages. This unfortunately reduces the bits of entropy in kernel addresses from 16 bits to 7, but it could be further improved in the future by making the Prekernel mapping logic a bit more dynamic.
2022-03-22Kernel: Fix typo in a commentLinus Groh
2022-03-22Kernel: Make mmap validation functions return ErrorOr<void>int16
2022-03-22Kernel: Move mmap validation functions to Processint16
2022-03-22Kernel: Check wxallowed mount flag when validating mmap callint16