Commit graph

24643 commits

Author SHA1 Message Date
Timothy Flynn
98d8274040 Meta: Add LibUnicode (and its tests) to Lagom
This is primarily to allow using LibUnicode within LibJS and its REPL.

Note: this seems to be the first time that a Lagom dependency requires
generated source files. For this to work, some of Lagom's CMakeLists.txt
commands needed to be re-organized to include the CMake files that fetch
and parse UnicodeData.txt. The paths required to invoke the generator
also differ depending on what is currently building (SerenityOS vs.
Lagom as part of the Serenity build vs. a standalone Lagom build).
2021-07-26 17:03:55 +01:00
Timothy Flynn
4dda3edc9e LibUnicode: Introduce a Unicode library for interacting with UCD files
The Unicode standard publishes the Unicode Character Database (UCD) with
information about every code point, such as each code point's upper case
mapping. LibUnicode exists to download and parse UCD files at build time
and to provide accessors to that data.

As a start, LibUnicode includes upper- and lower-case code point
converters.
2021-07-26 17:03:55 +01:00
Patrick Meyer
83f88df757 Kernel: Add option to build with coverage instrumentation and KCOV
GCC and Clang allow us to inject a call to a function named
__sanitizer_cov_trace_pc on every edge. This function has to be defined
by us. By noting down the caller in that function we can trace the code
we have encountered during execution. Such information is used by
coverage guided fuzzers like AFL and LibFuzzer to determine if a new
input resulted in a new code path. This makes fuzzing much more
effective.

Additionally this adds a basic KCOV implementation. KCOV is an API that
allows user space to request the kernel to start collecting coverage
information for a given user space thread. Furthermore KCOV then exposes
the collected program counters to user space via a BlockDevice which can
be mmaped from user space.

This work is required to add effective support for fuzzing SerenityOS to
the Syzkaller syscall fuzzer. :^) :^)
2021-07-26 17:40:28 +02:00
Idan Horowitz
67b3255fe8 LibJS: Implement Temporal.PlainDate.from 2021-07-26 16:15:31 +01:00
Idan Horowitz
07485802c6 LibJS: Implement Temporal.PlainDate.compare 2021-07-26 16:15:31 +01:00
Idan Horowitz
2c6bd3a61b LibJS: Use narrower types in Temporal PlainDate/PlainDateTime/Calendar
These are bounds-checked during construction of PlainDate/PlainDateTime
and as such theres no need to widen them in these internal AO calls.
2021-07-26 16:15:31 +01:00
davidot
c5c32ad274 LibWeb: Make functions and attributes in bindings writable
This allows overwriting of for example
EventTarget.prototype.addEventListener as css3test does.
2021-07-26 15:56:15 +01:00
davidot
7a56ca1250 LibJS: Implement a naive String.prototype.localeCompare 2021-07-26 15:56:15 +01:00
davidot
e22539bdd9 LibWeb: Fix that non-member calls to window gave the wrong this_value
We treat all NativeFunctions as strict mode and thus window function
which were called in a global context (i.e. `setTimeout(f, 0)`) got a
null this_value. But we really need to treat all functions not defined
by the ECMAScript specification as non-strict. In most cases this won't
matter however since Window is also the global_object we have an extra
bit of logic.
To fix this more correctly we would need to track the strictness of
NativeFunctions.
2021-07-26 15:56:15 +01:00
davidot
a67f0cbfa2 LibWeb: Make the custom CSSDeclaration methods only work on strings
Otherwise it will try to convert it to a string later anyway. And as far
as I'm aware there are no style properties with just a number or
JavaScript symbol as name.
2021-07-26 15:56:15 +01:00
davidot
e42eaa5d95 LibWeb: Add a CustomHasProperty trait to WrapperGenerator
We immediately use this in CSSStyleDeclaration to fix that "background"
in element.style did not return true.
This is the mechanism used in css3test.com for detecting support of
features.
2021-07-26 15:56:15 +01:00
davidot
0b74cc4712 LibWeb: Convert WrapperGenerator and the generated code to east-const 2021-07-26 15:56:15 +01:00
Jamie Mansfield
3d4abd7154 KeyboardSettings: Prevent minimising the window
This matches how the new MouseSettings application works.
2021-07-26 14:56:49 +02:00
Jamie Mansfield
902559fc2d KeyboardSettings: Prevent resizing the window
This matches the other settings applications.
2021-07-26 14:56:49 +02:00
Jamie Mansfield
3129956c4e DisplaySettings: Prevent minimising the window
This matches how the new MouseSettings application works.
2021-07-26 14:56:49 +02:00
Jamie Mansfield
eb28ca2081 Spider: Improve 32x32 icon
This now matches Andreas' nice 16x16 icon :)
2021-07-26 12:41:01 +02:00
Ali Mohammad Pur
5dc6270b57 Kernel: Remove invalid '#' format modifier for printing a faulting addr
This was mistakenly added in 306d898ee5.
2021-07-26 14:12:09 +04:30
Kenneth Myhra
7a4f59f638 LibC: Declare wide character type functions in wctype.h
Declares all wide character handling functions in wctype.h. All calls
are forwarded to the corresponding character handling function in
ctype.h.

