Commit Graph

33544 Commits

Author SHA1 Message Date
Lady Gegga
dce3020edb Base: Add some Alphabetic Presentation Forms to font Katica Regular 10
FB00-FB06 https://www.unicode.org/charts/PDF/UFB00.pdf
2022-01-27 03:39:39 +00:00
Lady Gegga
f32cc29a3d Base: Add some Alphabetic Presentation Forms to font Tiny Regular 6
FB00-FB02, FB05-FB06
https://www.unicode.org/charts/PDF/UFB00.pdf
2022-01-27 03:39:39 +00:00
thankyouverycool
7beea36052 LibGUI+LoginServer: Use default buttons in InputBox and LoginWindow 2022-01-26 23:19:54 +01:00
thankyouverycool
f77ac3a73c LibGUI: Allow Buttons to set themselves as default
Several apps were implementing this behavior ad hoc. This provides
a standard API as well as a comfy visual cue for default return key
behavior.
2022-01-26 23:19:54 +01:00
thankyouverycool
aefe3ef539 LibGUI: Allow Windows to set a default return key widget
The default return key widget takes precendence when dispatching
return key events with the exception of focused buttons.
2022-01-26 23:19:54 +01:00
Idan Horowitz
ac4583660b Kernel: Make VirtIO::ConsolePort construction OOM-fallible 2022-01-26 22:07:01 +00:00
Idan Horowitz
94a39db31d Kernel: Add try_create_device overload for static factory functions
This makes sure DeviceManagement::try_create_device will call the
static factory function (if available) instead of directly calling the
constructor, which will allow us to move OOM-fallible calls out of
Device constructors.
2022-01-26 22:07:01 +00:00
Idan Horowitz
9259bce34e Kernel: Remove unimplemented is_device_event_queue_ready_to_read method 2022-01-26 22:07:01 +00:00
Idan Horowitz
e729c3ae36 Kernel: Add missing nothrow tag to DeviceManagement::try_create_device
Without this tag this method was essentially a must_create.
2022-01-26 22:07:01 +00:00
Idan Horowitz
a0f404551e Kernel: Ignore allocation failures during thread finalization
We ignore allocation failures above the first 32 guaranteed thread
slots, and just flag our future-selves to finalize these threads at a
later point.
2022-01-26 22:05:34 +00:00
Idan Horowitz
7e9df6ddba Kernel: Remove always-false Thread::drop_thread_count boolean parameter 2022-01-26 22:05:34 +00:00
Idan Horowitz
1e941fc3cc Kernel: Make VirtualRangeAllocator::carve_from_region OOM-fallible 2022-01-26 22:05:34 +00:00
Idan Horowitz
85437abfad Kernel: Support try-inserting RedBlackTree entry values by reference 2022-01-26 22:05:34 +00:00
Linus Groh
8aa723d159 Base: Update possible values for ahci_reset_mode kernel boot option
- `controller` is now called `controllers`
- `complete` is now called `aggressive`
- `none` is no longer a recognized value
2022-01-26 21:34:26 +00:00
Linus Groh
c05feaaa74 Kernel/Storage: Dump detected devices and partitions before PANIC()'ing
If we panic the kernel for a storage-related reason, we might as well be
helpful and print out a list of detected storage devices and their
partitions to help with debugging.

