Commit Graph

18240 Commits

Author SHA1 Message Date
Liav A
8abbb7e090 Kernel/PCI: Introduce a new ECAM access mechanism
Now the kernel supports 2 ECAM access methods.
MMIOAccess was renamed to WindowedMMIOAccess and is what we had until
now - each device that is detected on boot is assigned to a
memory-mapped window, so IO operations on multiple devices can occur
simultaneously due to creating multiple virtual mappings, hence the name
is a memory-mapped window.

This commit adds a new class called MMIOAccess (not to be confused with
the old MMIOAccess class). This class creates one memory-mapped window.
On each IO operation on a configuration space of a device, it maps the
requested PCI bus region to that window. Therefore it holds a SpinLock
during the operation to ensure that no other PCI bus region was mapped
during the call.

A user can choose to either use PCI ECAM with memory-mapped window
for each device, or for an entire bus. By default, the kernel prefers to
map the entire PCI bus region.
2021-04-03 19:34:52 +02:00
Liav A
441e374396 Kernel: Enable PCI ECAM method again if available
Apparently we don't enable PCI ECAM (MMIO access to the PCI
configuration space) even if we can. This is a regression, as it was
enabled in the past and in unknown time it was regressed.

The CommandLine::is_mmio_enabled method was renamed to
CommandLine::is_pci_ecam_enabled to better represent the meaning
of this method and what it determines.

Also, an UNMAP_AFTER_INIT macro was removed from a method
in the MMIOAccess class as it halted the system when the kernel
tried to access devices after the boot process.
2021-04-03 19:34:52 +02:00
Manuel Palenzuela
d09cd85b6c Ports: Added a cmatrix port 2021-04-03 18:55:02 +02:00
Andreas Kling
5c67b2cb8f LibWeb: Defer creation of subframes until host element is connected
This allows parsing of document fragments with "<iframe>" to construct
the iframe element without requiring that the fragment have a frame.
2021-04-03 16:54:33 +02:00
Linus Groh
57ead17d54 LibWeb: Implement XMLHttpRequest.getResponseHeader()
This lets jQuery's AJAX functionality progress further :^)
2021-04-03 16:34:34 +02:00
Linus Groh
288b90a297 LibWeb: Implement XMLHttpRequest.status
This lets jQuery's AJAX functionality progress further :^)
2021-04-03 16:34:34 +02:00
Linus Groh
e02270c5cc LibWeb: Make XMLHttpRequest.open() work with relative URLs 2021-04-03 16:34:34 +02:00
Linus Groh
000ef96613 LibWeb: Pass optional status code to ResourceLoader callbacks
This is needed for XMLHttpRequest, and will certainly be useful for
other things, too.
2021-04-03 16:34:34 +02:00
Linus Groh
975b209b9b LibWeb: Set Constructor.name and Prototype.constructor of generated interfaces
Object introspection in the Browser's JS console is still not great, but
this makes it a lot easier to find out the exact type of an object by
checking its 'constructor' property.
It also fixes all the things that rely on these properties being set, of
course :^)
2021-04-03 16:34:34 +02:00
Linus Groh
55d9f1cced LibJS: Log any exception, not just the ones with a JS::Error value
This was super confusing as we would check if the exception's value is a
JS::Error and not log it otherwise, even with m_should_log_exceptions
set.

As a result, things like DOM exceptions were invisible to us with
execution just silently stopping, for example.
2021-04-03 16:34:34 +02:00
Linus Groh
f1fde01025 LibJS: Fix returning from try statement
Not sure if this regressed at some point or just never worked, it
definitely wasn't tested at all. We would always return undefined when
returning from a try statement block, handler, or finalizer.
2021-04-03 16:34:34 +02:00
Linus Groh
e46fa3ac8b LibJS: Keep RegExp.exec() results in correct order
By using regex::AllFlags::SkipTrimEmptyMatches we get a null string for
unmatched capture groups, which we then turn into an undefined entry in
the result array instead of putting all matches first and appending
undefined for the remaining number of capture groups - e.g. for

    /foo(ba((r)|(z)))/.exec("foobaz")

we now return

    ["foobaz", "baz", "z", undefined, "z"]

