summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-01-01DynamicLoader: Tell the linker to not add a PT_INTERP headerAndrew Kaster
Use the GNU LD option --no-dynamic-linker. This allows uncommenting some code in the Kernel that gets upset if your ELF interpreter has its own interpreter.
2020-12-31LibGfx: Introduce provisional font interfaceStephan Unverwerth
Old font functionality has been moved into BitmapFont and an abstract Font interface has been introduced to faciliate further development of TTF font integration.
2020-12-31Everywhere: Re-format with clang-format-11Linus Groh
Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well.
2020-12-31DynamicLoader: Handle Loader.so being invoked directly as an executableWilliam Marlow
Loader.so is an actual executable, as well as the interpreter for dynamic libraries. Currently launching Loader.so as a standalone executable results in an obsucre crash as it tries to load itself over itself. Now we at least print a helpful message saying that you're doing the wrong thing and exit gracefully. In future we may wish to allow users to specify additional options to learn more about what's going on during dynamic linking, such as ld-linux.so.2 on Linux.
2020-12-30LibGFX: Move default_xxx_font() methods from Font to FontDatabaseStephan Unverwerth
When we have an abstract font class it makes no sense to keep these methods in the Font class.
2020-12-30ProtocolServer: Stream the downloaded data if possibleAnotherTest
This patchset makes ProtocolServer stream the downloads to its client (LibProtocol), and as such changes the download API; a possible download lifecycle could be as such: notation = client->server:'>', server->client:'<', pipe activity:'*' ``` > StartDownload(GET, url, headers, {}) < Response(0, fd 8) * {data, 1024b} < HeadersBecameAvailable(0, response_headers, 200) < DownloadProgress(0, 4K, 1024) * {data, 1024b} * {data, 1024b} < DownloadProgress(0, 4K, 2048) * {data, 1024b} < DownloadProgress(0, 4K, 1024) < DownloadFinished(0, true, 4K) ``` Since managing the received file descriptor is a pain, LibProtocol implements `Download::stream_into(OutputStream)`, which can be used to stream the download into any given output stream (be it a file, or memory, or writing stuff with a delay, etc.). Also, as some of the users of this API require all the downloaded data upfront, LibProtocol also implements `set_should_buffer_all_input()`, which causes the download instance to buffer all the data until the download is complete, and to call the `on_buffered_download_finish` hook.
2020-12-30pro: Add support for sending POST requests and custom headersAnotherTest
2020-12-29Userland: Make `test' accept single-digit negative numbersAnotherTest
2020-12-29Userland: Add readelf utilityBrendan Coles
2020-12-28AK/Userland: Use AK/Endian.h for portable byte swapping in ntpqueryAndrew Kaster
Create macros for the byte swap operations one would expect to be in endian.h or byteswap.h in AK/Endian.h. It's likely a similar/different change will be needed for BSDs, but there's no github action for those added to the project yet.
2020-12-27Kernel: Remove the per-process icon_id and sys$set_process_icon()Andreas Kling
This was a goofy kernel API where you could assign an icon_id (int) to a process which referred to a global shbuf with a 16x16 icon bitmap inside it. Instead of this, programs that want to display a process icon now retrieve it from the process executable instead.
2020-12-27paste: Don't read past clipboard data buffer sizeLinus Groh
ByteBuffer is not null-terminated (anymore), this is another one of those bugs. Also use the new format functions while we're here. Fixes #4558.
2020-12-26Kernel: Implement unveil() as a prefix-treeAnotherTest
Fixes #4530.
2020-12-26LibC: Fix some incorrect printf usagesSahan Fernando
2020-12-25AK: Remove custom %b format string specifierAndreas Kling
This was a non-standard specifier alias for %02x. This patch replaces all uses of it with new-style formatting functions instead.
2020-12-25LibELF: Move AuxiliaryValue into the ELF namespaceAndreas Kling
2020-12-25LibELF: Remove ELF::Loader and move everyone to ELF::ImageAndreas Kling
This commit gets rid of ELF::Loader entirely since its very ambiguous purpose was actually to load executables for the kernel, and that is now handled by the kernel itself. This patch includes some drive-by cleanup in LibDebug and CrashDaemon enabled by the fact that we no longer need to keep the ref-counted ELF::Loader around.
2020-12-24Toolchain+LibC: Fix usage of crt filesItamar
We now configure the gcc spec files to use a different crt files for static & PIE binaries. This relieves us from the need to explicitly specify the desired crt0 file in cmake scripts.
2020-12-24Loader: Support loading non-position independent executablesItamar
2020-12-24DynamicLoader: Call libc's exit when exitting, to flush standard streamsSahan Fernando
2020-12-24Userland: Make grep exit after hitting EOF on stdinSahan Fernando
2020-12-24Userland: Add strace parameter for output log fileSahan Fernando
2020-12-24Userland: Add pmap utilityBrendan Coles
2020-12-24open: Mention full URL in 'Failed to open' error messageLinus Groh
Just showing the URL's path is confusing, that would show '/' for something like foo://bar.
2020-12-24open: Handle file:// URLs properlyLinus Groh
open(1) was able to handle most URLs as well as paths, but not file:// URLs (which occur when dragging something from the output of ls, for example). We have to create an URL from the user-supplied argument using create_with_url_or_path(), check whether it's a file:// URL or not and *then* use real_path_for() on the URL's path().
2020-12-24open: Remove extraneous newline from error outputLinus Groh
This wasn't removed when fprintf was replaced by warnln.
2020-12-23cp: Don't copy the set-uid or set-gid bitsAndreas Kling
Also simplify the file copying logic a bit to avoid two syscalls per file. We now create the file with the right mode right away instead of creating it first, and then fchmod'ing it later. Fixes #4479.
2020-12-22LibCore: Rename identifiers that can clash with libc macros (#4127)ร‰rico Nogueira Rolim
POSIX allows the default streams (stdin, stdout and stderr) to be macros, which means that on such systems (musl libc is one) building Lagom will fail due to the File::std*() names. Also fix any files that use these identifiers.
2020-12-21Kernel: Improve time keeping and dramatically reduce interrupt loadTom
This implements a number of changes related to time: * If a HPET is present, it is now used only as a system timer, unless the Local APIC timer is used (in which case the HPET timer will not trigger any interrupts at all). * If a HPET is present, the current time can now be as accurate as the chip can be, independently from the system timer. We now query the HPET main counter for the current time in CPU #0's system timer interrupt, and use that as a base line. If a high precision time is queried, that base line is used in combination with quering the HPET timer directly, which should give a much more accurate time stamp at the expense of more overhead. For faster time stamps, the more coarse value based on the last interrupt will be returned. This also means that any missed interrupts should not cause the time to drift. * The default system interrupt rate is reduced to about 250 per second. * Fix calculation of Thread CPU usage by using the amount of ticks they used rather than the number of times a context switch happened. * Implement CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE and use it for most cases where precise timestamps are not needed.
2020-12-21Userland: userdel: Resolve home directory realpath before removalBrendan Coles
2020-12-21Userland: useradd: Add command line option to set user passwordBrendan Coles
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-19LibTLS+Userland: Remove all uses of ByteBuffer::slice_view()Andreas Kling
This was another way to get a non-owning ByteBuffer wrapper.
2020-12-19LibTLS+LibCrypto: Remove all remaining uses of ByteBuffer::wrap()Andreas Kling
2020-12-19LibCrypto: Yet more ByteBuffer::wrap() removal. Not much left now!Andreas Kling
2020-12-19LibTLS: Even more ByteBuffer -> Span conversionAndreas Kling
2020-12-19LibTLS+LibCrypto: More ByteBuffer -> Span conversionAndreas Kling
2020-12-19LibTLS+LibCrypto: Replace a whole bunch of ByteBuffers with SpansAndreas Kling
2020-12-19LibProtocol: Remove use of ByteBuffer::wrap() in protocol APIAndreas Kling
2020-12-17LibC: stdlib: Add clearenv() functionBrendan Coles
2020-12-16ln: Make the 'path' argument optionalAndreas Kling
If 'path' is omitted, we create a link with the basename of whatever the target is. This matches what other systems do.
2020-12-16Userland: Add beep utilityBrendan Coles
2020-12-14Loader: Don't re-load self-dependant librariesItamar
2020-12-14UserspaceEmulator: Support dynamically loaded programsItamar
When loading dynamic objects, the emulator loads the interpreter, generates an auxiliary vector and starts executing the loader. Additionally, this commits also makes the MallocTracer and backtrace symbolication work for dynamically loaded programs.
2020-12-14Loader: Take main program name from auxiliary vectorItamar
2020-12-14Loader: Stabilize loader & Use shared libraries everywhere :^)Itamar
The dynamic loader is now stable enough to be used everywhere in the system - so this commit does just that. No More .a Files, Long Live .so's!
2020-12-14Loader: Add dynamic loader programItamar
The dynamic loader exists as /usr/lib/Loader.so and is loaded by the kernel when ET_DYN programs are executed. The dynamic loader is responsible for loading the dependencies of the main program, allocating TLS storage, preparing all loaded objects for execution and finally jumping to the entry of the main program.
2020-12-14jp: Remove trailing comma at end of object/array to make output valid JSONLinus Groh
It's ironic that `jp` currently refuses to parse its own output :^)
2020-12-14jp: Only output colors when stdout is a TTYLinus Groh
2020-12-14jp: Use new format functionsLinus Groh