summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2022-02-13Kernel: Fix deadlock when setting VirtIOGPU resolutionSahan Fernando
2022-02-12Kernel: Increase attempts count when waiting before doing i8042 IOLiav A
Apparently on VirtualBox the keyboard device refused to complete the reset sequence. With longer delays and more attempts before giving up, it seems like the problem is gone.
2022-02-12Kernel: Increase delay and attempts count when checking i8042 existenceLiav A
2022-02-11Meta: Enable RELR relocationsDaniel Bertalan
Also add a check to serenity.sh to ensure that the toolchain is new enough for this feature to work.
2022-02-11Kernel: Stop trying to write unmapped Process regions into CoreDumpsIdan Horowitz
If we crashed in the middle of mapping in Regions, some of the regions may not have a page directory yet, and will result in a crash when Region::remap() is called.
2022-02-11Kernel: Set up Regions before adding them to a Process's AddressSpaceIdan Horowitz
This reduces the amount of time in which not fully-initialized Regions are present inside an AddressSpace's region tree.
2022-02-11Kernel: Make SharedInodeVMObject pages Bitmap allocation OOM-fallibleIdan Horowitz
2022-02-11Kernel: Make AnonymousVMObject COW-Bitmap allocation OOM-fallibleIdan Horowitz
2022-02-11AK: Make Bitmap construction OOM-fallibleIdan Horowitz
2022-02-11Kernel/Net: Don't update TCP socket "last sent ACK" field too earlyAndreas Kling
Defer updating this field until after the last fallible operation has succeeded.
2022-02-11Kernel/E1000: Bump RX/TX buffer count to 256/256Andreas Kling
We were frequently dropping packets when downloading large files. Then we had to wait for TCP retransmission which slowed things down. This patch dramatically improves E1000 throughput by increasing the number of RX/TX buffers from 32/8 to 256/256. The largest chunk of JavaScript from Discord now downloads in roughly 1 second instead of 7 seconds. :^)
2022-02-11Kernel: Make contiguous VM objects use "user physical pages" by defaultAndreas Kling
If someone specifically wants contiguous memory in the low-physical- address-for-DMA range ("super pages"), they can use the allocate_dma_buffer_pages() helper.
2022-02-11Kernel: Workaround QEMU hypervisor.framework CPUID max leaf bugIdan Horowitz
This works around issue #10382 until it is fixed on QEMU's side. Patch from Anonymous.
2022-02-10Kernel: Convert i8042 code to use the ErrorOr pattern more broadlyLiav A
Not only does it makes the code more robust and correct as it allows error propagation, it allows us to enforce timeouts on waiting loops so we don't hang forever, by waiting for the i8042 controller to respond to us. Therefore, it makes the i8042 more resilient against faulty hardware and bad behaving chipsets out there.
2022-02-10Kernel: Check i8042 existence before trying to use itLiav A
If we don't do so, we just hang forever because we assume there's i8042 controller in the system, which is not a valid assumption for modern PC hardware.
2022-02-09Kernel: Instantiate a TextModeConsole early on if there's no framebufferLiav A
If the bootloader that loaded us is providing a framebuffer details from the Multiboot protocol then we can instantiate a framebuffer console. Otherwise, we should use a text mode console, assuming that the BIOS and the bootloader didn't try to modeset the screen resolution so we have is a VGA 80x25 text mode being displayed on screen. Since "boot_framebuffer_console" is no longer a good representative as a global variable name, it's changed to g_boot_console to match the fact that it can be assigned with a text mode console and not framebuffer console if needed.
2022-02-09Kernel/Graphics: Don't assert when disabling TextModeConsoleLiav A
Not sure how it's useful to do so, let's not assert if something tries to disable it. If we will use TextModeConsole as a boot console, that console will be disabled after loading an appropriate console to replace it.
2022-02-09Kernel/Graphics: Untie Text mode console from VGACompatibleAdapter classLiav A
Instead, we can construct this type of object without having to instantiate a VGACompatibleAdapter object first. This can help instantiate such console very early on boot to aid debug issues on bare metal hardware.
2022-02-09Kernel: Change static constexpr variables to constexpr where possibleLenny Maiorani
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations. These changes result in a stripped x86_64 kernel binary size reduction of 592 bytes.
2022-02-09AK+Kernel: Alphabetize debug macrosLenny Maiorani
This is not ASCII-betical because `_` comes after all the uppercase characters. Treating `_` as a ` ` (space character), these lists are now alphabetical.
2022-02-09LibC+Kernel: Remove global variable use from snprintf and fprintfAndrew Kaster
The global variable use in these functions is super thread-unsafe and means that any concurrent calls to sprintf or fprintf in a process could race with each other and end up writing unexpected results. We can just replace the function + global variable with a lambda that captures the relevant argument when calling printf_internal instead.
2022-02-07Kernel: Fix bug in TCP state handling in SynSentJamie Mansfield
When receiving SYN while in SynSent, we now reply with SYN|ACK in addition to the SynSent->SynReceived transition.
2022-02-07Kernel: Robustify and rename Inode bound socket APIAndreas Kling
Rename the bound socket accessor from socket() to bound_socket(). Also return RefPtr<LocalSocket> instead of a raw pointer, to make it harder for callers to mess up.
2022-02-07Kernel: Ensure socket is suitable for writing in sys$sendmsgsin-ack
Previously we would return a bytes written value of 0 if the writing end of the socket was full. Now we either exit with EAGAIN if the socket description is non-blocking, or block until the description can be written to. This is mostly a copy of the conditions in sys$write but with the "total nwritten" parts removed as sys$sendmsg does not have that.
2022-02-06Kernel: Fix bugs in TCP state handling in FinWait1 & FinWait2Andreas Kling
1. When receiving FIN while in FinWait1, we now reply with ACK in addition to the FinWait1->Closing transition. 2. When receiving FIN|ACK while in FinWait1, we now reply with ACK and transition from FinWait1->TimeWait. 3. When receiving FIN while in FinWait2, we now reply with ACK.
2022-02-06Kernel: Send only FIN when shutting down TCP socket from ESTABLISHEDAndreas Kling
We were previously sending FIN|ACK for some reason.
2022-02-06AK: Move integral log2 and exp to IntegerMath.hHendiadyoin1
2022-02-06Kernel: Propagate sys$profiling_enable() buffer allocation failureAndreas Kling
Caught a kernel panic when enabling profiling of all threads when there was very little memory available.
2022-02-05Kernel: Put kmalloc heap expansion debug spam behind KMALLOC_DEBUGAndreas Kling
2022-02-05Kernel/Interrupts: Remove stale MSIHandler classLiav A
When we implement MSI support, we can rely on the IRQHandler class for installing IRQ handlers at the right location.
2022-02-04Kernel: Disable BootFramebufferConsole when drivers create a new oneTom
When GraphicsManagement initializes the drivers we can disable the bootloader framebuffer console. Right now we don't yet fully destroy the no longer needed console as it may be in use by another CPU.
2022-02-04Kernel: Set up an initial boot framebuffer consoleTom
Instead of seeing a black screen until GraphicsManagement was fully initialized, this allows us to see the console output much earlier. So, if the bootloader provided us with a framebuffer, set up a console as early as possible.
2022-02-04Kernel: Separate GenericFramebufferConsole implementationTom
The GenericFramebufferConsoleImpl class implements the logic without taking into account any other details such as synchronization. The GenericFramebufferConsole class then is a simple wrapper around GenericFramebufferConsoleImpl that takes care of synchronization. This allows us to re-use this implementation with e.g. different synchronization schemes.
2022-02-03Kernel: Remove the infallible make_ref_counted<T> factory functionIdan Horowitz
This function had no users, nor should it ever be used, as all allocation failures in the Kernel should be explicitly checked.
2022-02-03Kernel: Convert try_make_ref_counted to use ErrorOrIdan Horowitz
This allows more ergonomic memory allocation failure related error checking using the TRY macro.
2022-02-03Kernel: Stop using the make<T> factory method in the KernelIdan Horowitz
As make<T> is infallible, it really should not be used anywhere in the Kernel. Instead replace with fallible `new (nothrow)` calls, that will eventually be error-propagated.
2022-02-03Kernel: Ignore allocation failures when trying to retransmit packetsIdan Horowitz
We ignore allocation failures above the first 16 guaranteed socket slots, as we will just retransmit their packets the next time around.
2022-02-03Kernel: Stop allocating VirtIO configuration structs on the heapIdan Horowitz
These are trivially-copyable 12-byte structs, so there's no point in allocating them on the heap.
2022-02-03Revert "Kernel: Protect InodeWatcher internals with spinlock instead of mutex"Andreas Kling
This reverts commit 0bebf013e348f52f218535ebd3d82c9599ea5818. This caused a deadlock when handling a crashed process, so let's revert it until we can figure out what went wrong.
2022-02-03Kernel: Protect Inode flock list with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Remove unnecessary mutex for ubsan-is-deadly ProcFS nodeAndreas Kling
2022-02-03AK+Kernel+LibSanitizer: Store "ubsan-is-deadly" flag as Atomic<bool>Andreas Kling
2022-02-03Kernel: Protect InodeWatcher internals with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Protect PCI access with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Turn VirtIOGPU operation lock from mutex into spinlockAndreas Kling
2022-02-03Kernel: Protect FramebufferDevice with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Protect global device map with spinlock instead of mutxAndreas Kling
2022-02-03Kernel: Protect Inode's list of watchers with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Protect mounted filesystem list with spinlock instead of mutexAndreas Kling
2022-02-03Kernel: Protect network adapter list with spinlock instead of mutexAndreas Kling