Commit graph

32693 commits

Author SHA1 Message Date
Chris Frey
8f3759c04f Meta: Use fuse2fs if available to avoid root when building image
The fuse2fs tool that is part of e2fsprogs-1.46 has a 'fakeroot'
mount option.  This allows a non-root users to modify file ownership
and permissions without actually being root.  This package is
available in Debian bullseye and buster-backports.

If available, the script assumes the user wants to use it.
Otherwise, it falls back to the usual root requirements.

Now that root is not required, the root check in
build-root-filesystem.sh is not necessary.  Since
build-root-filesystem.sh has 'set -e' enabled, removing this check
will not cause a change in functionality.
2022-01-13 03:35:21 -08:00
Chris Frey
951f7becec Meta: Use consistent indents in build-image-qemu.sh
This is a whitespace only commit to avoid confusion with the
next feature commit.
2022-01-13 03:35:21 -08:00
Chris Frey
319cdf4ff3 Meta: Do not ignore error message with exec
When calling sub-programs from shell with exec, the useful || die
idiom does not actually do anything, since the first script is gone.
2022-01-13 03:35:21 -08:00
Jelle Raaijmakers
8e935ad3b1 LibGL+LibSoftGPU: Implement glColorMaterial and GL_COLOR_MATERIAL
When `GL_COLOR_MATERIAL` is enabled, specific material parameters can
be overwritten by the current color per-vertex during the lighting
calculations. Which parameter is controlled by `glColorMaterial`.

Also move the lighting calculations _before_ clipping, because the spec
says so. As a result, we interpolate the resulting vertex color instead
of the input color.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
9d4c2f6308 LibGL+LibSoftGPU: Calculate spotlight cutoff angle as degrees
We were storing the radians but never using that value in the GPU. We
now directly use the degrees value.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
8c28d167c9 LibGL: Report unsupported capabilities in glEnable and glDisable 2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
c03b21f0ea LibGL: Make MaterialFace a simple u8 enum
Now we don't need to use `to_underlying` everywhere.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
58e025ac08 LibSoftGPU: Change Material vectors to FloatVector4
Same type, but more consistent with the rest of LibSoftGPU and LibGL.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
db1509c0de LibGL: Use C++ casts in glColor 2022-01-13 12:13:58 +01:00
Luke Wilde
1fc611877f LibGL: Implement glIsTexture
Required by Xash3D for the r_showtextures command, where it shows every
allocated texture on screen.

Description of glIsTexture from the spec:
"glIsTexture returns GL_TRUE if texture is currently the name of a
texture. If texture is zero, or is a non-zero value that is not
currently the name of a texture, or if an error occurs, glIsTexture
returns GL_FALSE.

A name returned by glGenTextures, but not yet associated with a texture
by calling glBindTexture, is not the name of a texture."

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
2022-01-13 12:13:40 +01:00
Andreas Kling
adfb0846d2 Meta: Add kleines Filmröllchen to the contributors list :^) 2022-01-13 12:10:08 +01:00
Andreas Kling
0b66702697 Meta: Add Xexxa to the contributors list :^) 2022-01-13 12:08:12 +01:00
Andreas Kling
cfc9ce66d9 Kernel: Skip unnecessary TLB flush when growing kmalloc heap
When adding entirely new page table mappings, we don't need to flush
the TLB since they were not present before.
2022-01-13 11:22:11 +01:00
Andreas Kling
de05223122 Kernel: Don't flush TLB after creating brand-new mappings
The CPU will not cache TLB entries for non-present mappings, so we
can simply skip flushing the TLB after creating entirely new mappings.
2022-01-13 11:22:11 +01:00
kleines Filmröllchen
068aea660c AK: Explain why FixedArray has no move assignment 2022-01-13 11:17:44 +01:00
kleines Filmröllchen
594bbbf020 Tests: Test FixedArray completely
Except for tangential accessors such as data(), there is no more feature
of FixedArray that is untested after this large expansion of its test
cases. These tests, with the help of the new NoAllocationGuard, also
test the allocation contract that was fixated in the last commit.

