Commit graph

2670 commits

Author SHA1 Message Date
Brian Gianforcaro 7cc7d303e3 Kernel: Add $SERENITY_KERNEL_CUSTOM_{CXXFLAGS/LDFLAGS} for build customization
I normally want to build with debug symbols for the kernel so I can use
a debugger. Add a hook to allow me to do so, but to impact no-one else.
2020-04-11 10:03:19 +02:00
Linus Groh b46a8d7335 MenuApplets: Rename CPUGraph to ResourceGraph
The plan is to extend what currently is known as "CPUGraph" and let the
SystemServer spawn multiple instances of it - which then can show memory
or network usages as well :^)

Simply renaming the applet is the first step.
2020-04-11 10:03:12 +02:00
Liav A ea58563970 Kernel: Instantiate network adapters in their own detect() methods
This commit is one step forward for pluggable driver modules.
Instead of creating instances of network adapter classes, we let
their detect() methods to figure out if there are existing devices
to initialize.
2020-04-11 10:02:31 +02:00
Liav A 65f939b55c Kernel: Keep records of PCI::Address & PCI::ID pairs for enumeration 2020-04-11 10:02:31 +02:00
Liav A 688dd9ea66 Kernel: Simplify a message in PATAChannel::create() 2020-04-11 10:02:31 +02:00
Liav A e9df6189f4 Kernel: Assert if we try to initialize VMWareBackdoor more than once 2020-04-11 10:02:31 +02:00
Andreas Kling dec352dacd Kernel: Ignore zero-length PROGBITS sections in sys$module_load() 2020-04-10 16:36:01 +02:00
Andreas Kling c06d5ef114 Kernel+LibC: Remove ESUCCESS
There's no official ESUCCESS==0 errno code, and it keeps breaking the
Lagom build when we use it, so let's just say 0 instead.
2020-04-10 13:09:35 +02:00
Conrad Pankoff a3edeb5868 Kernel: Add explicit offset parameter to File::read etc 2020-04-10 11:59:30 +02:00
Liav A 1570e67881 Kernel: Allow again to boot with partitioned disk
This change ensures that we don't return a zero value blindly
from DiskPartition write/read methods.

Fixes #1719.
2020-04-09 23:43:30 +02:00
Liav A 9bb4a6ecf6 Kernel: Create BXVGA device if found in the PCI bus 2020-04-09 23:43:30 +02:00
Liav A 4d44a3bdfe Kernel: Reorder bitwise operations when creating PCI interrupt overrides 2020-04-09 20:45:44 +02:00
Liav A e4ad1b92fb MultiProcessor: Silence debug message spam 2020-04-09 20:45:44 +02:00
Liav A 0fa50b6405 Interrupts: Simplify initialization a bit more 2020-04-09 20:45:44 +02:00
Liav A 6b38befd91 Interrupts: Remove irrelevant FIXME comment 2020-04-09 20:45:44 +02:00
Liav A fec8763c21 Interrupts: Make the MultiProcessorParser functional again 2020-04-09 19:59:53 +02:00
Liav A a7c5a1fe69 Kernel: Simplify the Time management initialization 2020-04-09 19:59:53 +02:00
Liav A 8e336798b5 Kernel: Run clang-format on init.cpp 2020-04-09 19:59:53 +02:00
Liav A 8139688ef1 Kernel: Simplify the Interrupt management initialization 2020-04-09 19:59:53 +02:00
Liav A caa7a6c2fb Kernel: Simplify PCI messages on initialization 2020-04-09 19:59:53 +02:00
Andreas Kling 871d450b93 Kernel: Remove redundant "ACPI" from filenames in ACPI/ 2020-04-09 18:17:27 +02:00
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
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
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 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
Liav A 65dd9d5ad3 Kernel: Ensure we flush the entire ext2 superblock 2020-04-06 17:18:36 +02:00
Liav A 23fb985f02 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-06 15:36:36 +02:00