Commit Graph

35380 Commits

Author SHA1 Message Date
Andreas Kling
8aad9e7448 Kernel: Mark sys$ftruncate() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
Andreas Kling
69a6a4d927 Kernel: Mark sys$fstatvfs() as not needing the big lock
This syscall doesn't access any data that was implicitly protected by
the big lock.
2022-03-09 16:43:00 +01:00
davidot
a61424a62b LibJS: Be more lenient when parsing milliseconds for Date
Other engines don't give NaN if there is at least one digit after the
dot for milliseconds. We were much stricter and required exactly three
digits.
But there is real world usage of different amounts of digits such as
discord having three extra trailing zeros.
2022-03-09 14:18:59 +01:00
Sahan Fernando
fd5eaf6494 Demos: Create demo for VirGL gpu device
This is a simple demo for VirGL, that does the bare minimum required to
create and render a spinning cube (with one color per face).
2022-03-09 14:58:48 +03:30
Sahan Fernando
2939f65753 SystemServer: Create device files for gpus on startup
We are adding a new class of file, a GPU device. These devices have
major number 28, and are bound to files named /dev/gpuN.
2022-03-09 14:58:48 +03:30
Sahan Fernando
a2887dc157 Kernel: Disable GPU fencing for VirtIOGPU operations
These fences should not be needed, since we force the use of
synchronous operations through synchronous_virtio_gpu_command. The use
of these fences also causes severe lag when SERENITY_GL is enabled.
2022-03-09 14:58:48 +03:30
Sahan Fernando
fd6a536c60 Kernel: Implement basic VirGL device
This commit flips VirtIOGPU back to using a Mutex for its operation
lock (instead of a spinlock). This is necessary for avoiding a few
system hangs when queuing actions on the driver from multiple
processes, which becomes much more of an issue when using VirGL from
multiple userspace process.

This does result in a few code paths where we inevitably have to grab
a mutex from inside a spinlock, the only way to fix both issues is to
move to issuing asynchronous virtio gpu commands.
2022-03-09 14:58:48 +03:30
Sahan Fernando
966989afe8 Kernel: Use AK::to_underlying instead of static_cast in VirtIOGPU 2022-03-09 14:58:48 +03:30
Sahan Fernando
0e57f80460 LibC: Add ioctls for VirGL 2022-03-09 14:58:48 +03:30
Sahan Fernando
04849c9561 Meta: Add SERENITY_GL environment variable to run.sh 2022-03-09 14:58:48 +03:30
Lady Gegga
407b67e72a Base: Add flags and RGI status to emoji.txt 2022-03-09 11:40:03 +01:00
Lady Gegga
d36baaa9ac Base: Add various flags
Add flags for Palestine, Leinster, Munster, Ulster,
South Ostrobothnia, South Savonia, Kainuu, Kanta-Häme,
Central Ostrobothnia, Central Finland, North Karelia,
Northern Savonia, Päijänne Tavastia, Satakunta, Uusimaa
2022-03-09 11:40:03 +01:00
stelar7
125a43e203 LibTLS: Add support for curve x448 2022-03-09 13:04:48 +03:30
stelar7
0df7ad7493 LibCrypto: Add curve X448 2022-03-09 13:04:48 +03:30
u9g
c8803afe3e Spreadsheet: Add CommonRange#unique() 2022-03-09 10:22:20 +03:30
u9g
b9d44eb022 Spreadsheet: Add SplitRange class and CommonRange#filter 2022-03-09 10:22:20 +03:30
Tim Schumacher
1b6a1748f0 Ports: Add ca-certificates as a dependency to curl 2022-03-08 18:21:06 -08:00
Tim Schumacher
813a1f2865 Ports: Add a ca-certificates "port" 2022-03-08 18:21:06 -08:00
Tim Schumacher
5200cdac43 Kernel: Remove an unused fd_set.h import
The project appears to build just fine without it, and the explicit use
of `LibC` causes it to conflict with the system-wide `fd_set.h` when
building inside of Serenity.
2022-03-08 16:18:48 -08:00
Hendiadyoin1
85ba70d86f Kernel: Don't override FramebufferDevice's memory regions on mmap
This additionally refactors FramebufferDevice::try_to_initialize to not
leave the FramebufferDevice in an invalid state on errors.
This also unifies the logic between FramebufferDevice::mmap and
FramebufferDevice::try_to_initialize.
This comes with the drawback of removing the UNMAP_AFTER_INIT attribute
from this function, which wasn't honoured by IntelNativeGraphicsAdapter
anyway.
2022-03-08 15:58:51 -08:00
Hendiadyoin1
790d620b39 Kernel: Use an ArmedScopeGuard to revert changes after failed mmap 2022-03-08 15:58:51 -08:00
kimlintu
a4e3ae0ee9 Help: Remove redundant selection update when opening page
Since the selection already gets updated in AbstractView::keydown_event
and AbstractView::mousedown_event we don't have to update it again in
the MainWidget::open_url function.