and not [

    ["foobaz", "baz", "z", "z", undefined]

Fixes part of #6042.

Also happens to fix selecting an element by ID using jQuery's $("#foo").
2021-04-03 16:34:34 +02:00
Jamie Mansfield
01187e58f2 LibJS: ArrayBuffer.prototype.slice
Implements the aforementioned native Javascript function, following the
specification's [1] implementation.

[1] https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
2021-04-03 16:24:44 +02:00
Timothy Flynn
b50de19cd3 LibWeb: Add support for HTML input type=radio 2021-04-03 15:39:46 +02:00
Timothy Flynn
274e94224d Base: Add test page for HTML input type=radio elements 2021-04-03 15:39:46 +02:00
Andreas Kling
136d774885 LibWeb: CSSImportRule::set_style_sheet() should take a CSSStyleSheet
Spotted by @tomuta in #6086.
2021-04-03 11:57:32 +02:00
Andreas Kling
dcfc357860 LibWeb: Add a FrameHostElement for frame/iframe common functionality
A FrameHostElement is an HTML element (<frame> or <iframe>) that may
have a content frame that participates in the frame tree.

This basically just moves code from <iframe> to a separate base class
so we can share it with <frame> once we implement <frame>.
2021-04-03 11:57:32 +02:00
Liav A
8e3e3a71cb Kernel: Introduce a new HID subsystem
The end goal of this commit is to allow to boot on bare metal with no
PS/2 device connected to the system. It turned out that the original
code relied on the existence of the PS/2 keyboard, so VirtualConsole
called it even though ACPI indicated the there's no i8042 controller on
my real machine because I didn't plug any PS/2 device.
The code is much more flexible, so adding HID support for other type of
hardware (e.g. USB HID) could be much simpler.

Briefly describing the change, we have a new singleton called
HIDManagement, which is responsible to initialize the i8042 controller
if exists, and to enumerate its devices. I also abstracted a bit
things, so now every Human interface device is represented with the
HIDDevice class. Then, there are 2 types of it - the MouseDevice and
KeyboardDevice classes; both are responsible to handle the interface in
the DevFS.

PS2KeyboardDevice, PS2MouseDevice and VMWareMouseDevice classes are
responsible for handling the hardware-specific interface they are
assigned to. Therefore, they are inheriting from the IRQHandler class.
2021-04-03 11:57:23 +02:00
Liav A
32dd9c554b LibKeyboard: Mark CharacterMap::get_char as const
Also, mark character_map_name method as const and make it to return
const String& instead of const String.
2021-04-03 11:57:23 +02:00
Liav A
8a12d02b9a Documentation: Add supported and tested motherboards to the list
I tested both motherboards and they seem to boot Serenity correctly :)
2021-04-03 11:57:23 +02:00
Liav A
48111f17fc Documentation: Clarify that AHCI is supported but may suffer from bugs
We do support AHCI now, but the implementation could be incomplete for
some chipsets.
Also, we should write the acronym "Non-volatile Memory Express" as
NVMe. not NVME.
2021-04-03 11:57:23 +02:00
Liav A
27bf91ab87 Revert "Kernel/PCI: Allow to set the PCI IRQ line of a device"
This reverts commit 36a82188a8.

This register is write-only for the firmware (BIOS), and read-only for
us so we shouldn't set the PCI IRQ line never.
The firmware figured out the IRQ routing to the PIC for us, so changing
it won't affect anything. I was mistaken when I thought that changing
the value of this register will allow us to change its interrupt line,
like when changing a PCI BAR to relocate device resources as desired
with the requirements of the OS.
2021-04-03 11:57:23 +02:00
Liav A
2718d7c74c Kernel/Storage: Add support for IDE controllers in PCI native mode
Also handle native and compatibility channel modes together, so if only
one IDE channel was set to work on PCI native mode, we need to handle it
separately, so the other channel continue to operate with the legacy IO
ports and interrupt line.
2021-04-03 11:57:23 +02:00
Brendan Coles
627cfe017c Kernel: NetworkTask: Remove 10.0.2.x as default IP for NIC interfaces 2021-04-03 11:25:18 +02:00
Timothy Flynn
fa9ba8bce5 LibWeb: Support rendering background images with 'background-repeat'
Update the painting of background images for both <body> nodes and other
non-initial nodes. Currently, only the following values are supported:
    repeat, repeat-x, repeat-y, no-repeat

This also doesn't support the two-value syntax which allows for setting
horizontal and vertical repetition separately.
2021-04-03 11:24:33 +02:00
Timothy Flynn
bd5a91269f LibWeb: Store computed CSS value of background-repeat 2021-04-03 11:24:33 +02:00
Timothy Flynn
fcfeadaffa Base: Add test page for the 'background-repeat' property
This page tests the following values for background-repeat:
    repeat, repeat-x, repeat-y, no-repeat

The test is duplicated for the <body> node and for child <div> nodes,
because the code that paints these nodes are in separate locations.
2021-04-03 11:24:33 +02:00
AnotherTest
2601441486 LibCrypto: Avoid overly big allocs in intermediate ModularPower results
If we don't limit the sizes of the intermediate results, they will grow
indefinitely, causing each iteration to take longer and longer (in both
memcpy time, and algorithm runtime).
While calculating the trimmed length is fairly expensive, it's a small
cost to pay for uniform iteration times.
2021-04-03 11:22:01 +02:00
AnotherTest
2020176f0f LibTLS: Make the TLS connection options user-configurable
The user may now request specific cipher suites, the use of SNI, and
whether we should validate certificates (not that we're doing a good job
of that).
2021-04-03 11:22:01 +02:00
AnotherTest
b5f24c84e4 LibTLS: Remove long-outdated comment that no longer makes sense 2021-04-03 11:22:01 +02:00
AnotherTest
d6d6750dd8 LibTLS: Move TLS extensions to a separate 'extensions' struct
This has no behavioural effect.
2021-04-03 11:22:01 +02:00
Andreas Kling
22d13d8b1a Taskbar: Tweak taskbar widget margins
Basically, nudge everything down 1 pixel.
2021-04-02 23:33:17 +02:00
Andreas Kling
6ba00ae5b9 LibGUI: Subtract layout margin when placing items along secondary axis
While space distribution along the primary axis of a BoxLayout is
pretty sophisticated, the secondary axis is very simple: we simply
center the widget.