Reasons for such a panic include:
- No boot device with the given name found
- No boot device with the given UUID found
- Failing to open the root filesystem after determining a boot device
2022-01-26 21:34:26 +00:00
Linus Groh
d8fb3290d5 Kernel/Storage: Add device null check in AHCIPort::handle_interrupt()
Before attempting to remove the device while handling an AHCI port
interrupt, check if m_connected_device is even non-null.
This happened during my bare metal run and caused a kernel panic.
2022-01-26 21:34:26 +00:00
Jesse Buhagiar
371d49c0f6 LibGL: Implement glMateriali{v} 2022-01-26 16:44:11 +01:00
Jesse Buhagiar
170739fe39 LibGL: Implement glLighti{v} 2022-01-26 16:44:11 +01:00
Jesse Buhagiar
f885e01875 LibGL: Correctly set scene ambient in glLightModelfv
This was only passing in the `R` value to the scene's ambient color,
which is incorrect.
2022-01-26 16:44:11 +01:00
Jesse Buhagiar
909ec41196 LibGL: Implement glLightModeliv 2022-01-26 16:44:11 +01:00
Jesse Buhagiar
68e50759b4 LibGL: Implement glGetMaterial 2022-01-26 16:44:11 +01:00
Jesse Buhagiar
f5cde1b6fb LibGL: Implement glGetLight 2022-01-26 16:44:11 +01:00
Timothy Flynn
f657362fda LibEDID: Do not check if ${PNP_IDS_EXPORT_PATH} exists in pnp_ids.cmake
This check isn't needed because download_file() will check if it exists
already before doing the download. Worse, it would prevent the generator
target from being defined if the file existed, which then made CMake not
realize the generated files were important and delete them.
2022-01-26 16:37:38 +01:00
Timothy Flynn
e092f1614c LibEDID: Rename the downloaded PNP IDs file
After fixing the CMake file to use the correct paths, users may have had
to manually remove the existing downloaded pnp.ids.html for CMake to re-
run the generator. So this change renames the downloaded file to
pnp_ids.html to ensure everyone picks up that change without manual
intervention.
2022-01-26 16:37:38 +01:00
Timothy Flynn
99c8dadcec LibEDID: Use correct paths for LibEDID generated files
Code generators that generate their files for both Lagom and Serenity
have a blob in their CMake file like this:

    set(TIME_ZONE_DATA_HEADER LibTimeZone/TimeZoneData.h)
    set(TIME_ZONE_DATA_IMPLEMENTATION LibTimeZone/TimeZoneData.cpp)
    set(TIME_ZONE_META_TARGET_PREFIX LibTimeZone_)

    if (CMAKE_CURRENT_BINARY_DIR MATCHES ".*/LibTimeZone")
        # Serenity build.
        set(TIME_ZONE_DATA_HEADER TimeZoneData.h)
        set(TIME_ZONE_DATA_IMPLEMENTATION TimeZoneData.cpp)
        set(TIME_ZONE_META_TARGET_PREFIX "")
    endif()

LibEDID generates files only for Serenity, but was using the Lagom build
version of the _HEADER, _IMPLEMENTATION, and _PREFIX variables. Thus if
pnp_ids.cmake was ever touched, the following error would be raised:

    Userland/Libraries/LibEDID/EDID.cpp:18:18: fatal error:
    LibEDID/PnpIDs.h: No such file or directory
        18 | #        include <LibEDID/LibEDID/PnpIDs.h>

Use the Serenity paths in pnp_ids.cmake and in the #include within
LibEDID itself.
2022-01-26 16:37:38 +01:00
Brian Gianforcaro
1422187427 Kernel: Add tracing to help catch thread blocking with incorrect state
A number of crashes in this `VERIFY_NOT_REACHED` case have been
reported on discord. Lets add some tracing to gather more information
and help diagnose what is the cause of these crashes.
2022-01-26 16:44:50 +02:00
Brian Gianforcaro
e954b4bdd4 Kernel: Return error from sys$execve() when called with zero arguments
There are many assumptions in the stack that argc is not zero, and
argv[0] points to a valid string. The recent pwnkit exploit on Linux
was able to exploit this assumption in the `pkexec` utility
(a SUID-root binary) to escalate from any user to root.

By convention `execve(..)` should always be called with at least one
valid argument, so lets enforce that semantic to harden the system
against vulnerabilities like pwnkit.

Reference: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
2022-01-26 13:05:59 +01:00
Tom
4383b26faa Kernel: Enable Write-Combine for FramebufferDevice
This enables much faster writing to the userspace mapped framebuffer,
if supported by the hardware.
2022-01-26 09:21:04 +02:00
Tom
6e46e21c42 Kernel: Implement Page Attribute Table (PAT) support and Write-Combine
This allows us to enable Write-Combine on e.g. framebuffers,
significantly improving performance on bare metal.