This fixes a bug that causes the selection to "spaz out" when
scrolling too fast between pages.
2022-03-08 23:34:45 +01:00
Jonathan Marler
97c0a8c063 Toolchain: Move nix script from Documentation into Toolchain
Moves the nix script to setup the build environment from Documentation
into the Toolchain as a callable script.  I also modified the script
to accept a "pkgs" argument to make it easy to override the nixpkgs
version from the command-line when calling the script.
2022-03-08 23:31:45 +01:00
Daniel Bertalan
70ccdb300b Kernel: Panic if the init process dies
If init crashes, all other userspace processes exit too, thus rendering
the system unusable. Previously, the kernel would still keep running
even without a userland, showing just a black screen without any
indication of the issue.

We now panic the kernel, which shows a message on the console. In the
case of the CI runners, it shuts down the virtual machine, so we don't
have to wait for the 1 hour timeout if an issue arises with
SystemServer.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
a25cc9619d Base+Meta: Make /usr/local read-write
This directory has to be writable if we want to install ports that have
been built inside Serenity. It's owned by root anyway, so having it be
read-only does not provide many security benefits.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
4f89f47acb Ports: Download fresh config.guess if needed
The config.guess file needs to know about the SerenityOS `uname -m`
system name if we want to build ports inside Serenity. Support was only
added in January 2022, so most ports don't have a new enough version
yet.

This commit adds facilities for fetching a fresh config.guess file that
supports SerenityOS, similarly to what we do for config.sub. As its
first user, we make the bash port buildable inside the system.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
aed2e214b6 Ports: Use sed -i for run_replace_in_file on Serenity hosts
We don't have a perl port, so let's use GNU sed's in-place option for
doing substitutions when running inside Serenity.

