summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2020-03-03Kernel: Fix race in clock_nanosleepBen Wiederhake
This is a complete fix of clock_nanosleep, because the thread holds the process lock again when returning from sleep()/sleep_until(). Therefore, no further concurrent invalidation can occur.
2020-03-03AK: Make quick_sort() a little more ergonomicAndreas Kling
Now it actually defaults to "a < b" comparison, instead of forcing you to provide a trivial less-than comparator. Also you can pass in any collection type that has .begin() and .end() and we'll sort it for you.
2020-03-02CPU: Change debug messages to fit the latest changesLiav A
2020-03-02Kernel: Run clang-format on various filesLiav A
2020-03-02Kernel: Use klog() instead of kprintf()Liav A
Also, duplicate data in dbg() and klog() calls were removed. In addition, leakage of virtual address to kernel log is prevented. This is done by replacing kprintf() calls to dbg() calls with the leaked data instead. Also, other kprintf() calls were replaced with klog().
2020-03-02Kernel: Use IOAddress class in PATAChannel classLiav A
This change make the code a bit more readable. Also, kprintf() calls are replaced with klog() calls.
2020-03-02Kernel: Use IOAddress class in Network adapters' driversLiav A
Also, kprintf() calls were replaced with klog() calls.
2020-03-02Kernel: MemoryManager should create cacheable regions by defaultAndreas Kling
2020-03-02Kernel: Remove ability to create kernel-only regions at user addressesAndreas Kling
This was only used by the mechanism for mapping executables into each process's own address space. Now that we remap executables on demand when needed for symbolication, this can go away.
2020-03-02Kernel: Map executables at a kernel address during ELF loadAndreas Kling
This is both simpler and more robust than mapping them in the process address space.
2020-03-02Kernel: Load executables on demand when symbolicatingAndreas Kling
Previously we would map the entire executable of a program in its own address space (but make it unavailable to userspace code.) This patch removes that and changes the symbolication code to remap the executable on demand (and into the kernel's own address space instead of the process address space.) This opens up a couple of further simplifications that will follow.
2020-03-02AK: Move the wildcard-matching implementation to StringUtilshowar6hill
Provide wrappers in the String and StringView classes, and add some tests.
2020-03-02Kernel: Make the "entire executable" region sharedAndreas Kling
This makes Region::clone() do the right thing with it on fork().
2020-03-01Kernel: Mark read-only PT_LOAD mappings as shared regionsAndreas Kling
This makes Region::clone() do the right thing for these now that we differentiate based on Region::is_shared().
2020-03-01Kernel: Use SharedInodeVMObject for executables after allAndreas Kling
I had the wrong idea about this. Thanks to Sergey for pointing it out! Here's what he says (reproduced for posterity): > Private mappings protect the underlying file from the changes made by > you, not the other way around. To quote POSIX, "If MAP_PRIVATE is > specified, modifications to the mapped data by the calling process > shall be visible only to the calling process and shall not change the > underlying object. It is unspecified whether modifications to the > underlying object done after the MAP_PRIVATE mapping is established > are visible through the MAP_PRIVATE mapping." In practice that means > that the pages that were already paged in don't get updated when the > underlying file changes, and the pages that weren't paged in yet will > load the latest data at that moment. > The only thing MAP_FILE | MAP_PRIVATE is really useful for is mapping > a library and performing relocations; it's definitely useless (and > actively harmful for the system memory usage) if you only read from > the file. This effectively reverts e2697c2dddd531c0ac7cad3fd6ca78e81d0d86da.
2020-03-01Kernel: Run clang-format on Process.cppAndreas Kling
2020-03-01Kernel: Fix suspicious local shadowing in PerformanceEventBufferAndreas Kling
2020-03-01Kernel: Name perfcore files "perfcore.PID"Andreas Kling
This way we can trace many things and we get one perfcore file per process instead of everyone trying to write to "perfcore"
2020-03-01Kernel: Reduce code duplication a little bit in Region allocationAndreas Kling
This patch reduces the number of code paths that lead to the allocation of a Region object. It's quite hard to follow the various ways in which this can happen, so this is an effort to simplify.
2020-03-01Kernel: Move ProcessPagingScope to its own filesAndreas Kling
2020-03-01Kernel: Restore the previous thread state on SIGCONT after SIGSTOPAndreas Kling
When stopping a thread with the SIGSTOP signal, we now store the thread state in Thread::m_stop_state. That state is then restored on SIGCONT. This fixes an issue where previously-blocked threads would unblock upon resume. Now they simply resume in the Blocked state, and it's up to the regular unblocking mechanism to unblock them. Fixes #1326.
2020-03-01Kernel: Remove some unnecessary .characters() when doing dbg()<<StringAndreas Kling
2020-03-01AK: Remove unnecessary casts to size_t, after Vector changesAndreas Kling
Now that Vector uses size_t, we can remove a whole bunch of redundant casts to size_t.
2020-03-01Kernel: Remove some more harmless InodeVMObject miscastsAndreas Kling
2020-03-01Kernel: Include the dirty bits when cloning an InodeVMObjectAndreas Kling
Now that (private) InodeVMObjects can be CoW-cloned on fork(), we need to make sure we clone the dirty bits as well.
2020-03-01Kernel: Fix harmless type miscast in Process::amount_clean_inode()Andreas Kling
2020-03-01Kernel: Use PrivateInodeVMObject for loading program executablesAndreas Kling
This will be a memory usage pessimization until we actually implement CoW sharing of the memory pages with SharedInodeVMObject. However, it's a huge architectural improvement, so let's take it and improve on this incrementally. fork() should still be neutral, since all private mappings are CoW'ed.
2020-03-01Kernel: Add some InodeVMObject type assertions in Region::clone()Andreas Kling
Let's make sure that we're never cloning shared inode-backed objects as if they were private, and vice versa.
2020-03-01Kernel: Remove some Region construction helpersAndreas Kling
It's now up to the caller to provide a VMObject when constructing a new Region object. This will make it easier to handle things going wrong, like allocation failures, etc.
2020-03-01Kernel: CoW-clone private inode-backed memory regions on fork()Andreas Kling
When forking a process, we now turn all of the private inode-backed mmap() regions into copy-on-write regions in both the parent and child. This patch also removes an assertion that becomes irrelevant.
2020-02-29Kernel: Disable interrupts throughout Thread::raw_backtrace()Andreas Kling
Otherwise we may hit an assertion when validating stack addresses.
2020-02-29Kernel: Return bytes written if sys$write() fails after writing someAndreas Kling
If we wrote anything we should just inform userspace that we did, and not worry about the error code. Userspace can call us again if it wants, and we'll give them the error then.
2020-02-29Kernel: Simplify some dbg() loggingAndreas Kling
We don't have to log the process name/PID/TID, dbg() automatically adds that as a prefix to every line. Also we don't have to do .characters() on Strings passed to dbg() :^)
2020-02-29Init Stage: Use latest changesLiav A
Now we setup interrupts before ACPI, and we don't use the ACPI parser to find the MADT table anymore.
2020-02-29Kernel: Simplify interrupt managementLiav A
The IRQController object is RefCounted, and is shared between the InterruptManagement class & IRQ handlers' classes. IRQHandler, SharedIRQHandler & SpuriousInterruptHandler classes use a responsible IRQ controller directly instead of calling InterruptManagement for disable(), enable() or eoi(). Also, the initialization process of InterruptManagement is simplified, so it doesn't rely on an ACPI parser to be initialized.
2020-02-29PCI: Adopt changes in ACPI definitions fileLiav A
2020-02-29ACPI: Adopt the changes in the definitions fileLiav A
Also, the functions for StaticParsing namespace were added. Therefore, some early access functionality is being used also in ACPI::StaticParser class.
2020-02-29ACPI: Reorganize the definitions fileLiav A
More namespaces have been added to organize the declarations in a more sensible way. Also, a namespace StaticParsing has been added to allow early access to ACPI tables.
2020-02-29Kernel: Initialize Spurious IRQ handlers in switch_to_pic_mode()Liav A
2020-02-29CPU: Simplify handle_interrupt() functionLiav A
2020-02-29Kernel: Delete unnecessary register & unregister callsLiav A
2020-02-29Kernel: Add SpuriousInterruptHandler classLiav A
This type of interrupt handler should handle spurious IRQs.
2020-02-29Kernel: Add SpuriousInterruptHandler type into HandlerPurposeLiav A
2020-02-28Kernel: Expose the VMObject type of each Region in /proc/PID/vmAndreas Kling
2020-02-28Kernel: Implement basic support for sys$mmap() with MAP_PRIVATEAndreas Kling
You can now mmap a file as private and writable, and the changes you make will only be visible to you. This works because internally a MAP_PRIVATE region is backed by a unique PrivateInodeVMObject instead of using the globally shared SharedInodeVMObject like we always did before. :^) Fixes #1045.
2020-02-28Kernel: Remove some unnecessary indirection in InodeFile::mmap()Andreas Kling
InodeFile now directly calls Process::allocate_region_with_vmobject() instead of taking an awkward detour via a special Region constructor.
2020-02-28Kernel: Split InodeVMObject into two subclassesAndreas Kling
We now have PrivateInodeVMObject and SharedInodeVMObject, corresponding to MAP_PRIVATE and MAP_SHARED respectively. Note that PrivateInodeVMObject is not used yet.
2020-02-28Kernel: Rename InodeVMObject => SharedInodeVMObjectAndreas Kling
2020-02-28Kernel: Make Process::m_master_tls_region a WeakPtrAndreas Kling
Let's not keep raw Region* variables around like that when it's so easy to avoid it.
2020-02-28Kernel: Remove SmapDisabler in sys$connect()Andreas Kling