Commit graph

11606 commits

Author SHA1 Message Date
asynts
21de20825a LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
asynts
4709b700bd LibCrypto: Change [XXX]BigInteger::export_data() to use Span. 2020-07-27 19:58:09 +02:00
asynts
abe925e4b0 AK: Change the signature of AK::encode_base64() to use Span. 2020-07-27 19:58:09 +02:00
asynts
5fa0fdb219 AK: Rename Span::subspan() to Span::slice(). 2020-07-27 19:58:09 +02:00
asynts
8d2dba022e AK: Add offset() method to Span. 2020-07-27 19:58:09 +02:00
asynts
a922abd9d7 AK: Add span() / bytes() methods to container types. 2020-07-27 19:58:09 +02:00
asynts
c42450786c AK: Add implicit conversion from nullptr to Span. 2020-07-27 19:58:09 +02:00
asynts
2b57891e07 AK: Add constructors to Bytes and ReadonlyBytes that take void pointers. 2020-07-27 19:58:09 +02:00
asynts
7036a9b6f7 AK: Define conversion from Span<T> to Span<const T> correctly.
I accidently wrote `Span<RemoveConst<T>>` when I meant
`Span<RemoveConst<T>::Type>`.

Changing that wouldn't be enough though, this constructor can only be
defined if T is not const, otherwise it would redefine the copy
constructor.  This can be avoided by overloading the cast operator.
2020-07-27 19:58:09 +02:00
asynts
68cf22d580 LibCrypto: This method wrote to a const pointer. 2020-07-27 19:58:09 +02:00
Andreas Kling
7f70a6f0cb WebServer: Try to send an appopriate Content-Type header
Use Core::guess_mime_type_based_on_filename() for this. It's obviously
not perfect, but it works better than just sending "text/html" for
everything no matter what. :^)
2020-07-27 19:57:20 +02:00
Andreas Kling
78518d230c LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCore
This could be useful in more places.
2020-07-27 19:57:20 +02:00
Andreas Kling
e3437414f0 Base: Remove old ladybug icon 2020-07-27 19:57:20 +02:00
Andreas Kling
5c7d54d50d WebServer: Use table tags in directory listings
Use tables to align stuff instead of putting everything in a <pre>.
2020-07-27 19:57:20 +02:00
Andreas Kling
efa117f801 WebServer: Use urlencode() in directory listings 2020-07-27 19:57:20 +02:00
Luke
a2b40de0cc LibWeb: Add a whole bunch of HTML DOM bindings
Note that these aren't full implementations of the bindings. This
mostly implements the low hanging fruit (namely, basic reflections)

There are some attributes that should be USVString instead of
DOMString. However, USVString is a slightly different definition
of DOMString, so it should suffice for now.
2020-07-27 19:51:45 +02:00
Andreas Kling
db1b67e88a UserspaceEmulator: Set the process and thread name to "(UE) Executable"
This makes it much easier to see who's who when running multiple
emulators at the same time. :^)
2020-07-27 19:10:18 +02:00
Andreas Kling
e26c6805dd Base: Add man page about set_process_name(2) 2020-07-27 19:10:18 +02:00
Andreas Kling
b5f54d4153 Kernel+LibC: Add sys$set_process_name() for changing the process name 2020-07-27 19:10:18 +02:00
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