Commit Graph

27160 Commits

Author SHA1 Message Date
Ben Wiederhake
45126655cd LibGUI+WindowServer: Introduce new mouse tracking mechanism 2021-09-08 10:53:49 +02:00
Liav A
bde3c7301e Kernel/ACPI: Return Optional container after table search
This is a better pattern than returning a PhysicalAddress with a zero
value, so the code is more understandable now.
2021-09-08 10:27:02 +02:00
davidot
43b17f27a3 test-js: Add a mark_as_garbage method to force GC to collect that object
This should fix the flaky tests of test-js.
It also fixes the tests when running with the -g flag since the values
will not be garbage collected too soon.
2021-09-08 08:53:02 +01:00
Rodrigo Tobar
3373090993 Ports: Add gsl 2021-09-08 08:49:56 +01:00
Luke Wilde
7788a7e744 LibJS: Fix Temporal.PlainTime.prototype.equals test
The two plain times weren't being compared to each other.
2021-09-08 08:48:13 +01:00
Nico Weber
62e0bf852e Kernel: Don't link Prekernel against libsupc++
It isn't needed.

Also, we stopped linking Kernel against it in 67f0c0d5f0. libsupc++
depends on symbols like free() or realloc() which we removed from
Kernel/StdLib.cpp after 67f0c0d5f0 and which don't exist in Prekernel
either.

(It also happens to make the aarc64 link fail in less obvious ways.)
2021-09-08 04:23:17 +00:00
Linus Groh
33f76f88bb LibJS: Add and use the CreateNegatedTemporalDuration AO
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6178ed3
2021-09-08 00:07:18 +01:00
Linus Groh
f046a4a75d LibJS: Make implementation-defined language more concise
This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/42c964e
2021-09-08 00:07:18 +01:00
Linus Groh
86a7c795f6 LibJS: Use the newly added remainder operation in GetISOPartsFromEpoch
This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/b7bdc65
2021-09-08 00:07:18 +01:00
Linus Groh
97cc8f4613 LibJS: Validate Calendar.prototype.fields() values more strictly
This is a normative change in the Temporal spec.

See:

- https://github.com/tc39/proposal-temporal/commit/75b66d8
- https://github.com/tc39/proposal-temporal/commit/9c2262b
2021-09-08 00:07:18 +01:00
Liav A
fb7b4caa57 Kernel/Storage: Implement basic AHCI hotplug support
This is really a basic support for AHCI hotplug events, so we know how
to add a node representing the device in /sys/dev/block and removing it
according to the event type (insertion/removal).

This change doesn't take into account what happens if the device was
mounted or a read/write operation is being handled.

For this to work correctly, StorageManagement now uses the Singleton
container, as it might be accessed simultaneously from many CPUs
for hotplug events. DiskPartition holds a WeakPtr instead of a RefPtr,
to allow removal of a StorageDevice object from the heap.
StorageDevices are now stored and being referenced to via an
IntrusiveList to make it easier to remove them on hotplug event.

In future changes, all of the stated above might change, but for now,
this commit represents the least amount of changes to make everything
to work correctly.
2021-09-08 00:42:20 +02:00
Liav A
74c4c864bd Kernel+SystemServer: Simplify the DevTmpFS design
We are no longer have a separate Inode object class for the pts
directory. With a small exception to this, all chmod and chown code
is now at one place.
It's now possible to create any name of a sub-directory in the
filesystem.
2021-09-08 00:42:20 +02:00
Liav A
a7cb2ca1bf SystemServer: Don't rely on fstab to specify where to mount the ProcFS
For now, just hardcode the mounting in SystemServer code.
2021-09-08 00:42:20 +02:00
Liav A
3d5ddbab74 Kernel: Rename DevFS => DevTmpFS
The current implementation of DevFS resembles the linux devtmpfs, and
not the traditional DevFS, so let's rename it to better represent the
direction of the development in regard to this filesystem.

The abbreviation for DevTmpFS is still "dev", because it doesn't add
value as a commandline option to make it longer.

In quick summary - DevFS in unix OSes is simply a static filesystem, so
device nodes are generated and removed by the kernel code. DevTmpFS
is a "modern reinvention" of the DevFS, so it is much more like a TmpFS
in the sense that not only it's stored entirely in RAM, but the userland
is responsible to add and remove devices nodes as it sees fit, and no
kernel code is directly being involved to keep the filesystem in sync.
2021-09-08 00:42:20 +02:00
Liav A
750ca2190b Kernel/DevFS: Add the ability to remove device nodes
In order to make this kind of operation simpler, we no longer use a
Vector to store pointers to DevFSDeviceInode, but an IntrusiveList is
used instead. Also, we only allow to remove device nodes for now, but
in theory we can allow to remove all kinds of files from the DevFS.
2021-09-08 00:42:20 +02:00
Liav A
f52d102270 SystemServer: Traverse sub-directories in /sys/dev
While traversing in both /sys/dev/char and /sys/dev/block, SystemServer
populates the DevFS (mounted normally in /dev) with the corresponding
device nodes.

