Commit graph

7159 commits

Author SHA1 Message Date
Andreas Kling 0132e494d6 Kernel: Add missing #include in SysFS.cpp 2022-06-17 12:22:07 +02:00
Liav A 30b58cd06c Kernel/SysFS: Remove derived BIOSSysFSComponent classes
These are not needed, because both do exactly the same thing, so we can
move the code to the BIOSSysFSComponent class.
2022-06-17 11:01:27 +02:00
Liav A 23c1c40e86 Kernel/SysFS: Migrate components code from SysFS.cpp to the SysFS folder 2022-06-17 11:01:27 +02:00
Liav A 4d05a41b30 Kernel/SysFS: Split the bulky BIOS.h file into multiple files 2022-06-17 11:01:27 +02:00
Liav A 9c6834698f Kerenl/Firmware: Add map_ebda and map_bios methods in the original place
In a previous commit I moved everything into the new subdirectories in
FileSystem/SysFS directory without trying to actually make changes in
the code itself too much. Now it's time to split the code to make it
more readable and understandable, hence this change occurs now.
2022-06-17 11:01:27 +02:00
Liav A 7310a9a641 Kernel/Interrupts: Add missing include for IRQController header file
This is necessary for the next commit in the patch, otherwise this can't
be compiled. It seems like this was a hidden issue that is discovered
now only by changing includes in a mass-scale.
2022-06-17 11:01:27 +02:00
Liav A 99bac4f34f Kernel/SysFS: Split bulky SysFSPCI file into separate files 2022-06-17 11:01:27 +02:00
Liav A e488245234 Kernel/SysFS: Split bulky SysFSUSB file into two separate class files 2022-06-17 11:01:27 +02:00
Liav A 290eb53cb5 Kernel/SysFS: Stop cluttering the codebase with pieces of SysFS parts
Instead, start to put everything in one place to resemble the directory
structure of the SysFS when actually using it.
2022-06-17 11:01:27 +02:00
SeekingBlues 8730e56e88 LibC: Add WIFCONTINUED macro
Like other systems, we can encode the continued state with 0xffff in the
status value. This is needed for some ports.
2022-06-17 10:59:26 +02:00
kleines Filmröllchen 1b25513ed7 Kernel: Don't VERIFY that the DMA channel is running on AC'97 interrupt
Fixes #13771; as discussed it's not really a problem to receive an
interrupt while the DMA channel is not running, but we do want to log
it.
2022-06-15 20:53:10 +03:00
Andreas Kling 4e4a930b13 Kernel: Use the system boot time as default timestamp in /sys and /dev 2022-06-15 17:15:04 +02:00
Andreas Kling adaaea4c9a Kernel: Make TimeManagement::boot_time() static 2022-06-15 17:15:04 +02:00
Andreas Kling 9e994da2ac Kernel+AK: Split Weakable.h into userspace and kernel variants
Only the kernel expects AK::Weakable to lock its refcount manipulation,
so let's not force userspace to pay for that as well.
2022-06-15 17:15:04 +02:00
Timur Sultanov 0a63461341 Kernel: Add s6_addr32 field in in6_addr struct 2022-06-12 00:28:26 +01:00
MacDue 1dcdcc7efb Kernel/Console: Fix gaps between background glyph color 2022-06-11 12:19:29 +01:00
Liav A 20c9e4c05c Kernel/Graphics: Ensure VMWare and VirtualBox EDIDs have manufacturer ID 2022-06-10 22:32:54 +01:00
Liav A 3d36b194d1 Kernel/Graphics: Ensure generic EDID always has correct checksum 2022-06-10 22:32:54 +01:00
Liav A 938d579d16 Kernel/Graphics: Re-organize the DisplayConnector class a bit
Move methods that are overriding the virtual methods in the File class,
to a private access scope in the DisplayConnector class because nobody
tries to access them in any derived class of this class.
2022-06-10 22:32:54 +01:00
MacDue 348750a9f4 Kernel/Console: Tidy up code a little
- Remove some magic numbers
- Remove some duplicate branches
- Reduce the amount of casting between u8* and u32*
- Some renaming of confusing variables
2022-06-09 22:06:46 +02:00
MacDue 805a3d5b29 Kernel/Console: Factor out framebuffer offset and support glyph_spacing
This allows the 9px width of Cathode to be preserved without increasing
the bitmap size.
2022-06-09 22:06:46 +02:00
MacDue adef79b793 Kernel/Console: Replace QEMU bitmap font with Cathode
This has very similar look, but was invented here :^)
2022-06-09 22:06:46 +02:00
Liav A b4e409f721 Kernel/Graphics: Drop support for the DisplayConnector write interface
The WindowServer doesn't use this interface anymore and therefore it's
not used by any userspace application, so let's remove this stale method
to ensure we don't have to bother with it anymore.
2022-06-06 20:11:05 +01:00
Liav A e2ed6ef741 Kernel/Graphics: Bring back the mmap interface for DisplayConnectors
The mmap interface was removed when we introduced the DisplayConnector
class, as it was quite unsafe to use and didn't handle switching between
graphical and text modes safely. By using the SharedFramebufferVMObject,
we are able to elegantly coordinate the switch by remapping the attached
mmap'ed-Memory::Region(s) with different mappings, therefore, keeping
WindowServer to think that the mappings it has are still valid, while
they are going to a different physical range until we are back to the
graphical mode (after a switch from text mode).

