Commit graph

39449 commits

Author SHA1 Message Date
Timothy Flynn
c849cb9d76 LibUnicode: Fallback to per-locale default numbering systems
When patterns, grouping digits, symbols, etc. for a requested numbering
system are not found, use the locale's default numbering system. This
will allow using the correct digits e.g. for the locale "en-u-nu-arab"
even though the "en" locale only contains patterns for the "latn"
numbering system.
2022-07-15 12:31:43 +02:00
Timothy Flynn
998f62936b LibUnicode: Remove obsolete Unicode::get_default_number_system
This has been superseded by get_preferred_keyword_value_for_locale,
which doesn't require allocating a Vector just to return its first
element.
2022-07-15 12:31:43 +02:00
Timothy Flynn
c657f23e6f LibJS: Remove hard-coded lists of collation types
Working around not having collation data in the CLDR now handled in the
Unicode generators.
2022-07-15 12:31:43 +02:00
Timothy Flynn
f8f7015419 LibUnicode: Generate a method to lookup locale-preferred keyword values 2022-07-15 12:31:43 +02:00
Timothy Flynn
80568d5776 LibUnicode: Generate a method to lookup available keyword values 2022-07-15 12:31:43 +02:00
Timothy Flynn
c2e5b20eb6 LibUnicode: Generate available values for the keywords co, kf, kn, hc
This also ensures we only include values we actually support in the
generated list of available values.
2022-07-15 12:31:43 +02:00
Liav A
a660040806 Userland: Introduce the lsblk utility to show list of storage devices 2022-07-15 12:29:23 +02:00
Liav A
1dbd32488f Kernel/SysFS: Add /sys/devices/storage directory
This change in fact does the following:
1. Use support for symlinks between /sys/dev/block/ storage device
identifier nodes and devices in /sys/devices/storage/{LUN}.
2. Add basic nodes in a /sys/devices/storage/{LUN} directory, to let
userspace to know about the device and its details.
2022-07-15 12:29:23 +02:00
Liav A
22335e53e0 Kernel/Devices: Add two protected methods for DeviceManagement functions
These methods are essentially splitted from the after_inserting method
and the will_be_destroyed method so later on we can allow Storage
devices to override the after_inserting method and the will_be_destroyed
method while still being able to use shared functionality as before,
such as adding the device to and removing it from the device list.
2022-07-15 12:29:23 +02:00
Liav A
9b49d9ee60 Kernel: Declare BlockDevice::is_block_device method protected 2022-07-15 12:29:23 +02:00
Liav A
cdab213750 Kernel/SysFS: Adapt USB plug code to work with SysFS patterns 2022-07-15 12:29:23 +02:00
Liav A
70afa0b171 Kernel/SysFS: Mark SysFSDirectory traverse and lookup methods as final
This enforces us to remove duplicated code across the SysFS code. This
results in great simplification of how the SysFS works now, because we
enforce one way to treat SysFSDirectory objects.
2022-07-15 12:29:23 +02:00
Liav A
6733f19b3c Kernel/SysFS: Reduce the responsibilities of the Registry object
Instead, let the /sys/dev/block and /sys/dev/char directories to handle
the registering part of SysFSDeviceComponents by themselves.
2022-07-15 12:29:23 +02:00
Liav A
ecc29bb52e Kernel/SysFS: Add Symbolic link functionality to the filesystem
This will be used later on to help connecting a node at /sys/dev/block/
that represents a Storage device to a directory in /sys/devices/storage/
with details on that device in that directory.
2022-07-15 12:29:23 +02:00
Liav A
7e88bbe550 Kernel/SysFS: Add two methods related to relative paths for components
These methods will be used later on to introduce symbolic links support
in the SysFS, so the kernel will be able to resolve relative paths of
components in filesystem based on using the m_parent_directory pointer
in each SysFSComponent object.
2022-07-15 12:29:23 +02:00
Liav A
4744ccbff0 Kernel/Storage: Add LUN address to each StorageDevice
LUN address is essentially how people used to address SCSI devices back
in the day we had these devices more in use. However, SCSI was taken as
an abstraction layer for many Unix and Unix-like systems, so it still
common to see LUN addresses in use. In Serenity, we don't really provide
such abstraction layer, and therefore until now, we didn't use LUNs too.
However (again), this changes, as we want to let users to address their
devices under SysFS easily. LUNs make sense in that regard, because they
can be easily adapted to different interfaces besides SCSI.
For example, for legacy ATA hard drive being connected to the first IDE
controller which was enumerated on the PCI bus, and then to the primary
channel as slave device, the LUN address would be 0:0:1.