These functions are declared, but not implemented:
- iswctype
- wctype
- towctrans
- wctrans

This should also resolve a build issue with the 'sed' port getting
confused with iswprint being declared twice. Seems like it expected
more functions from wctype.h and then had a backup strategy of adding
its own wctype.h.
2021-07-26 11:36:21 +02:00
Ali Mohammad Pur
eb9c82a487 Kernel: Un-unmap-after-init CommandLine::boot_mode()
This function is now used when the kernel panics, so unmapping it would
make the kernel panic while in panic, which is not a good thing :P
2021-07-26 11:33:14 +02:00
Ali Mohammad Pur
306d898ee5 Kernel: Show the unmapped-after-init symbol being accessed
This makes it a lot easier to figure out what unmapped function is being
accessed, and a lot easier to reason about _why_ it is being accessed.
2021-07-26 11:33:14 +02:00
Brian Gianforcaro
c95ac83367 Base: Mitigations(7) add -fzero-call-used-regs and Process Protection
Update the man page to describe more mitigations that we have applied.
2021-07-26 13:08:37 +04:30
Vinicius
5e87c798d2 TextDocument: Fix indentation duplicating spaces
Auto indentation will consider only leading spaces before the cursor.
Fixes #8973.
2021-07-26 12:56:52 +04:30
Andreas Kling
7d4e3f01dd Taskbar: Unbreak application launchers in the start menu
Application launcher actions reference their applications by an index
into the global `g_apps` table. When skipping over settings apps,
we still have to increment the current app identifier.
2021-07-26 02:57:24 +02:00
Andreas Kling
689e7c28b7 Base: Make DisplaySettings have matching 16x16 and 32x32 icons 2021-07-26 02:03:29 +02:00
Andreas Kling
b6c97a259c Settings: Tweak initial window size 2021-07-26 01:58:07 +02:00
Andreas Kling
4e2c5cd19e Taskbar: Show Settings app instead of Settings app category
The Settings app is basically a viewer for the Settings app category
anyway, so let's just direct users there instead of having the various
settings apps in the start menu.
2021-07-26 01:56:33 +02:00
Andreas Kling
03040f1d10 Base: Improve 32x32 app icons for DisplaySettings and KeyboardSettings 2021-07-26 01:55:25 +02:00
Andreas Kling
1eeea5b4ae MouseSettings: Replace the scroll step size icon 2021-07-26 01:07:37 +02:00
Brian Gianforcaro
f43423edc3 Build: Only specify -fzero-call-used-regs with compiler >= GCC 11.1
This fixes the use case of using clang, or building inside CLion with
an older host compiler.
2021-07-26 01:00:36 +02:00
Linus Groh
7915994dfc LibJS: Use more narrow types in Temporal ISODateTime struct 2021-07-25 23:44:36 +01:00
Linus Groh
96e63415b6 LibJS: Implement Temporal.TimeZone.prototype.getOffsetNanosecondsFor() 2021-07-25 23:44:36 +01:00
Linus Groh
d428787e18 LibJS: Handle PlainDateTime objects in GetTemporalCalendarWithISODefault 2021-07-25 23:44:36 +01:00
Linus Groh
c1005dbb0a LibJS: Handle PlainDateTime objects ToTemporalCalendar 2021-07-25 23:44:36 +01:00
Linus Groh
1c1354db07 LibJS: Store the %Array.prototype.values% intrinsic on the global object
Also group the getter functions for all the additional intrinsics (not
generated via macros), and initialize the members.
2021-07-25 23:44:36 +01:00
Andreas Kling
50472fd69f Kernel: Don't try to return a committed page that we don't have
When we get a COW fault and discover that whoever we were COW'ing
together with has either COW'ed that page on their end (or they have
unmapped/exited) we simplify life for ourselves by clearing the COW
bit and keeping the page we already have. (No need to COW if the page
is not shared!)

