Commit Graph

8197 Commits

Author SHA1 Message Date
Andreas Kling
1c865ee8d4 Kernel: Merge ACPI::StaticParser into ACPI::Parser
There's no need for StaticParser to be a separate thing from Parser.
2020-04-09 18:15:02 +02:00
Andreas Kling
a3ca745b5a Kernel: Use StringView for ACPI table signatures 2020-04-09 18:03:57 +02:00
Andreas Kling
f614f0e2cb Kernel: Add typed_map<T>(PhysicalAddress) and use it in ACPI parsing
There was a frequently occurring pattern of "map this physical address
into kernel VM, then read from it, then unmap it again".

This new typed_map() encapsulates that logic by giving you back a
typed pointer to the kind of structure you're interested in accessing.

It returns a TypedMapping<T> that can be used mostly like a pointer.
When destroyed, the TypedMapping object will unmap the memory. :^)
2020-04-09 17:19:11 +02:00
Andreas Kling
4644217094 Kernel: Remove "non-operational" ACPI parser state
If we don't support ACPI, just don't instantiate an ACPI parser.
This is way less confusing than having a special parser class whose
only purpose is to do nothing.

We now search for the RSDP in ACPI::initialize() instead of letting
the parser constructor do it. This allows us to defer the decision
to create a parser until we're sure we can make a useful one.
2020-04-09 17:19:11 +02:00
Brendan Coles
d95362d8cd IRCClient: Set nick and userinfo to OS username when not set in config 2020-04-09 17:18:56 +02:00
Linus Groh
c06a6c67d5 LibJS: Add globalThis
We already have "global" as a way to access the global object in js(1)
(both REPL and script mode). This replaces it with "globalThis", which
is available in all environments, not just js.
2020-04-09 15:58:49 +02:00
Andreas Kling
cbecb23e1d LibJS: Fix BooleanPrototype build 2020-04-09 14:29:57 +02:00
Andreas Kling
e983c745f7 Kernel: Simplify ACPI initialization a bit
Construct the parser, no matter which kind, in ACPI::initialize().
2020-04-09 14:10:44 +02:00
Andreas Kling
85c0557839 Kernel: Simplify PCI::initialize() a bit more 2020-04-09 13:42:17 +02:00
Andreas Kling
95e44a33c1 Kernel: Move ACPI initialization from init.cpp to ACPI::initialize() 2020-04-09 13:39:10 +02:00
Andreas Kling
f25d2f5518 Kernel: Move NetworkTask startup into NetworkTask::spawn() 2020-04-09 13:31:05 +02:00
Linus Groh
520c4254c9 LibJS: Make BooleanPrototype inherit from Object
BooleanPrototype should inherit from Object, not BooleanObject.
2020-04-09 13:21:24 +02:00
Ed Rochenski
551cafe4d3 Documentation: added additional info about moving to wsl2 2020-04-09 11:35:43 +02:00
Ed Rochenski
932de565b1 Documentation: added note to prevent script failure in build section 2020-04-09 11:35:43 +02:00
Andreas Kling
a06548eaf7 LibGUI: Keep still-valid indexes in selection after a model update
This is a stop-gap patch solution for the annoying problem of models
being bad at updating. At least the process table will retain your
selection in SystemMonitor now.
2020-04-09 09:53:28 +02:00
rhin123
bdb6b2ced3 Calendar: Corrected spacing on small resizing 2020-04-09 08:38:35 +02:00
Andreas Kling
4036f15728 LibWeb: Support relative URL's in XMLHttpRequest
In order to complete a relative URL, we need a Document. Fix this by
giving XMLHttpRequest a pointer to its window object. Then we can go
from the window to the document, and then we're home free. :^)
2020-04-08 21:46:43 +02:00
Andreas Kling
4ffac713b9 LibWeb: Add XMLHttpRequest object :^)
This patch adds very basic XMLHttpRequest support to LibWeb. Here's an
example that currently works:

    var callback = function() { alert(this.responseText); }
    var xhr = new XMLHttpRequest();
    xhr.addEventListener("load", callback);
    xhr.open("GET", "http://serenityos.org/~kling/test/example.txt");
    xhr.send();

There are many limitations and bugs, but it's pretty dang awesome that
we have XHR. :^)
2020-04-08 21:46:43 +02:00
Andreas Kling
b3c62d0bc8 LibWeb: Expose the global object as "window" 2020-04-08 21:46:43 +02:00
Linus Groh
531335f57c LibJS: Handle empty values in Array.prototype.toString() 2020-04-08 20:01:42 +02:00
Brendan Coles
5c90cfa90f IRCClient: Add application and context menu items to hop/dehop users 2020-04-08 19:53:40 +02:00
Linus Groh
755b206618 LibJS: Handle empty values in Value::to_string() 2020-04-08 18:51:34 +02:00
Brendan Coles
e4ba949a15 IRCClient: Open query on double click of nick in channel member list 2020-04-08 18:42:01 +02:00
Brendan Coles
036fb4c621 IRCClient: Add nick_without_prefix and nick_at helpers
`IRCChannelMemberListModel->nick_at` returns the nick name of a channel
member at the specified index.

`IRCClient->nick_without_prefix` returns a formatted nick name without
privilege prefix.
2020-04-08 18:42:01 +02:00
Andreas Kling
66f7c8e0e8 Kernel: Simplify PCI::initialize()
Choosing between I/O and MMIO is not as difficult as we were making it.
2020-04-08 18:07:35 +02:00
Andreas Kling
e171c25a67 Kernel: Fix typos in PCI access boot message 2020-04-08 17:41:46 +02:00
Andreas Kling
f2ebfb9e4e Kernel: Simplify PCI initialization logic
- Get rid of the PCI::Initializer object which was not serving any real
  purpose or holding any data members.