Most drivers take advantage of the fact that we know where is the actual
framebuffer in physical memory space, the SharedFramebufferVMObject is
created with that information. However, the VirtIO driver is different
in that aspect, because it relies on DMA transactions to show graphics
on the framebuffer, so the SharedFramebufferVMObject is created with
that mindset to support the arbitrary framebuffer location in physical
memory space.
2022-06-06 20:11:05 +01:00
Liav A 3d22917548 Kernel/Memory: Introduce the SharedFramebufferVMObject class
This new type of VMObject will be used to coordinate switching safely
from graphical mode to text mode and vice-versa, by supplying a way to
remap all Regions that were created with this object, so mappings can be
changed according to the given state of system mode. This makes it quite
easy to give applications like WindowServer the feeling of having full
access to the framebuffer device from a DisplayConnector, but still keep
the Kernel in control to be able to safely switch to text console.
2022-06-06 20:11:05 +01:00
Liav A ec925cbb89 Kernel: Set console active before try to enable graphical mode
We should first enable the VirtualConsole and then enable graphical
mode, to ensure proper display output on the switched-to virtual console
that has been chosen. When de-activating graphical mode, we do the
de-activating first then enable the VirtualConsole to ensure proper text
output on screen.
2022-06-06 20:11:05 +01:00
Liav A d84d81fc4e Kernel/Graphics: Flush the entire buffer if using VirtIO console
Keeping the exact details of a dirty rectangle doesn't make any sense
when we just flush the entire screen, so just keep a simple boolean
value to know if the screen needs to be flushed or not.
2022-06-06 20:11:05 +01:00
Idan Horowitz ea1e5b630d Kernel: Verify system memory info consistency 2022-06-06 01:36:18 +03:00
Idan Horowitz b4e45a6636 Kernel: Tighten assertion in MM::find_free_user_physical_page
If our book-keeping of user physical pages is correct, we should always
find a physical page, regardless if it was committed or uncommitted.
2022-06-06 01:36:18 +03:00
Idan Horowitz 427f1f7e31 Kernel: Only use uncommitted pages when allocating contiguous user pages 2022-06-06 01:36:18 +03:00
Brian Gianforcaro 6b85b358f8 Kernel: Unify Kernel task names for consistency
This change unifies the naming convention for kernel tasks.

The goal of this change is to:

- Make the task names more descriptive, so users can more
  easily understand their purpose in System Monitor.