Hopefully this builds confidence in future Kernel uses of FixedArray
as well as its establishment in the real-time parts of the audio
subsystem. I'm excited :^)
2022-01-13 11:17:44 +01:00
kleines Filmröllchen
1d144ed6fc AK: Remove clear() from FixedArray and fixate its allocation guarantees
FixedArray always *almost* had the following allocation guarantees:
There is (possibly) one allocation in the constructor and one (or more)
deallocation(s) in the destructor. No other operation allocates or
deallocates. With this removal of the public clear() method, which
nobody except the test used anyways, those guarantees are now completely
true and furthermore fixated with an explanatory comment.
2022-01-13 11:17:44 +01:00
kleines Filmröllchen
9bf2d0b718 AK: Disable NoAllocationGuard on Lagom
Because we don't have our LibC on Lagom, the allocation guard global
flag doesn't exist and NoAllocationGuard fails to build on Lagom.
Whoops. For now, just disable NoAllocationGuard's functionality here.
2022-01-13 11:17:44 +01:00
Linus Groh
b9093dd0ab LibJS: Don't validate time zone name when parsing Instant string
This is normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2a81fbc
2022-01-13 10:08:34 +01:00
DaftMouse
6394ff4ea8 Base: Fix wrong keys in pt-br keymap
This puts ]} and \| on the right keys and adds ' "
2022-01-13 00:21:55 -08:00
electrikmilk
2a5bcc6bec Base: Correct Roman font name
I misunderstood the "Family" and "Name" fields.
2022-01-13 00:20:32 -08:00
Idan Horowitz
40159186c1 Kernel: Remove String use-after-free in generate_auxiliary_vector
Instead we generate the random bytes directly in
make_userspace_context_for_main_thread if requested.
2022-01-13 00:20:08 -08:00
Idan Horowitz
215e031bf5 Kenrel: Use a KString for Ext2FSDirectoryEntry::name
This brings Ext2FileSystem one step closer to being OOM-safe.
2022-01-13 00:20:08 -08:00
Idan Horowitz
0e44bb7d82 Kernel: Add a KString::bytes() helper 2022-01-13 00:20:08 -08:00
Idan Horowitz
3098b11c07 Kernel: Remove unused AK/String.h include from CommandLine.h 2022-01-13 00:20:08 -08:00
Idan Horowitz
e72bbca9eb Kernel: Fix OOB write in sys$uname
Since this was only out of bounds of the specific field, not of the
whole struct, and because setting the hostname requires root privileges
this was not actually a security vulnerability.
2022-01-13 00:20:08 -08:00
Idan Horowitz
50d6a6a186 Kernel: Convert hostname to KString 2022-01-13 00:20:08 -08:00
Idan Horowitz
6402840670 Kernel: Replace {KString => String}::formatted in determine_boot_device 2022-01-13 00:20:08 -08:00
Idan Horowitz
ec1f3abd34 Kernel: Use KString::formatted in FramebufferDevice::create_framebuffer
This allows us to avoid the infallible String::formatted.
2022-01-13 00:20:08 -08:00
Idan Horowitz
618f123463 Kernel: Use StringView instead of String in RingBuffer's constructor
This String was being copied into a KString internally anyways.
2022-01-13 00:20:08 -08:00
Idan Horowitz
792b8ca13c Kernel: Use StringView::to_uint instead of String::to_uint in ProcFS 2022-01-13 00:20:08 -08:00
Idan Horowitz
119f900451 Kernel: Use StringView literals instead of empty Strings in ProcFS 2022-01-13 00:20:08 -08:00
Idan Horowitz
0fc25273e4 Kernel: Make Process::dump_perfcore OOM-fallible using KString 2022-01-13 00:20:08 -08:00
Luke Wilde
010a37f997 Ports/HalfLife: Do not delete the OpenGL renderer in post install
We can now play Half-Life using LibGL without crashing on launch! :^)
2022-01-13 10:07:45 +02:00
Luke Wilde
f91e41f90c LibGL: Generate texture in glBindTexture if not previously generated
Required by Xash3D, which forgoes glGenTexture and implements its own
texture generator. It expects glBindTexture to pick up on this though.

The strategy here is to keep texture_object null if we don't find the
texture in the allocation textures map, as it will then both generate
and set the texture in the allocated textures map using the texture
name passed to us, then bind it.
2022-01-13 10:07:45 +02:00
Luke Wilde
53d6e1600c LibGL: Stub glStencilMask
Xash3D requires this otherwise it will crash with a jump to nullptr,
but it doesn't use it for anything interesting and just sets a default
value of ~0 during initialization.
2022-01-13 10:07:45 +02:00
Luke Wilde
cba1972deb LibGL: Implement glTexCoord{1,3,4}f(v)
Not necessarily required by Half-Life's use of Xash3D, but it looks
them up anyway and they're easy to implement, so here they are :^).
2022-01-13 10:07:45 +02:00
Lady Gegga
10a52c0b32 FontEditor: Add Klingon phrase to Preview Font 2022-01-12 22:54:59 +01:00
Linus Groh
cf6ceb956f LibJS: Avoid js_string() allocation in parse_time_zone_offset_string()
No need to take the spec literally here since we know the input values
are guaranteed to be integral numbers. Use AK string to number parsing
functionality instead and save a couple of PrimitiveString allocations.

