Commit graph

39438 commits

Author SHA1 Message Date
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
Linus Groh
9d60010b44 LibWeb: Mark Fetch::collect_an_http_quoted_string() [[nodiscard]] 2022-07-14 00:42:26 +01:00
Linus Groh
f42f0cceaa LibWeb: Make Fetch::collect_an_http_quoted_string()'s 2nd param optional 2022-07-14 00:42:26 +01:00
Linus Groh
fad69fcacd LibWeb: Move Fetch::collect_an_http_quoted_string() into HTTP.{cpp,h}
The Fetch spec is too big to have a generic AbstractOperations.{cpp,h}
file, so let's keep AOs in their section-specific files.
2022-07-14 00:42:26 +01:00
Linus Groh
e3798886ed LibWeb: Add & use 'HTTP whitespace' from '2.2. HTTP' in the Fetch spec
We had two independent definitions of this already, both referring to
the Fetch spec.
2022-07-14 00:42:26 +01:00
Linus Groh
df3e25f1bb LibWeb: Add & use 'HTTP tab or space' from '2.2. HTTP' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
7c2c9b6859 LibWeb: Add definitions from '2.1. URL' in the Fetch spec 2022-07-14 00:42:26 +01:00
Linus Groh
de74ba587f LibWeb: Add a stub PolicyContainer struct 2022-07-14 00:42:26 +01:00
Linus Groh
22a627fc1a LibWeb: Move Origin into the HTML namespace
Origin is defined in the HTML Standard, and therefore belongs into the
HTML directory and namespace in LibWeb.
https://html.spec.whatwg.org/multipage/origin.html#origin
2022-07-14 00:42:26 +01:00
Linus Groh
1748362e05 LibWeb: Add 'byte-{lower,upper}case' operations from the Infra spec
Usually operations that mirror AOs from the Infra spec are simply part
of the underlying data structures in AK directly, but these don't seem
generally useful enough to add them as ByteBuffer methods.
2022-07-14 00:42:26 +01:00
Linus Groh
3953004e60 AK: Add Traits<ByteBuffer>::hash() 2022-07-14 00:42:26 +01:00
Tim Schumacher
bb0feebddc cp: Implement the granular --preserve flag 2022-07-14 00:24:24 +01:00