summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2020-03-24Interrupts: Do a specific EOI when using the PICLiav A
Before this change, we did a non-specific EOI, which could lead to problems with other IRQs that are handled in the PIC. Since the original 8259A datasheet permits such functionality and we are not losing any functionality, this change is acceptable even though we don't experience problems with the EOI currently.
2020-03-24Kernel: Limit IRQ rate within E1000 network adapterLiav A
This is not a complete fix, since spurious IRQs under heavy loads can still occur. However, this fix limits the amount of spurious IRQs. It is encouraged to provide a better fix in the future, probably something that takes into account handling of PCI level-triggered interrupts.
2020-03-24Interrupts: Assert if trying to install an handler on syscall vectorLiav A
Installing an interrupt handler on the syscall IDT vector can lead to fatal results, so we must assert if that happens.
2020-03-24Kernel: Abstract IRQ controller handling from Interrupt handlersLiav A
Now we don't send raw numbers, but we let the IRQController object to figure out the correct IRQ number. This helps in a situation when we have 2 or more IOAPICs, so if IOAPIC 1 is assigned for IRQs 0-23 and IOAPIC 2 is assigned for IRQs 24-47, if an IRQHandler of IRQ 25 invokes disable() for example, it will call his responsible IRQController (IOAPIC 2), and the IRQController will subtract the IRQ number with his assigned offset, and the result is that the second redirection entry in IOAPIC 2 will be masked.
2020-03-24Kernel: Correct Spurious Interrupt handlers' controller model() methodLiav A
We don't return blindly the IRQ controller's model(), if the Spurious IRQ handler is installed in IOAPIC environment, it's misleading to return "IOAPIC" string since IOAPIC doesn't really handle Spurious IRQs, therefore we return a "" string.
2020-03-24Kernel: Create an interface for conversion between IRQs and interruptsLiav A
2020-03-24Kernel: Ensure that we don't use a hard-disabled IRQControllerLiav A
2020-03-24Kernel: Enable IRQs before sending commands to the E1000 adapterLiav A
This change prevents a race condition, in which case we send a command and we are losing an interrupt.
2020-03-24Kernel: Change the Spurious Interrupt Handler offset in the APICLiav A
The Spurious Interrupt Handler number that is written to APIC_REG_SIV is correct now.
2020-03-24CPU: Move EOI call to the end of handle_interrupt()Liav A
2020-03-24Kernel: Run QEMU machine with two virtual processorsLiav A
2020-03-24Kernel: Change noacpi GRUB entry to use the right boot argumentLiav A
2020-03-23AK: Reduce header dependency graph of String.hAndreas Kling
String.h no longer pulls in StringView.h. We do this by moving a bunch of String functions out-of-line.
2020-03-23Toolchain/Ports: Update gcc to 9.3.0Shannon Booth
Ever closer to C++20! Also fix up some of those pesky "'s
2020-03-22AK: Add FlyString, a simple flyweight string classAndreas Kling
FlyString is a flyweight string class that wraps a RefPtr<StringImpl> known to be unique among the set of FlyStrings. The class is very unoptimized at the moment. When to use FlyString: - When you want O(1) string comparison - When you want to deduplicate a lot of identical strings When not to use FlyString: - For strings that don't need either of the above features - For strings that are likely to be unique
2020-03-22Kernel: Fix compilation error with ACPI_DEBUG enabledShannon Booth
2020-03-22Kernel: Simplify process assertion checking if region is in rangeShannon Booth
Let's use the helper function for this :)
2020-03-22Kernel: Run clang-format on filesShannon Booth
Let's rip off the band-aid
2020-03-21Build: Add FreeBSD support (#1492)BenJilks
2020-03-19Process: Use monotonic time for timeoutsLiav A
2020-03-19Scheduler: Use monotonic time for blocking threadsLiav A
2020-03-19Kernel: Add new syscall to allow changing the system dateLiav A
2020-03-19Kernel: Delete unnecessary filesLiav A
2020-03-19Kernel: Introduce the new Time management subsystemLiav A
This new subsystem includes better abstractions of how time will be handled in the OS. We take advantage of the existing RTC timer to aid in keeping time synchronized. This is standing in contrast to how we handled time-keeping in the kernel, where the PIT was responsible for that function in addition to update the scheduler about ticks. With that new advantage, we can easily change the ticking dynamically and still keep the time synchronized. In the process context, we no longer use a fixed declaration of TICKS_PER_SECOND, but we call the TimeManagement singleton class to provide us the right value. This allows us to use dynamic ticking in the future, a feature known as tickless kernel. The scheduler no longer does by himself the calculation of real time (Unix time), and just calls the TimeManagment singleton class to provide the value. Also, we can use 2 new boot arguments: - the "time" boot argument accpets either the value "modern", or "legacy". If "modern" is specified, the time management subsystem will try to setup HPET. Otherwise, for "legacy" value, the time subsystem will revert to use the PIT & RTC, leaving HPET disabled. If this boot argument is not specified, the default pattern is to try to setup HPET. - the "hpet" boot argumet accepts either the value "periodic" or "nonperiodic". If "periodic" is specified, the HPET will scan for periodic timers, and will assert if none are found. If only one is found, that timer will be assigned for the time-keeping task. If more than one is found, both time-keeping task & scheduler-ticking task will be assigned to periodic timers. If this boot argument is not specified, the default pattern is to try to scan for HPET periodic timers. This boot argument has no effect if HPET is disabled. In hardware context, PIT & RealTimeClock classes are merely inheriting from the HardwareTimer class, and they allow to use the old i8254 (PIT) and RTC devices, managing them via IO ports. By default, the RTC will be programmed to a frequency of 1024Hz. The PIT will be programmed to a frequency close to 1000Hz. About HPET, depending if we need to scan for periodic timers or not, we try to set a frequency close to 1000Hz for the time-keeping timer and scheduler-ticking timer. Also, if possible, we try to enable the Legacy replacement feature of the HPET. This feature if exists, instructs the chipset to disconnect both i8254 (PIT) and RTC. This behavior is observable on QEMU, and was verified against the source code: https://github.com/qemu/qemu/commit/ce967e2f33861b0e17753f97fa4527b5943c94b6 The HPETComparator class is inheriting from HardwareTimer class, and is responsible for an individual HPET comparator, which is essentially a timer. Therefore, it needs to call the singleton HPET class to perform HPET-related operations. The new abstraction of Hardware timers brings an opportunity of more new features in the foreseeable future. For example, we can change the callback function of each hardware timer, thus it makes it possible to swap missions between hardware timers, or to allow to use a hardware timer for other temporary missions (e.g. calibrating the LAPIC timer, measuring the CPU frequency, etc).
2020-03-19Kernel & LibC: Add CLOCK_REALTIME constantLiav A
2020-03-19ACPI: Delete irrelevant HPET definitionsLiav A
Also, the definition of the HPET ACPI table is correct now, in accordance to the HPET specification, revision 1.0a, October 2004.
2020-03-19Interrupts: Add an interface to determine if SMP is enabledLiav A
2020-03-19Kernel: Use a const reference to RegisterState in IRQ handlingLiav A
2020-03-19Kernel: Remove unnecessary include from PATAChannel.cppLiav A
2020-03-19Kernel: Add the NonMaskableInterruptDisabler classLiav A
This class will be used later to disable NMIs when we initialize the RTC timer.
2020-03-19Kernel: Resolve relative paths when there is a veil (#1474)Alex Muscar
2020-03-18Calendar: Implement basic GUI calendar applicationrhin123
2020-03-16Kernel: Add sys$get_stack_bounds() for finding the stack base & sizeAndreas Kling
This will be useful when implementing conservative garbage collection.
2020-03-15Userland: ifconfig can change the IP address of the default gatewaymarprok
ioctl can now perform a request for a specific route and change the address of it's default gateway.
2020-03-12ACPI: Examine bit width in Generic address structure before assertingLiav A
Also, the switch-case flow is simplified for IO access within a Generic address strucuture's handling.
2020-03-12ACPI: Keep common flags in structures for later usageLiav A
2020-03-12Ext2FS: Reset the found_a_group flagmarprok
2020-03-11Userland: Set the mask of a network adapter with ifconfig (#1388)Marios Prokopakis
A new IP address or a new network mask can be specified in the command line arguments of ifconfig to replace the old values of a given network adapter. Additionally, more information is being printed for each adapter.
2020-03-10Kernel: Get rid of SmapDisabler in sys$fstat()Andreas Kling
2020-03-09Games: Added solitaire to build-root-filesystem.shTill Mayer
2020-03-09Kernel: Allow to reboot in ACPI via PCI or MMIO accessLiav A
Also, we determine if ACPI reboot is supported by checking the FADT flags' field.
2020-03-09PCI: Enable LogStream output for addressesLiav A
2020-03-09LibBareMetal: Return FlatPtr from PhysicalAddress::offset_in_page()Liav A
2020-03-08Kernel: Ensure RTL8139NetworkAdapter uses virtual memory correctlyLiav A
2020-03-08Kernel: Ensure E1000NetworkAdapter uses virtual memory correctlyLiav A
2020-03-08Kernel: Allow contiguous allocations in physical memoryLiav A
For that, we have a new type of VMObject, called ContiguousVMObject, that is responsible for allocating contiguous physical pages.
2020-03-08Kernel: Fix race in waitidBen Wiederhake
This is similar to 28e1da344d1de4fb80ce9e9c8da9127fa8606dc7 and 4dd4dd2f3c067eca446d9513e814ae9aaa648882. The crux is that wait verifies that the outvalue (siginfo* infop) is writable *before* waiting, and writes to it *after* waiting. In the meantime, a concurrent thread can make the output region unwritable, e.g. by deallocating it.
2020-03-08Kernel: Fix race in selectBen Wiederhake
This is similar to 28e1da344d1de4fb80ce9e9c8da9127fa8606dc7 and 4dd4dd2f3c067eca446d9513e814ae9aaa648882. The crux is that select verifies that the filedescriptor sets are writable *before* blocking, and writes to them *after* blocking. In the meantime, a concurrent thread can make the output buffer unwritable, e.g. by deallocating it.
2020-03-08Kernel: Fix inconsistent inclusion styleBen Wiederhake
This also makes it easier to automatically parse the dependency tree. Thankfully, this is the only place where a change was necessary.
2020-03-08Kernel: Add missing #includes now that <AK/StdLibExtras.h> is smallerAndreas Kling