To make this happen, we add unique ID number to each StorageController,
which increments by 1 for each new instance of StorageController. Then,
we adapt the ATA and NVMe devices to use these numbers and generate LUN
in the construction time.
2022-07-15 12:29:23 +02:00
Liav A
b49af59b4a Kernel/Storage: Declare NVMeNameSpace constructor as private
Also, don't mark it as explicit.
2022-07-15 12:29:23 +02:00
Liav A
7db6b77e75 Kernel: Export both interface type and command set of a StorageDevice 2022-07-15 12:29:23 +02:00
Liav A
6ff1aeb64d Kernel/SysFS: Rename Devices code folder => DeviceIdentifiers
This folder in the SysFS code represents everything related to /sys/dev,
which is a directory meant to be a convenient interface to track all IDs
of all block and character devices (ID = major:minor numbers).
2022-07-15 12:29:23 +02:00
b14ckcat
4ad437f3a7 Kernel/USB: Support UHCI full speed bandwidth reclamation 2022-07-15 12:28:09 +02:00
Liav A
95238bdb16 Kernel/Storage: Check IDE error condition under the correct lock
This bug was probably around for a very long time, but it is noticeable
only under VirtualBox as it generated an non fatal error which caused a
kernel panic because we VERIFYed the wrong lock to be locked.
2022-07-15 12:27:32 +02:00
Liav A
ebbc38cd2a Kernel/Graphics: Remove GenericGraphicsAdapter::vga_compatible method
There's no point in keeping this method as we don't really care if a
graphics adapter is VGA compatible or not because we don't use this
method anymore.
2022-07-15 12:23:22 +02:00
Liav A
e5de5f4cf3 Ports: Update libuv to use the right /proc/memstat values 2022-07-14 23:27:46 +02:00
Liav A
7b7847c707 Ports: Update neofetch to use the right /proc/memstat values 2022-07-14 23:27:46 +02:00
Liav A
e4e5fa74d0 Kernel+Userland: Rename prefix of user_physical => physical
There's no such supervisor pages concept, so there's no need to call
physical pages with the "user_physical" prefix anymore.
2022-07-14 23:27:46 +02:00
Liav A
1c499e75bd Kernel+Userland: Remove supervisor pages concept
There's no real value in separating physical pages to supervisor and
user types, so let's remove the concept and just let everyone to use
"user" physical pages which can be allocated from any PhysicalRegion
we want to use. Later on, we will remove the "user" prefix as this
prefix is not needed anymore.
2022-07-14 23:27:46 +02:00
Andreas Kling
ed9b2a85ed Utilities: Add "pledge" utility for launching a sandboxed command
This new command allows you to run any command with an initial set
of pledge promises.

Note that dynamically linked executables won't be able to bootstrap
without at least "stdio rpath prot_exec".