This is a very crude implementation of populating DevFS device nodes,
before we have a full-fledged udev-like daemon to take care of this
task. Also, we don't populate DiskPartition device nodes yet, because
that requires more sophisticated mechanism to figure out which
DiskPartition is related to which StorageDevice.
2021-09-08 00:42:20 +02:00
Liav A
6a9c717a30 Kernel: Expose device presence in /sys/dev/char and /sys/dev/block
These files are not marked as block devices or character devices so they
are not meant to be used as device nodes. The filenames are formatted to
the pattern "major:minor", but a Userland program need to call the parse
these format and inspect the the major and minor numbers and create the
real device nodes in /dev.

Later on, it might be a good idea to ensure we don't create new
SysFSComponents on the heap for each Device, but rather generate
them only when required (and preferably to not create a SysFSComponent
at all if possible).
2021-09-08 00:42:20 +02:00
Liav A
009feefee0 Kernel/Devices: Ensure appropriate locking on the Device map singleton
Devices might be removed and inserted at anytime, so let's ensure we
always do these kind of operations with a good known state of the
HashMap.

The VirtIO code was modified to create devices outside the IRQ handler,
so now it works with the new locking of the devices singleton, but a
better approach might be needed later on.
2021-09-08 00:42:20 +02:00
Liav A
21b6d84ff0 Kernel/Devices: Remove required_mode and device_name methods
These methods are no longer needed because SystemServer is able to
populate the DevFS on its own.

Device absolute_path no longer assume a path to the /dev location,
because it really should not assume any path to a Device node.

Because StorageManagement still needs to know the storage name, we
declare a virtual method only for StorageDevices to override, but this
technique should really be removed later on.
2021-09-08 00:42:20 +02:00
Liav A
4f04cb98c1 Kernel/VFS: Silence mknod debug spam
Since we populate the DevFS now in userspace, this creates a bunch of
unnecessary noise in the kernel log.
2021-09-08 00:42:20 +02:00
Liav A
e0d712c6f7 Kernel+SystemServer: Defer creation of device nodes to userspace
Don't create these device nodes in the Kernel, so we essentially enforce
userspace (SystemServer) to take control of this operation and to decide
how to create these device nodes.

This makes the DevFS to resemble linux devtmpfs, and allows us to remove
a bunch of unneeded overriding implementations of device name creation
in the Kernel.
2021-09-08 00:42:20 +02:00
Liav A
fcc046047f Kernel/DevFS: Simplify nodes insertion and lookup
Use IntrusiveList instead of a Vector to add inodes to a directory.
2021-09-08 00:42:20 +02:00
sin-ack
f633fb706e AK: Add note about an internal compile error with Optional in GCC 10.3+
This bit me because I accidentally made the destructor for a class which
was wrapped in an Optional private. This causes none of the Optional
destructors to be able to be deduced, which when combined with concepts
causes an internal compile error in GCC 10.3.0+. This commit adds a note
here to make sure that future encounters of this bug does not surprise
people.
2021-09-08 00:37:19 +02:00
Hendiadyoin1
93ce8fc985 UserspaceEmulator: Handle SO_ERROR in getsockopt
This makes GUI applications work again
2021-09-07 21:26:21 +00:00
Andreas Kling
5017cc2bd3 Meta: Add Idan Horowitz as a project maintainer :^) 2021-09-07 22:16:25 +02:00
Andreas Kling
6696d414d4 Meta: Add Brian Gianforcaro as a project maintainer :^) 2021-09-07 22:16:25 +02:00
Andreas Kling
5159f64117 Kernel: Stop leaking TmpFS inodes
TmpFS inodes rely on the call to Inode::one_ref_left() to unregister
themselves from the inode cache in TmpFS.