The act of doing this does not return a committed page to the pool.
In fact, that committed page we had reserved for this purpose was used
up (allocated) by our COW buddy when they COW'ed the page.

This fixes a kernel panic when running TestLibCMkTemp. :^)
2021-07-26 00:39:10 +02:00
Andreas Kling
101486279f Kernel: Clear the COW bits when making an AnonymousVMObject volatile 2021-07-26 00:39:10 +02:00
Andreas Kling
87a22a77e9 Settings: Add a very simple Settings application
This is really just a launcher app that gathers all the installed apps
in the "Settings" category and presents them in a single window.
2021-07-26 00:39:10 +02:00
Andreas Kling
99f57d0a40 Base: Add descriptions to the apps in the Settings category :^) 2021-07-26 00:39:10 +02:00
Andreas Kling
89ab55b44b LibDesktop: Add an optional "Description" field to .af files 2021-07-26 00:39:10 +02:00
Andreas Kling
c17304a8f6 Base: Replace the MouseSettings app icon with something nicer :^) 2021-07-26 00:39:10 +02:00
Andreas Kling
7aed2cfc02 Kernel: Make some debug logging in Scheduler CPU agnostic 2021-07-26 00:39:10 +02:00
Andreas Kling
06104a4227 Kernel: Remove unused Scheduler::yield_from_critical() 2021-07-26 00:39:10 +02:00
Andreas Kling
cfce92f639 Kernel: Fix handful of clang-tidy warnings in Scheduler
All of them "static member accessed through instance".
2021-07-26 00:39:10 +02:00
Ali Mohammad Pur
54c54dabdd Kernel: PANIC() instead of manually halting the processor in abort() 2021-07-26 02:29:25 +04:30
Ali Mohammad Pur
6b606771b5 Kernel: Reset on panic in self-test mode
This makes a kernel panic immediately fail the on-target CI job.
Otherwise the failed job looks like a test timeout unless one digs into
the details of the job.
2021-07-26 02:29:25 +04:30
Ali Mohammad Pur
466e2a2fb7 Meta: Don't reboot on triple-fault in CI mode
Instead, just make QEMU quit immediately.
2021-07-26 02:29:25 +04:30
Andreas Kling
6a537ceef1 Kernel: Remove ContiguousVMObject, let AnonymousVMObject do the job
We don't need an entirely separate VMObject subclass to influence the
location of the physical pages.

Instead, we simply allocate enough physically contiguous memory first,
and then pass it to the AnonymousVMObject constructor that takes a span
of physical pages.
2021-07-25 18:44:47 +02:00
Andreas Kling
9a701eafc4 Kernel: Run clang-format on AnonymousVMObject.cpp 2021-07-25 18:21:59 +02:00
Andreas Kling
fb0c94ae84 WindowServer: Remove debug spam in MenuManager::refresh() 2021-07-25 18:01:24 +02:00
Andreas Kling
1fcb1ec367 LibC: Randomize malloc() block addresses on x86_64
We have a lot of address space here, let's use it. :^)
2021-07-25 18:01:24 +02:00