Commit Graph

11737 Commits

Author SHA1 Message Date
Andreas Kling
0b287c18b9 UserspaceEmulator: Implement the execve() syscall :^)
This virtual syscall works by exec'ing the UserspaceEmulator itself,
with the emulated program's provided arguments as the arguments to the
new UserspaceEmulator instance.

This means that we "follow" exec'ed programs and emulate them as well.
In the future we might want to make this an opt-in (or opt-out, idk)
behavior, but for now it's what we do.

This is really quite cool, I think! :^)
2020-07-27 19:10:18 +02:00
Andreas Kling
b9a0ba9624 LibC: Make the getpid() cache process global (instead of thread-local)
Every thread in the process will have the same PID, after all.
2020-07-27 19:10:18 +02:00
Andreas Kling
b9b74e355a UserspaceEmulator: Implement the fork() syscall :^) 2020-07-27 19:10:18 +02:00
Andreas Kling
7bb6b1d44d LibGfx: Fix dumb typo in PNG decoder
'=' is not the same as '*', indeed.
2020-07-27 19:10:18 +02:00
Andreas Kling
9f752ce1f6 top: Don't print more lines than the terminal can fit 2020-07-27 17:04:47 +02:00
Andreas Kling
b6e29656a1 top: Limit printed process name characters to the available space
It looks much nicer if we don't break the line. You can resize the
terminal if you want to see the full process name.
2020-07-27 17:01:20 +02:00
Andreas Kling
417e3877d7 top: Tweak username column width to accomodate "clipboard" 2020-07-27 16:52:36 +02:00
Andreas Kling
0b1a40a6fe LibGfx: Simplify some excessive use of pow() in scanline unfiltering 2020-07-27 16:40:12 +02:00
Andreas Kling
d9f933df7b UserspaceEmulator: Implement the setuid() and setgid() syscalls
Note that running a setuid program (e.g /bin/ping) in UE does not
actually run uid=0. You'll have to run UE itself as uid=0 if you want
to test programs that do setuid/setgid.
2020-07-27 16:32:30 +02:00
Andreas Kling
368cea4094 UserspaceEmulator: Implement the accept() and setsockopt() syscalls
It's now possible to run LookupServer in UE (by setting up SystemServer
to run the service inside UE.) No bugs found, but very cool! :^)
2020-07-27 16:28:40 +02:00
Andreas Kling
f097ed6ada UserspaceEmulator: Transfer the environment to the emulated process 2020-07-27 15:57:12 +02:00
Andreas Kling
1366557094 AK+LibC: Always use REP MOVSB/STOSB for memcpy()/memset()
There's no great advantage to using MMX instructions here on modern
processors, since REP MOVSB/STOSB are optimized in microcode anyway
and tend to run much faster than MMX/SSE/AVX variants.

This also makes it much easier to implement high-level emulation of
memcpy/memset in UserspaceEmulator once we get there. :^)
2020-07-27 15:54:39 +02:00
Andreas Kling
272dbb82ff UserspaceEmulator: Mark SimpleRegions as initialized up front for now
This prevents some false positives since the initial stack is expected
to be zero-initialized.
2020-07-27 13:40:36 +02:00
Andreas Kling
31b94114c0 UserspaceEmulator: Recognize xor/sub zeroing idioms and don't taint
"xor reg,reg" or "sub reg,reg" both zero out the register, which means
we know for sure the result is 0. So mark the value as initialized,
and make sure we don't taint the CPU flags.

This removes some false positives from the uninitialized memory use
detection mechanism.