This matches what we already do in parse_temporal_time_zone_string().
2022-01-12 21:24:12 +01:00
Linus Groh
392f5bfebd LibJS: Fix fraction substring range in parse_temporal_time_zone_string()
Two issues:

- The intended range was 9 characters starting from index 1. Since the
  second argument to String::substring() is the length, 10 is
  potentially reading further than the string's length (when only
  providing one fraction digit), causing an assertion failure crash.
- The spec's intention to skip the decimal separator by starting at
  index 1 is incorrect, no decimal separator is present in the result of
  parsing TimeZoneUTCOffsetFractionalPart. I filed a spec fix for this,
  see: https://github.com/tc39/proposal-temporal/pull/1999
2022-01-12 21:24:12 +01:00
Linus Groh
027e4bd439 LibJS: Fix calculation overflow in parse_temporal_time_zone_string()
As all variables and numeric literals in the expression have an integral
data type, it would evaluate to an int and could easily overflow as
we're multiplying seconds with 10^9.

Introduce a floating point literal into the expression to make it result
in a double.
2022-01-12 21:24:12 +01:00
Linus Groh
323e1e17cf LibJS: Fix sign data type in parse_temporal_time_zone_string()
A sign that's either the value 1 or -1 should obviously not have an
unsigned data type :^)

This would cause it to become 255 for the negative offset case, which
would then completely screw up the offset_nanoseconds calculation as it
serves as a multiplier.
2022-01-12 21:24:12 +01:00
Idan Horowitz
709fe64c1b Revert "Kernel: Use a StringView for Ext2FSDirectoryEntry::name"
This reverts commit d1d24eaef4.

I missed the fact that traverse_as_directory uses a temporary buffer,
meaning that entries created based on its callback will point to free'd
memory.
2022-01-12 21:26:03 +02:00
Marcus Nilsson
a0ba21e442 LibGUI: Print error when failing to load thumbnail in FileSystemModel
If a thumbnail cannot load it's a good opportunity to print out the
error message.
On top of that, we still want to update m_thumbnail_progress so that
the progress bar doesn't get stuck instead of returning early from
the lambda.
2022-01-12 19:44:17 +01:00
Jelle Raaijmakers
263348ff2d Taskbar: Include ScreenLayout.h from Services directory
While trying to include `Desktop.h` for the SDL2 port, compilation
failed on finding this include. Specify the full include path to make
it work.
2022-01-12 20:26:46 +02:00
Timothy Flynn
a121c913c0 LibJS: Add some Intl.DateTimeFormat tests for specific time zones
Now that we can use time zones, let's adds tests for them.
2022-01-12 15:43:12 +01:00
Timothy Flynn
d64ea13565 LibJS: Respect the user-provided time zone in Intl.DateTimeFormat
Also update some DateTimeFormat tests to explicitly set the time zone
(usually to UTC). This was already done for most tests, but some were
missed.
2022-01-12 15:43:12 +01:00
Timothy Flynn
8987deb984 LibJS: Partially implement the LocalTZA AO
Intl.DateTimeFormat will invoke this AO with isUTC=true, so this only
implements that branch in LocalTZA.
2022-01-12 15:43:12 +01:00
Timothy Flynn
f6786881aa LibJS: Implement the ECMA-402 definition of DefaultTimeZone
Simply defer to LibTimeZone to retrieve the system's current time zone.
Also update some Temporal tests to explicitly set the time zone to UTC.
2022-01-12 15:43:12 +01:00
Timothy Flynn
bdf02c21e1 LibUnicode: Swap the preferred order of standard time zone display names
Our generator is currently preferring the DST variant of the time zone
display names over the non-DST variant. LibTimeZone currently does not
have DST support, and operates in a mode that basically assumes DST does
not exist. Swap the display names for now just to be consistent until we
have DST support.

Note we will need to generate both of these variants and select the
appropriate one at runtime once we have DST support.
2022-01-12 15:43:12 +01:00