Commit Graph

2553 Commits

Author SHA1 Message Date
Liav A
b13417ddb4 ACPI: Examine bit width in Generic address structure before asserting
Also, the switch-case flow is simplified for IO access within a Generic
address strucuture's handling.
2020-03-12 12:36:38 +01:00
Liav A
5d7855adea ACPI: Keep common flags in structures for later usage 2020-03-12 12:36:38 +01:00
marprok
3cbc2f4381 Ext2FS: Reset the found_a_group flag 2020-03-12 12:35:00 +01:00
Marios Prokopakis
8cf962a102
Userland: Set the mask of a network adapter with ifconfig (#1388)
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-11 21:30:41 +01:00
Andreas Kling
3803196edb Kernel: Get rid of SmapDisabler in sys$fstat() 2020-03-10 13:34:24 +01:00
Till Mayer
ac3c19b91c Games: Added solitaire to build-root-filesystem.sh 2020-03-09 21:36:59 +01:00
Liav A
0f45a1b5e7 Kernel: Allow to reboot in ACPI via PCI or MMIO access
Also, we determine if ACPI reboot is supported by checking the FADT
flags' field.
2020-03-09 10:53:13 +01:00
Liav A
8639ee2640 PCI: Enable LogStream output for addresses 2020-03-09 10:53:13 +01:00
Liav A
032ce1948e LibBareMetal: Return FlatPtr from PhysicalAddress::offset_in_page() 2020-03-09 10:53:13 +01:00
Liav A
4479e874da Kernel: Ensure RTL8139NetworkAdapter uses virtual memory correctly 2020-03-08 14:13:30 +01:00
Liav A
9dbc273675 Kernel: Ensure E1000NetworkAdapter uses virtual memory correctly 2020-03-08 14:13:30 +01:00
Liav A
d6e122fd3a Kernel: Allow contiguous allocations in physical memory
For that, we have a new type of VMObject, called
ContiguousVMObject, that is responsible for allocating contiguous
physical pages.
2020-03-08 14:13:30 +01:00
Ben Wiederhake
b066586355 Kernel: Fix race in waitid
This is similar to 28e1da344d
and 4dd4dd2f3c.

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-08 14:12:12 +01:00
Ben Wiederhake
d8cd4e4902 Kernel: Fix race in select
This is similar to 28e1da344d
and 4dd4dd2f3c.

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-08 14:12:12 +01:00
Ben Wiederhake
0edae63cc0 Kernel: Fix inconsistent inclusion style
This also makes it easier to automatically parse the dependency tree.
Thankfully, this is the only place where a change was necessary.
2020-03-08 14:09:08 +01:00
Andreas Kling
fa9fba6901 Kernel: Add missing #includes now that <AK/StdLibExtras.h> is smaller 2020-03-08 13:06:51 +01:00
Andreas Kling
b1058b33fb AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it
possible to pass a FlatPtr to something that has u32 and u64 overloads.
2020-03-08 13:06:51 +01:00
Andreas Kling
f2f16e1c24 IPv4: Keep IPv4 socket locked during receive operations
We unlock/relock around blocking, but outside of that we now keep the
socket locked.

This fixes an intermittent ASSERT(m_can_read) failure.
2020-03-07 11:27:55 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Liav A
f3f8b88d8f Kernel: Fix syntax error in FIFO_DEBUG 2020-03-06 22:29:24 +01:00
Tibor Nagy
30152b6c88 Kernel: Fix syntax errors in PS2MOUSE_DEBUG
Found with Cppcheck.
2020-03-06 22:20:53 +01:00
Liav A
a6c53cadc8 Meta: Claim copyright on PCI files 2020-03-06 16:03:58 +01:00
Liav A
9991a36d1a CPU: Prevent leakage of virtual addresses to kernel log 2020-03-06 15:57:19 +01:00
Liav A
5cbde297ec Meta: Claim copyright on ACPI files 2020-03-06 15:56:51 +01:00
Andreas Kling
c6693f9b3a Kernel: Simplify a bunch of dbg() and klog() calls
LogStream can handle VirtualAddress and PhysicalAddress directly.
2020-03-06 15:00:44 +01:00
Andreas Kling
75a6b27f73 Ext2FS: Remove unused allocate_block()
We only use allocate_blocks() now. If you want a single block, you can
just call allocate_blocks() with a count of 1.
2020-03-06 11:22:23 +01:00
Liav A
e2889e665f Kernel: Shorten the model name of i8529 PIC class 2020-03-06 11:19:51 +01:00
Liav A
7ef5d222f1 Kernel: Change data in /proc/interrupts to be more richer
Also, during interrupt handlers' enumeration, we call all interrupts
handlers that are not UnhandledInterruptHandler.
2020-03-06 11:19:51 +01:00
Liav A
773afefe7c Kernel: Change HandlerPurpose to HandlerType
Also, GenericInterruptHandler class requires to implement two new
methods.
2020-03-06 11:19:51 +01:00
Andreas Kling
2709116334 Kernel: Fix strange looking output on unhandled page fault 2020-03-06 10:41:08 +01:00
Andreas Kling
8bb361889c AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where
we'd implicitly convert the bool to an integer type and carry on with
the number 1 instead of the actual value().
2020-03-06 10:32:58 +01:00
Liav A
425a2ca6ad Init Stage: Allow to boot with smp=on
One can now set the kernel boot argument smp to on, and therefore, to
instruct the kernel to use the IOAPIC instead of the PIC.
2020-03-06 10:32:32 +01:00
Liav A
c335c94242 Kernel: Simplify APIC::enable()
We install a SpuriousInterruptHandler when calling APIC::enable(),
and we don't enable local interrupts for now.
2020-03-06 10:32:32 +01:00
Liav A
a3fa40fc07 Kernel: Enable IRQs before sending commands to devices
Without this fix, a very fast IRQ can preempt the enable_irq() call,
leaving that IRQ being unhandled.
2020-03-06 10:32:32 +01:00
Liav A
f33fb151b4 CPU: Allow to use IRQs in range of 50 to 178 2020-03-06 10:32:32 +01:00
Liav A
30fc78bfaf Kernel: Acquire ISA interrupt overrides from Interrupt Management
Also, InterruptDisabler were added to prevent critical function from
being interrupted. In addition, the interrupt numbers are abstracted
from IDT offsets, thus, allowing to create a better routing scheme
when using IOAPICs for interrupt redirection.
2020-03-06 10:32:32 +01:00
Liav A
d9d792d37f Kernel: Print MultiProcessor features 2020-03-06 10:32:32 +01:00
Andreas Kling
94f287b1c0 Kernel: Unmap non-readable pages
This was caught by running all crash tests with "crash -A".
Basically, non-readable pages need to not be mapped *at all* so that
a "page not present" exception is provoked on access.

Unfortunately x86 does not support write-only mappings, so this is
the best we can do.

Fixes #1336.
2020-03-06 09:58:59 +01:00
Liav A
85eb1d26d5 Kernel: Run clang-format on Process.cpp & ACPIDynamicParser.h 2020-03-05 19:04:04 +01:00
Liav A
1b8cd6db7b Kernel: Call ACPI reboot method first if possible
Now we call ACPI reboot method first if possible, and if ACPI reboot is
not available, we attempt to reboot via the keyboard controller.
2020-03-05 19:04:04 +01:00
Ben Wiederhake
4dd4dd2f3c Kernel: Fix race in clock_nanosleep
This is a complete fix of clock_nanosleep, because the thread holds the
process lock again when returning from sleep()/sleep_until().
Therefore, no further concurrent invalidation can occur.
2020-03-03 20:13:32 +01:00
Andreas Kling
686ade6b5a AK: Make quick_sort() a little more ergonomic
Now it actually defaults to "a < b" comparison, instead of forcing you
to provide a trivial less-than comparator. Also you can pass in any
collection type that has .begin() and .end() and we'll sort it for you.
2020-03-03 16:02:58 +01:00
Liav A
251b7f3776 CPU: Change debug messages to fit the latest changes 2020-03-02 22:23:39 +01:00
Liav A
f0ca29eb4b Kernel: Run clang-format on various files 2020-03-02 22:23:39 +01:00
Liav A
0fc60e41dd Kernel: Use klog() instead of kprintf()
Also, duplicate data in dbg() and klog() calls were removed.
In addition, leakage of virtual address to kernel log is prevented.
This is done by replacing kprintf() calls to dbg() calls with the
leaked data instead.
Also, other kprintf() calls were replaced with klog().
2020-03-02 22:23:39 +01:00
Liav A
19aa53e1f9 Kernel: Use IOAddress class in PATAChannel class
This change make the code a bit more readable. Also, kprintf() calls
are replaced with klog() calls.
2020-03-02 22:23:39 +01:00
Liav A
15dfca4a79 Kernel: Use IOAddress class in Network adapters' drivers
Also, kprintf() calls were replaced with klog() calls.
2020-03-02 22:23:39 +01:00
Andreas Kling
918ebabf60 Kernel: MemoryManager should create cacheable regions by default 2020-03-02 13:04:17 +01:00
Andreas Kling
47beab926d Kernel: Remove ability to create kernel-only regions at user addresses
This was only used by the mechanism for mapping executables into each
process's own address space. Now that we remap executables on demand
when needed for symbolication, this can go away.
2020-03-02 11:20:34 +01:00
Andreas Kling
e56f8706ce Kernel: Map executables at a kernel address during ELF load
This is both simpler and more robust than mapping them in the process
address space.
2020-03-02 11:20:34 +01:00