When moving various kernel classes to ListedRefCounted for safe unref()
while participating on lists, I forgot to make ListedRefCounted check
for (and call) one_ref_left() & will_be_destroyed() on the CRTP class.
2021-09-07 22:16:25 +02:00
Andreas Kling
049d846eb9 Kernel/TmpFS: Stop leaking directory entry metadata
When creating and removing a child to a TmpFS directory, we were
forgetting to delete the TmpFSInode::Child struct.
2021-09-07 22:16:25 +02:00
Andreas Kling
e550d53c0f Kernel: Remove a bunch of unused TimerQueue functions 2021-09-07 22:16:25 +02:00
Andreas Kling
905065f8c8 Kernel: Make PerformanceEventBuffer::to_json() return a KResult
There's a ton of things inside to_json() that could go wrong but we
don't know about it yet. One step at a time.
2021-09-07 22:16:25 +02:00
Andreas Kling
6f992d784f Kernel: Add const variant of Process::perf_events()
This lets us get rid of some const_casts.
2021-09-07 22:16:25 +02:00
Andreas Kling
ec4b814c9a Kernel: Use OOM-safe absolute path serialization in InodeFile::mmap()
Switch from OpenFileDescription::absolute_path() to the OOM-safe
try_serialize_absolute_path() (and propagate any errors to the caller.)
2021-09-07 22:16:25 +02:00
Luke Wilde
1a28fc3cb5 LibWeb: Add preceding and following Node cases in tree constraints
This also does some east-const changes in TreeNode.
2021-09-07 22:06:39 +02:00
Idan Horowitz
24ed8511dd CI+Meta: Add Signed-off-by tag filter to the commit message linter 2021-09-07 20:46:34 +01:00
Nico Weber
17ab44e7d7 Meta: Make BuildClang.sh produce less output when running in a TTY
Ninja disables its fancy output mode when it's not writing to a TTY.
So don't pipe its output into something else, so that it writes to
a TTY if the invoking terminal is a TTY.
2021-09-07 20:29:22 +01:00
Nico Weber
eb7b8a7bbe Meta: Don't pass LLVM_LLVM_BUILD_LLVM_DYLIB to cmake
`LLVM_LLVM_BUILD_LLVM_DYLIB` does not exist, so passing this does
nothing but make CMake warn.

However, since we pass `LLVM_LINK_LLVM_DYLIB`, `LLVM_BUILD_LLVM_DYLIB`
(the correct spelling) defaults to true anyways.  So let's pass fewer
flags.

No behavior change, but fixes a CMake warning.
2021-09-07 20:29:22 +01:00
Nico Weber
1ed1a57707 Meta: Make serenity.sh rebuild-toolchain aarch64 clang work 2021-09-07 20:29:22 +01:00
Ernests Kuzņecovs
82cb885966 Documentation: Add missing dependencies for Nix
I was building serenity on quite a fresh NixOS system and it turns
out `unzip` and `qemu` were missing from this nix expression to
compile and run serenity.
2021-09-07 20:23:23 +01:00
Nico Weber
a8d96df8e0 Kernel: Build MiniStdLib.cpp in aarch64 builds 2021-09-07 20:15:15 +01:00
Nico Weber
208aa05cf3 Kernel: Build UBSanitizer.cpp in aarch64 builds
All these symbols will be needed once we build MiniStdLib.cpp.
2021-09-07 20:15:15 +01:00
Nico Weber
d0b0c45690 Kernel: Remove two unused includes from Prekernel/UBSanitizer.cpp 2021-09-07 20:15:15 +01:00
Ali Mohammad Pur
7fefb8148b LibRegex: Use the correct capture group index in ERE bytecode generation
Otherwise the left and right capture instructions wouldn't point to the
same capture group if there was another nested group there.
2021-09-07 20:01:58 +02:00
Luke Wilde
44b8afdbc4 LibWeb: Don't trim whitespace when checking for "module" type on scripts
No major engine allows whitespace in the type when checking for
"module".

This was also reflected in the relevant web platform test, but not in
the spec.

The spec has been changed to match this behaviour: 23c723e3e9
2021-09-07 17:22:24 +02:00
Mustafa Quraish
405b282bc3 PixelPaint: Show mouse position in statusbar without active tool
Showing the position only with an active tool seems a bit confusing,
if you've opened up an image just to find out the coordinates of
a pixel for instance, there shouldn't be a need to have to select
a tool first.
2021-09-07 16:53:40 +02:00
Mustafa Quraish
736ab4f83a PixelPaint: Add Menu action/shortcut to close current image tab
Ctrl+W now closes the current Image tab.
2021-09-07 16:53:40 +02:00
Mustafa Quraish
255f729c1f PixelPaint: Register RectangleTool thickness slider as primary
... So we can use `[` and `]` shortcuts to change the size.
2021-09-07 16:53:40 +02:00
Mustafa Quraish
d6348e1b32 PixelPaint: Use correct thickness in RectangleTool::on_second_paint()
Previously, we were ignoring the scale of the editor in the second
paint step. If you were zoomed in, the size while you were drawing
was not the same as the size of the final shape.
2021-09-07 16:53:40 +02:00
Mustafa Quraish
603d3a5dc6 PixelPaint: Use correct thickness in LineTool::on_second_paint()
Previously, we were ignoring the scale of the editor in the second
paint step. If you were zoomed in, the size while you were drawing
was not the same as the size of the final shape.
2021-09-07 16:53:40 +02:00
Mustafa Quraish
0a9c64a4f5 PixelPaint: Use correct thickness in EllipseTool::on_second_paint()
Previously, we were ignoring the scale of the editor in the second
paint step. If you were zoomed in, the size while you were drawing
was not the same as the size of the final shape.
2021-09-07 16:53:40 +02:00
Andreas Kling
9669bf29f6 Kernel: Make Device request creation return KResultOr
This allows us to propagate errors in a bunch of new places.
2021-09-07 16:42:03 +02:00