Note that we can't do this unconditionally, as `sed -i` is not portable
and works differently on BSD systems.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
ea52ba9fdc LibC: Set saved_str to null in strtok_r if no tokens were found
If we do not do this, the next call to strtok_r will start tokenizing
(and possibly modifying!) the memory pointed to by `saved_ptr`.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
4b4177f39c LibDiff: Generate hunks for new/deleted files
Previously we would fail to generate any hunks if the old or the new
file was empty. We now do, with the original/target line index set to 0,
as specified by POSIX.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
7bd68c86d3 date: Allow using a custom format string
This commit adds an optional string positional argument which is used a
custom format string for the date.
2022-03-08 23:30:47 +01:00
Daniel Bertalan
01dc718f07 LibCore: Do not skip dotfiles when copying directories recursively 2022-03-08 23:30:47 +01:00
Daniel Bertalan
a285e651f1 LibArchive: Accept space characters as terminators of tar numeric fields
POSIX specifies that each numeric field is terminated with one or more
space or NUL characters.
2022-03-08 23:30:47 +01:00
Tim Schumacher
35e5024b7d DynamicLinker: Replace $ORIGIN with the executable path 2022-03-08 23:21:35 +01:00
Tim Schumacher
e7f861f34c DynamicLinker: Implement support for RPATH and RUNPATH 2022-03-08 23:21:35 +01:00
Tim Schumacher
7bd0a3e9ba DynamicLoader: Make the cached DynamicObject publicly accessible 2022-03-08 23:21:35 +01:00
Linus Groh
03c46a261f LibWeb: Implement the WindowProxy exotic object
A couple steps requiring working relationships between browsing contexts
are currently FIXME'd - see #12917.
2022-03-08 23:13:54 +01:00
Linus Groh
6f941433d6 LibWeb: Stub out 'check if access between two BCs should be reported'
I put this is a CrossOrigin/ subdirectory in anticipation of a lot more
cross-origin related ground to cover. :^)
2022-03-08 23:13:54 +01:00
Linus Groh
ae96eae4f9 LibWeb: Implement 'cross-origin accessible window property name' concept 2022-03-08 23:13:54 +01:00
Tom
d124889698 LibC: Add IPv6 support to inet_ntop and inet_pton 2022-03-08 23:05:44 +01:00
Tom
2f0e3da142 AK: Add IPv6Address class
This is the IPv6 counter part to the IPv4Address class and implements
parsing strings into a in6_addr and formatting one as a string. It
supports the address compression scheme as well as IPv4 mapped
addresses.
2022-03-08 23:05:44 +01:00
Timothy Flynn
f235f08e6d LibJS: Use known binding indices when creating new for-loop environments
When the initialization statement of a for-loop uses 'let', we must
create a new environment for each iteration of the for loop. The
bindings of the initialization statement are copied over to the new
environment. Since the bindings are created in the same order each time,
we can use that order to directly initialize the bindings and avoid any
O(n) lookups in this hot loop.
2022-03-08 23:02:12 +01:00
Timothy Flynn
f56bf610c4 LibJS: Allow pre-allocating DeclarativeEnvironment's bindings list 2022-03-08 23:02:12 +01:00
Timothy Flynn
435f49d98e LibJS: Allow direct index-based initialization of a declarative binding
Similar to the direct getter and setter in DeclarativeEnvironment, there
are cases where we already know the index of a binding and can avoid a
O(n) lookup to re-find that index.
2022-03-08 23:02:12 +01:00
Timothy Flynn
533170fbfa LibJS: Combine DeclarativeEnvironment's bindings and names into one list
This reduces the size of the DeclarativeEnvironment from 72 bytes to 48
bytes. This savings helps in the context of nested for-loops which use
'let' to bind the initial variable declarations. In this case, the spec
dicates we create a new environment for each loop iteration by way of
the CreatePerIterationEnvironment AO.

In particular, test262's generated RegExp tests contains many loops of
the form:

    for (let i = 0; i < a_number_on_the_order_of_10; ++i)
        for (let j = 0; j < a_number_on_the_order_of_10_thousand; ++j)

This results in creating hundreds of thousands of environments.
2022-03-08 23:02:12 +01:00
Luke Wilde
8d784310e0 LibJS: Implement the Error.prototype.stack setter
This implements the setter based on the Error Stacks proposal.
https://tc39.es/proposal-error-stacks/#sec-set-error.prototype-stack

Required by Twitch.
2022-03-08 22:59:09 +01:00
electrikmilk
ad71008d6f HackStudio: Add more files to new file menu
Add Python, Java, C, PHP, Wasm, INI, JSON, and Markdown files to new
file menu.
2022-03-08 22:42:40 +01:00
electrikmilk
cd4b732acd HackStudio: Add missing key triggers
Add key triggers that are missing, primarily from the 'New..' menu.
2022-03-08 22:42:40 +01:00
electrikmilk
7fe0e7b46b HackStudio: Move 'New' Menu to 'File'
Currently we have a 'Project' menu with a 'New' menu in it, this tries
to organize things by just having one 'New...' sub-menu in the 'File'
menu that creates new files, projects and directories.

To solve conflicts, move 'Semantic Highlighting' to the 'View' menu.

As a result of both of these changes, remove 'Project' menu.
2022-03-08 22:42:40 +01:00
kimlintu
89c846a31c LibCore: Add support for application/zip mime-type
The local file header signature of a ZIP entry is normally 0x04034B50
and stored in little-endian byte order. Therefore, if the archive
starts with an entry we can identify a ZIP file by checking if the
first two bytes are 0x504B (PK).

Also checks for the .zip file extension, which is is also used by file
if no byte signature was detected.
2022-03-08 22:38:53 +01:00
javabird25
67d10a50ee Spreadsheet: Fix overridden max length related crash
NumericCell::display() attempted to take a substring of cell contents
according to the "Override max length" parameter,
but it did not account for the actual string length.
2022-03-09 01:05:12 +03:30