Fixes #2850.
2020-07-27 13:20:23 +02:00
AnotherTest
f8becd4df8 Eyes: Fix division by zero when invoked as 'Eyes' 2020-07-27 12:57:27 +02:00
AnotherTest
2c6a983b34 Eyes: Allow constructing an eye-grid
Because a line of eyes is just not impressive enough.
This does not change any of the default behaviours except breaking the
line of eyes at 13 eyes (the 'sweet spot' for the default resolution)
2020-07-27 12:30:57 +02:00
Nico Weber
9ee1edae2a CppLexer: Support raw string literals
Handles prefixes and delimiters (`R"(text)", `u8R"f(text)f"`, ...).
2020-07-27 12:11:19 +02:00
Nico Weber
4d783338c1 CppLexer: Support L, u, u8, U prefixes on string and char literals 2020-07-27 12:11:19 +02:00
Nico Weber
34dc163441 CppLexer: Correctly highlight hex escapes in string and char literals
\x consumes all hex digits following it. (If the resulting number
then doesn't fit in the character type, the compiler emits an
error.)

\x would be much more convenient to use if it was always followed
by exactly two hex digits (with \u and \U for higher codepoints),
but that's sadly not the world we live in.
2020-07-27 12:11:04 +02:00
Nico Weber
c1b7fd644c CppLexer: Support \U escapes in addition to \u escapes 2020-07-27 12:10:46 +02:00
AnotherTest
58308748cb Shell: Ignore leading semicolons
This makes things like `foo&; bar` behave as expected.
Such behaviour is actually closer to the grammar defined in Parser.h
anyway :P
2020-07-27 12:10:29 +02:00
Matthew Olsson
335916d8db LibGfx: Templatize Point, Size, and Rect 2020-07-27 01:06:26 +02:00
Nico Weber
7a1c328417 CppLexer: Add token types for "::", "::*", ".*", "->*" 2020-07-27 01:04:17 +02:00
Nico Weber
1992dbd637 CppLexer: Add token types for ".", "->" 2020-07-27 01:04:17 +02:00
Nico Weber
95113d15fe CppLexer: Add token types for "!", "!=", "~", "?", ":" 2020-07-27 01:04:17 +02:00
Nico Weber
29bc978564 CppLexer: Add token types for "^", "^=" 2020-07-27 01:04:17 +02:00
Nico Weber
c38b8d63f8 CppLexer: Add token types for "++", "--" 2020-07-27 01:04:17 +02:00
Nico Weber
598b5e4595 CppLexer: Add token types for "&", "&&", "&=", "|", "||", "|=" 2020-07-27 01:04:17 +02:00
Nico Weber
345b303262 CppLexer: Add token types for ">", ">=", ">>", ">>=" 2020-07-27 01:04:17 +02:00
Nico Weber
97c4344f33 CppLexer: Add token types for "<", "<=", "<<", "<<=", "<>" 2020-07-27 01:04:17 +02:00
Andreas Kling
23082e528f Kernel: Support file-backed mmap() with non-zero offset
As it turns out, this works just fine and all we had to do was remove
the assertion! :^)

Fixes #2597.
2020-07-27 00:31:24 +02:00
Itamar
240eb3242a LibDebug: Add support for the various DW_FORM_block types
This fixes #2885.
2020-07-27 00:06:47 +02:00
Peter Elliott
52ab2cead4 Meta: Cache ccache on travis-ci 2020-07-27 00:06:24 +02:00
thankyouverycool
3e10c38837 Base: Add characters to default fonts
Updates the Extended-A block for Katica and Csilla. Corrects some
heights, accents and capitalizations. Slims the 'A', 'C', and 'G'
in CsillaThin.
2020-07-27 00:05:20 +02:00
Andreas Kling
1f008c95b6 LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
Andreas Kling
3e389f4cdc LibGUI: Remove accidentally committed file :^) 2020-07-26 20:05:15 +02:00
Andreas Kling
11ff9d0f17 LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
2020-07-26 20:05:15 +02:00
Nico Weber
96d13f75cf CppLexer: Add token types for "+", "+=", "-", "-=", "=", "==", "/", "/="
Mostly so that TextEdit doesn't emit logspam when I write `int a = 4`
in a test program.
2020-07-26 19:52:26 +02:00
Nico Weber
5a36d8acb8 CppLexer: Add token type for "*=" 2020-07-26 19:52:26 +02:00
Estanislao Pérez Nartallo
b09b8d99f2 Userland: Add Spanish keymap 2020-07-26 18:34:29 +02:00
Andreas Kling
eabd43d31a LibWeb: Make SVGElement and SVGGeometryElement constructors protected 2020-07-26 17:51:00 +02:00
Andreas Kling
1b1537c5a6 LibWeb: Simplify type traits for SVGGraphicsElement 2020-07-26 17:51:00 +02:00
Andreas Kling
e0b8b4ac67 LibCore+LibGUI: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
71556e39a4 LibWeb: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
fe6474e692 Kernel: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
ce2c5b375c AK: Add global is<T>() and downcast<T>()
Let's unify the is<T>/to<T> implementations that currently exist in
separate versions in LibCore and LibWeb.
2020-07-26 17:51:00 +02:00
Andreas Kling
a565121793 LibWeb: Move HTML object model stuff into LibWeb/HTML/
Take a hint from SVG and more all the HTML classes into HTML instead of
mixing them with the DOM classes.
2020-07-26 17:51:00 +02:00
Paul Scharnofske
fbc54a2dba Documentation: Only install missing packages for Arch Linux.
By default `pacman -S` will reinstall all the packages that are already installed on the system.
2020-07-26 17:48:24 +02:00
asynts
707d92db61 Refactor: Change the AK::binary_search signature to use AK::Span. 2020-07-26 16:49:06 +02:00
asynts
ac9c2bc492 AK: Implement Span which represents a contiguous sequence of objects.
This makes it possible to pass one object rather than pointer and length
individually.
2020-07-26 16:49:06 +02:00