To keep things simple we right now only use one of up to three bits
(bit 7 in the PTE), which maps to the PA4 entry in the PAT MSR, which
we set to the Write-Combine mode on each CPU at boot time.
2022-01-26 09:21:04 +02:00
Idan Horowitz
1abbe9b02c Kernel: Ignore allocation failures when appending threads to coredump
We shouldn't panic due to a failure in coredump generation
2022-01-26 02:37:03 +02:00
Idan Horowitz
d1433c35b0 Kernel: Handle OOM failures in find_shebang_interpreter_for_executable 2022-01-26 02:37:03 +02:00
Idan Horowitz
8cf0e4a5e4 Kernel: Eliminate allocations from generate_auxiliary_vector 2022-01-26 02:37:03 +02:00
Idan Horowitz
a6f0ab358a Kernel: Make AddressSpace::find_regions_intersecting OOM-fallible 2022-01-26 02:37:03 +02:00
Idan Horowitz
dab73d6d23 Kernel: Make pledge serialization in /proc/all generation OOM-fallible 2022-01-26 02:37:03 +02:00
Idan Horowitz
e23d320bb9 Kernel: Fail gracefully due to OOM on HashTable set in sys$setgroups 2022-01-26 02:37:03 +02:00
Idan Horowitz
a9cd8ca841 Kernel: Make Inode::register_watcher() OOM-fallible 2022-01-26 02:37:03 +02:00
Idan Horowitz
87bd930e7e Kernel: Make InodeWatcher inode registration completely OOM-fallible
InodeWatcher::register_inode was already partially fallible, but the
insertion of the inodes and watch descriptions into their respective
hash maps was not. Note that we cannot simply TRY the insertion into
both, as that could result in an inconsistent state, instead we must
remove the inode from the inode hash map if the insertion into the
watch description hash map failed.
2022-01-26 02:37:03 +02:00
Idan Horowitz
bd603003b5 Kernel: Make AddressSpace::amount_clean_inode() OOM-fallible 2022-01-26 02:37:03 +02:00
Idan Horowitz
daf6b59a01 Kernel: Make StorageDevice partial block writes OOM-fallible 2022-01-26 02:37:03 +02:00
Timothy Flynn
6f8e89a905 Meta: Download USB and PCI ID data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn
e2bcf5fafd Meta: Download PNP ID data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn
931302c500 Meta: Download TZDB data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn
c7ef86f5d9 Meta: Download UCD and CLDR data with fallible download function 2022-01-26 00:22:53 +00:00
Timothy Flynn
e805fce46e Meta: Add a CMake function to download remote files during the build
This function will handle download failures. It doesn't support hashing
for integrity yet, but if the download times out or otherwise fails, the
build itself will fail. But default, file(DOWNLOAD) in CMake doesn't
fail the build; we must pass in and check a STATUS variable.
2022-01-26 00:22:53 +00:00
davidot
b40308d0a4 Tests+LibJS: Add very simple bytecode LibJS tests
These tests are not meant as a replacement to test-js with the -b option
but are meant to test simple cases until that works.
Before this it was very easy to accidentally break bytecode since no
tests were run in bytecode mode. This hopefully makes it easier to spot
such regressions :^).
2022-01-25 23:26:14 +00:00
davidot
f06e7dd13f Meta: Fix my .mailmap entry by adding the name 2022-01-25 23:26:14 +00:00
Valtteri Koskivuori
7a537ad08f WindowServer: Rename default_positioned() -> is_default_positioned()
Tiny change, but it really bothered me that this was the only function
not named like the rest.
2022-01-25 23:22:10 +00:00
Timothy Flynn
82509ca0c8 date: Display time zone information in all output formats 2022-01-25 23:21:30 +00:00
Timothy Flynn
29c8ec5eb6 LibCore: Support (and use) DateTime string formatting of the form %Z
This formats the time zone name. This is now used in the default format
string because DateTime is meant to represent local time; it only makes
sense to include the time zone by default now that we support non-UTC.
2022-01-25 23:21:30 +00:00
Timothy Flynn
9605be19bb LibCore: Support DateTime string formatting of the form %:z
This formats the time zone offset as "+hh:mm" or "-hh:mm". This doesn't
appear to be strictly POSIX, but it is how Linux implements this format.
2022-01-25 23:21:30 +00:00