However, this doesn't always look very nice if we don't take margins
into account, so make sure we subtract them from the rect we do all
the centering within.
2021-04-02 23:33:17 +02:00
thislooksfun
05d7869dc0 Documentation: Split brew install commands into core and fuse+ext2
If you don't need/want to use Fuse+ex2 then half of the existing
install command is unnecessary, and it's hard to pick out which you
do and don't need to, for example, build Lagom. This makes it clear
which commands you can skip if you don't need ex2 support.
2021-04-02 23:08:05 +02:00
thislooksfun
408398e276 Documentation: Add cmake to brew installs
MacOS does not ship with CMake, so we have to install it before it
can be used!
2021-04-02 23:08:05 +02:00
thislooksfun
20ca1acdbf Documentation: Update macOS build path in BuildInstructions.md
This is a follow-up to d0427b610c.
2021-04-02 23:08:05 +02:00
Brendan Coles
666aeecaa2 Meta: Resolve some pylint violations in Python lint scripts
Resolves:

* all: consider-using-sys-exit
* all: wrong-import-order
* all: TODO: Require that a few keys are set? (fixme)
* some: missing-function-docstring
* some: line-too-long
2021-04-02 23:07:58 +02:00
Linus Groh
e875513ff7 LibJS: Use empty value for Reference unresolvable state, not undefined
This fixes an issue where `undefined.foo = "bar"` would throw a
ReferenceError instead of a TypeError as undefined was also used for
truly unresolvable references (e.g. `foo() = "bar"`). I also made the
various error messages here a bit nicer, just "primitive value" is not
very helpful.
2021-04-02 22:24:30 +02:00
Linus Groh
d6cffb82a2 LibJS: Move 'typeof' string functionality from AST to Value
We should be able to get the 'typeof' string for any value directly, so
this is now a standalone Value::typeof() method instead of being part of
UnaryExpression::execute().
2021-04-02 22:24:30 +02:00
thankyouverycool
dc6db819f9 LibGUI: Always outline selected date and paint today's date bold
Fixes selected dates and today's date not painting correctly when
viewed from adjacent months
2021-04-02 22:23:21 +02:00
thankyouverycool
14e074cd24 LibGUI+Calendar: Inherit from Frame class
Fixes incorrect painting with variable thickness and cuts down
on some layout boilerplate.
2021-04-02 22:23:21 +02:00
Timothy Flynn
7d8d45e757 LibWeb: Add a line box fragment for <br> nodes
This is required for the block formatting context to know the height of
the <br> element while computing the height of its parent. Specifically,
this comes into play when the <br> element is the first or last child of
its parent. In that case, it previously would not have any fragments, so
BlockFormattingContext::compute_auto_height_for_block_level_element
would infer its top and bottom positions to be 0.
2021-04-02 20:36:02 +02:00
Daniël van de Burgt
a106f852d3
WindowServer+MouseSettings: Add ability to configure double-click speed (#5876)
This adds a double-click speed slider control to the Mouse Settings
panel, and value labels for both the movement speed and double-click
speed sliders.

To allow for updating and persisting the configured double-click
speed through the WindowServer, two IPC calls - `SetDoubleClickSpeed`
and `GetDoubleClickSpeed` - have been added.
2021-04-02 16:08:18 +02:00
thislooksfun
e55b8712d4 AK: Inline HashTable writing bucket lookup
The old approach was more complex and also had a very bad edge case
with lots of collisions. This approach eliminates that possiblility.
It also makes both reading and writing lookups a little bit faster.
2021-04-02 12:54:54 +02:00
thislooksfun
509eb10df4 AK: Inline the bucket index calculation
The result of the modulo is only used in the array index, so why
make the code more complex by calculating it in two different places?
2021-04-02 12:54:54 +02:00
thislooksfun
8fb7739cfb AK: Add tests for HashTable 2021-04-02 12:54:54 +02:00
Andreas Kling
21bc5fdec3 LibWeb: Don't interpreter invalid CSS pseudo-classes as '*' selector
Bogus pseudo-classes like ":bogus" would actually match every element.
2021-04-02 11:48:00 +02:00
Andreas Kling
3e3d196f06 WindowServer: Un-nest MenuManager::handle_mouse_event() a bit 2021-04-02 10:54:50 +02:00
Timothy Flynn
77a601d52e LibJS: Implement most of String.prototype.replace 2021-04-02 10:48:40 +02:00
Linus Groh
96121ddb11 js: Hook up promise rejection tracking callbacks
We now leverage the VM's promise rejection tracker callbacks and print a
warning in either of these cases:

- A promise was rejected without any handlers
- A handler was added to an already rejected promise
2021-04-02 10:47:40 +02:00