- Unify the naming convention so they are consistent.
2022-06-05 14:09:44 +01:00
Timon Kruiper 1072d523e2 Kernel: Initialize and use interrupts in the aarch64 Kernel
Now that everything is in place, we can actually use interrupts in the
aarch64 Kernel build. :^)
2022-06-02 13:14:12 +01:00
Timon Kruiper dab6dbe893 Kernel: Add interrupt support to aarch64 RPi Timer driver
Since we can now build and use the IRQHandler class, we can implement
interrupt support for the Timer in the aarch64 build.
2022-06-02 13:14:12 +01:00
Timon Kruiper 8b77c61e7d Kernel: Use AK::NeverDestroyed<Timer> to store the timer class
For an upcoming change to support interrupts in this driver, this class
has to inherit from IRQHandler. That in turn will make this class
virtual, which will then actually call the destructor of the class. We
don't want this to happen, thus we have to wrap the class in a
AK::NeverDestroyed.
2022-06-02 13:14:12 +01:00
Timon Kruiper a0b0c4e723 Kernel: Make RPi Timer::set_clock_rate static
This allows it to be called in UART without calling the Timer
constructor. This in turn allows the UART to be used before interrupts
are enabled.
2022-06-02 13:14:12 +01:00
Timon Kruiper 3cf8d3361e Kernel: Add support for handling interrupts on aarch64
There is currently some code duplication between the aarch64
implementation and the x86 one, but this initial implementation works
for now. :^)
2022-06-02 13:14:12 +01:00
Timon Kruiper c959344c00 Kernel: Add simple implementation for InterruptManagement on aarch64
This class currently hardcodes the use of the Raspberry Pi interrupt
controller.
2022-06-02 13:14:12 +01:00
Timon Kruiper 5eac2b9f33 Kernel: Add driver for interrupt controller on the Raspberry Pi
This implements the simpler IRQController class and adds a
pending_interrupts() function to the class.
2022-06-02 13:14:12 +01:00
Timon Kruiper f085903f62 Kernel: Move IRQController and InterruptManagement to Arch directory
These 2 classes currently contain much code that is x86(_64) specific.
Move them to the architecture specific directory. This also allows for a
simpler implementation for aarch64.
2022-06-02 13:14:12 +01:00
Timon Kruiper 63ee2781fb Kernel: Put Raspberry Pi devices into RPi namespace
This makes it clear in the code that these drivers are specific for the
Raspberry Pi devices.
2022-06-02 13:14:12 +01:00
Timon Kruiper 77f24056e0 Kernel: Disable interrupts when halting the aarch64 processor
This will actually halt the processor.
2022-06-02 13:14:12 +01:00
Timon Kruiper 846d9ae858 Kernel: Do not specify new alignment for aarch64
Using the alignment of 4 causes a panic in the aarch64 Kernel. Instead
just don't pass the flag, which will use the default alignment.
2022-06-02 13:14:12 +01:00
Timon Kruiper cbe1717181 Kernel: Rename idt_init() to initialize_interrupts()
Also move the function out of the x86/Interrupts.h file into the generic
Interrupts.h file and add a stub for aarch64.
2022-06-02 13:14:12 +01:00
Timon Kruiper 02b94c6f0e Kernel: Add UnhandledInterruptHandler and SharedIRQHandler to aarch64 2022-06-02 13:14:12 +01:00
Timon Kruiper d631a3daf6 Kernel: Add Interrupts/IRQHandler.cpp to the aarch64 build
This requires a few stubs such that the compiler won't complain.
2022-06-02 13:14:12 +01:00
Timon Kruiper a4534678f9 Kernel: Implement InterruptDisabler using generic Processor functions
Now that the code does not use architectural specific code, it is moved
to the generic Arch directory and the paths are modified accordingly.
2022-06-02 13:14:12 +01:00
Timon Kruiper ea9cf8b6ab Kernel: Separate NonMaskableInterruptDisabler into its own file
This is for the upcoming change to make InterruptDisabler class work for
the aarch64 build.
2022-06-02 13:14:12 +01:00
Timon Kruiper 9413fe9fe5 Kernel: Add interrupt related functions to Processor class
This adds {enable, disable}_interrupts() and are_interrupts_enabled()
to the Processor class, and also implements them for x86(_64) and
aarch64.
2022-06-02 13:14:12 +01:00
Timon Kruiper 80be5f8044 Kernel: Add DAIF system register to aarch64 registers
This register can be used to check whether the 4 different types of
interrupts are masked. A different variant can be used to set/clear
specific interrupt bits.
2022-06-02 13:14:12 +01:00
Timon Kruiper 2fd5e9f729 Kernel: Add GenericInterruptHandler.cpp to aarch64 build
This requires us to add an Interrupts.h file in the Kernel/Arch
directory, which includes the architecture specific files.

The commit also stubs out the functions to be able to compile the
aarch64 Kernel.
2022-06-02 13:14:12 +01:00