- Move command line parsing from init to PCI::initialize().
2020-04-08 17:39:17 +02:00
Andreas Kling
a6a8f36a83 Kernel: Use nested Kernel::PCI namespaces more to reduce PCI:: spam 2020-04-08 17:29:37 +02:00
Andreas Kling
e5ec332eb1 Kernel: Make most of the PCI::MMIOAccess members private
This class is really meant to be used via a base class pointer.
2020-04-08 17:26:39 +02:00
Andreas Kling
c8b309a3b5 Kernel: Simplify PCI::MMIOAccess segment storage
Instead of nesting a bunch of heap allocations, just store them in
a simple HashMap<u16, MMIOSegment>.

Also fix a bunch of double hash lookups like this:

    ASSERT(map.contains(key));
    auto thing = map.get(key).value();

They now look like this instead:

    auto thing = map.get(key);
    ASSERT(thing.has_value());
2020-04-08 17:23:20 +02:00
Andreas Kling
0de368e36c LibWeb: Remove bizarre HashMap leak in StyleProperties copy ctor 2020-04-08 17:19:46 +02:00
Andreas Kling
7d28d9b2af Kernel: Move PCI::MMIOSegment declaration into MMIOAccess.cpp
This is only used inside PCI::MMIOAccess, no need to expose it.
2020-04-08 17:19:46 +02:00
Andreas Kling
44e889785a Kernel: Fix up various PCI-related function signatures
- Make things const when they don't need to be non-const.
- Don't return AK::String when it's always a string literal anyway.
- Remove excessive get_ prefixes per coding style.
2020-04-08 17:19:46 +02:00
Andreas Kling
15cffc4089 Kernel: Add some human-readable I/O helpers in PCI/Access.cpp 2020-04-08 17:19:46 +02:00
Andreas Kling
e1709a0904 Kernel: Remove an unnecessary layer of indirection in the PCI code
The PCI access layer was composed of a bunch of virtual functions that
did nothing but call other virtual functions. The first layer was never
overridden so there was no need for them to be virtual.

This patch removes the indirection and moves logic from PCI::Access
down into the various PCI::get_foo() helpers that were the sole users.
2020-04-08 17:19:46 +02:00
Andreas Kling
e5a20697da Kernel: Fix awkward RTC log message at boot 2020-04-08 17:19:46 +02:00
Andreas Kling
5cc09b0245 Kernel: Simplify VMWareBackdoor somewhat
- If there is no VMWare backdoor, don't allocate memory for it.
- Remove the "unsupported" state, instead just don't instantiate.
- Move the command-line parsing from init to the driver.
- Move mouse packet reception from PS2MouseDevice to VMWareBackdoor.
2020-04-08 17:19:46 +02:00
Andreas Kling
bb2be4bb99 Kernel: Make VMWareBackdoor eternal (since it's never freed) 2020-04-08 17:19:46 +02:00
Andreas Kling
e4ab908fe0 Kernel: Move global constructor invocation a bit earlier 2020-04-08 17:19:46 +02:00
Andreas Kling
a066dd1fac Kernel: Move sync and finalization tasks into their own files
Instead of clogging up the initialization sequence, put these tasks
in their own files.
2020-04-08 17:19:46 +02:00
Andreas Kling
befe4c6709 Kernel: Remove DebugLogDevice
This was a cute idea but ultimately it's just not useful since we
already have the dbgputch() and dbgputstr() syscalls.
2020-04-08 17:19:46 +02:00
Andreas Kling
c8087a42fc Kernel: Move more things from init() to init_stage2()
The purpose of init() is to get multi-tasking up and running. We don't
want to do anything in init() that doesn't advance that goal.

This patch moves some things from init() to init_stage2(), and adds a
comment block explaining the split.
2020-04-08 17:19:46 +02:00
Andreas Kling
a7bbfda034 Kernel: Rename KParams => Kernel::CommandLine
Let's make this read more like English.
2020-04-08 17:19:46 +02:00
Andreas Kling
dc7340332d Kernel: Update cryptically-named functions related to symbolication 2020-04-08 17:19:46 +02:00
Andreas Kling
348e209eb5 LibWeb: Make CanvasRenderingContext2D use floats instead of ints
This matches what we already do for the layout tree and things are
expected to work this way regardless.
2020-04-08 17:19:46 +02:00
Andreas Kling
2ffa054574 LibJS: Add Value::to_double() for convenience 2020-04-08 17:19:46 +02:00
Paul Redmond
a9779e12ea
AK: Appending 0 bytes to a ByteBuffer should be a no-op (#1699)
- inserting an empty string into LibLine Editor triggered an assertion
  trying to grow a ByteBuffer by 0 bytes.
2020-04-08 17:04:37 +02:00
Emanuele Torre
38dfd04633 LibJS: rename JS::DeclarationType => JS::DeclarationKind
Many other parsers call it with this name.

Also Type can be confusing in this context since the DeclarationType is
not the type (number, string, etc.) of the variables that are being
declared by the VariableDeclaration.
2020-04-08 14:50:14 +02:00
Brendan Coles
44f8161166 IRCClient: Remove FIXME for RPL_TOPICWHOTIME
RPL_TOPICWHOTIME is handled by handle_rpl_topicwhotime.
2020-04-08 14:06:03 +02:00
Brendan Coles
9126859679 IRCClient: Rename /hop command to /cycle
Some IRC clients use /hop to part and re-join a channel; however this
can be confused with granting half-op (+h) channel privileges to a user.

The general convention used by other IRC clients is /cycle.
2020-04-08 11:42:05 +02:00