Inspired by http://justine.lol/pledge/ :^)
2022-07-14 23:27:19 +02:00
Maciej
976562b817 NetworkServer: Use sv suffixes to avoid strlen at runtime 2022-07-14 23:26:47 +02:00
Maciej
4c23264efd NetworkSettings: Remove warning about reboot 2022-07-14 23:26:47 +02:00
Maciej
b5708a084b NetworkServer: Disable interface if Enabled = false
We now remove default route and set IP address to 0.0.0.0 (Kernel
interprets this as "link down") for all disabled interfaces, so that
a reboot is no longer needed.
2022-07-14 23:26:47 +02:00
Maciej
211ced3b65 NetworkServer: Kill DHCPServer as the first thing done
The DHCPServer running while we setup interfaces might manage to setup
its own config before we kill it.
2022-07-14 23:26:47 +02:00
networkException
101c5566cb Browser: Make "Go Home" open a new tab on middle mouse click 2022-07-14 13:17:33 +02:00
networkException
6cd82f0100 Browser: Allow opening bookmarks in new tab on middle mouse click
This patch updates all bookmark buttons to allow middle mouse button
pressing and respond to a middle mouse click by opening the url in a new
tab.
2022-07-14 13:17:33 +02:00
networkException
5c1f1209fc Browser: Use OpenInNewTab parameter in on_bookmark_click handler
This patch makes the function signature of the on_bookmark_click handler
more readable by replacing `Mod_None` with `OpenInNewTab::No` and
`Mod_Ctrl` with `OpenInNewTab::Yes`.
2022-07-14 13:17:33 +02:00
networkException
f9212ac02e LibGUI: Add button handler for middle mouse clicks 2022-07-14 13:17:33 +02:00
networkException
18c84d2e63 LibGUI: Allow specifying the mouse buttons able to press down a button
This patch adds the ability to modify the set of mouse buttons able to
press down a button
2022-07-14 13:17:33 +02:00
Liav A
37b4133c51 Kernel: Allocate user physical pages instead of supervisor ones for DMA
We are limited on the amount of supervisor pages we can allocate, so
don't allocate from that pool. Supervisor pages are always below 16 MiB
barrier so using those was crucial when we used devices like the ISA
SoundBlaster 16 card, because that device required very low physical
addresses to be used.
2022-07-14 13:15:24 +02:00
Liav A
b22149601a LibVT: Remove Vector<Kernel::KString> title stack
When using the kernel console, there's no such concept of title at all.
Also, this makes vim to crash the kernel due to dereferencing a null
pointer, so let's remove this as this is clearly not needed when using
the kernel virtual console.
2022-07-14 13:13:48 +02:00
Daniel Bertalan
e93d19bbb1 Kernel: Don't lock the scheduler in ProcFSOverallProcesses::try_generate
This used to be needed to protect accesses to Process::all_instances.
That list now has a more granular lock, so we don't need to take the
scheduler lock.

This fixes a crash when we try to access a locked Thread::m_fds in the
loop, which calls Thread::block, which then asserts that the scheduler
lock must not be locked by the current process.

Fixes #13617
2022-07-14 13:13:40 +02:00
Filiph Sandström
004bb59be5 Base: Remove accidental duplicate file
Looks like `NetworkSettings.gml` accidentally got placed
inside of `/Base/home/anon`.
2022-07-14 13:12:15 +02:00
Wuzado
d3cffcfee5 LibVT: Show application display name when hovered over, if available
Fixes #14416.
2022-07-14 13:11:48 +02:00
Ali Mohammad Pur
0d6dc74951 AK: Use the correct data types in bitap_bitwise()
Otherwise the bit twiddling goes all wrong and breaks some boundary
cases.
Fixes `StringView::contains(31-chars)`.
2022-07-14 13:10:23 +02:00
djwisdom
ae60357951 Ports: Update serenity-theming use latest commit 2ce930e 2022-07-14 04:34:19 +00:00
Linus Groh
db5c455238 LibWeb: Use newly added 'Status' Fetch infrastructure in XMLHttpRequest 2022-07-14 00:42:26 +01:00
Linus Groh
aa852fd9f2 LibWeb: Use newly added 'Headers' Fetch infrastructure in XMLHttpRequest 2022-07-14 00:42:26 +01:00
Linus Groh
d232f3fc41 LibWeb: Use newly added 'Methods' Fetch infrastructure in XMLHttpRequest 2022-07-14 00:42:26 +01:00
Linus Groh
f507f68d4a LibWeb: Add definitions from '2.2.4. Bodies' in the Fetch spec
...at least the ones that don't require an implementation of the Streams
spec :^)
2022-07-14 00:42:26 +01:00
Linus Groh
1694279dd8 LibWeb: Add definitions from '2.2.3. Statuses' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
dd9bf10151 LibWeb: Add definitions from '2.2.2. Headers' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
9244f1697d LibWeb: Add definitions from '2.2.1. Methods' in the Fetch spec 2022-07-14 00:42:26 +01:00