Commit Graph

34311 Commits

Author SHA1 Message Date
brapru
75a3be852d ping: Count argument must be greater than zero
Previously, when passing 0 as a count number to the ping utility it
would ping the specified host indefinitely. This is obviously not the
intended behavior, so forcing the count to be in the range of 1 <= value
<= UINT32_MAX resolves the issue.
2022-02-14 12:48:43 +01:00
brapru
ef3605604e ping: Fix off by one error in count argument
Previously, the count and total_pings comparison was evaluated after a
ping was sent for that iteration. This would cause one extra ping to be
sent greater than the specific count passed.
2022-02-14 12:48:43 +01:00
czapek1337
6cdb41ccab Documentation: Add information about the limine-image target 2022-02-14 11:52:07 +01:00
czapek1337
7b919c9d93 Meta: Bump Limine version to 2.78.2 2022-02-14 11:52:07 +01:00
czapek1337
77f25e44ed Meta: Include the EFI executable in Limine image 2022-02-14 11:52:07 +01:00
czapek1337
64ff8af074 Meta: Add support for the Limine bootloader 2022-02-14 11:52:07 +01:00
Mustafa Quraish
c3e4123ed7 PixelPaint: Change menu shortcut for "Fit Image to View"
This makes it consistent with `ImageViewer`, where `F` was unavailable
for use as a shortcut. A small change, but it's nice having the same
keyboard shortcuts where we can :^)
2022-02-14 11:49:21 +01:00
Mustafa Quraish
4556b8e943 ImageViewer: Add "Fit Image to View" action
This is analogous to PixelPaint, it resizes the image so that it fits
in the view (with some padding).
2022-02-14 11:49:21 +01:00
Mustafa Quraish
481ed1ca16 ImageViewer: Fix window resizing on first image
The logic in place for this no longer worked since we abstracted away
the logic for zooming / panning (which changed how scale is stored).
This commit fixes the behaviour so when the first image is opened, the
window resizes to fit it.
2022-02-14 11:49:21 +01:00
Mustafa Quraish
5c763e9832 LibGUI+PixelPaint: Move fit_image_to_view to AbstractZoomPanWidget
We often want to zoom and fit the content of the widget into the
visible frame (or some rect within the frame), and it makes sense to
move this functionality into the AbstractZoomPanWidget to minimize
the amount of coordinate math derived classes need to do.

This commit moves the code that implements this functionality from
`PixelPaint::ImageEditor` into `AbstractZoomPanWidget` so that we
can also use it for other applications (such as ImageViewer!)
2022-02-14 11:49:21 +01:00
Pankaj Raghav
12daecf72d Utilities: Fix du to print stats for regular files
du <filename> will not print anything until `-a` option was provided.

Fix the behaviour by taking into account the `-a` option only when a
directory is given as the input.
2022-02-14 11:47:52 +01:00
brapru
b04528c0de nc: Extend TCP listening port functionality
Previously the nc implementation during listening mode would only accept
a single client and close the listening file description immediately.
Additionally, it did not have support for read/write handling of the
accepted client.

This patch extends the functionality of nc's listening capability by
allowing multiple client connections over TCP. Clients/server are able
to pass data back and forth between the connection.

Being able to listen on sockets and accept connections is helpful for
debugging the networking stack.
2022-02-14 11:47:14 +01:00
sin-ack
528af7def7 LibCore: Remove Core::Socket :^)
This class is one of the last users of Core::IODevice and is no longer
used itself.
2022-02-14 11:44:09 +01:00
sin-ack
72ef1d7c06 SystemServer: Remove Socket.h header + use Core::System in some places
Various Core::System functions are still missing so not all raw syscalls
were converted just yet.
2022-02-14 11:44:09 +01:00
sin-ack
37658e6fa6 LibCore: Implement System::fchown 2022-02-14 11:44:09 +01:00
sin-ack
285b2fba96 LibCore+Tests: Remove Core::UDPSocket :^) 2022-02-14 11:44:09 +01:00
sin-ack
11a2e31306 nc: Convert to Core::Stream::UDPSocket 2022-02-14 11:44:09 +01:00
sin-ack
4ca0669d1e LookupServer: Convert to Core::Stream::UDPSocket 2022-02-14 11:44:09 +01:00
sin-ack
17d3592cab LibCore: Add a timeout option to UDPSocket::connect
This allows us to set a timeout during connection and during receive and
send operations. I didn't add this to the other connect calls as it's
not used anywhere else for the time being.
2022-02-14 11:44:09 +01:00
Sviatoslav Peleshko
a666140a68 LibCoredump: Respect coredump's LD_LIBRARY_PATH when searching libraries
Previously, we would only resolve libraries from `/usr/lib`, which is
not the only path from which the crashed process could've loaded the
libraries from.
2022-02-14 11:42:19 +01:00
Federico Guerinoni
334ed9225a HexEditor: Fix copy {text/hex} to clipboard
Now the copy action takes exactly the selected chars and not one more.
2022-02-14 11:42:04 +01:00
Federico Guerinoni
932ce93fd7 HexEditor: Fix crash of copy action when selection is empty
Closes: #11925
2022-02-14 11:42:04 +01:00
Vitaly Dyachkov
53ff271c6f WindowServer: Consolidate tiled and maximized window rects calculation
Calculating tiled and miximized window frame have a lot in common. In
fact, we can look at maximized window state as a special case of the
tile type. It simplifies the code since there is a lot of cases when
we take an action only if the window is maximized or tiled.
2022-02-14 11:41:06 +01:00
Joe Petrus
06e33788ea Ports: Add ImageMagick 2022-02-14 11:40:06 +01:00
Liav A
10178dc939 Kernel/Audio: Ignore buffers with more than 4096 bytes of data in SB16
The SB16 card driver doesn't swallow more than 4096 bytes of data at
once, so instead of asserting just return ENOSPC for now.

To test this, either play normal sound or just this (very!) loud noise:

dd if=/dev/random of=/dev/audio/0 bs=4096
2022-02-14 11:39:19 +01:00
Liav A
bf8c93fe0a AudioServer: Use first audio channel in the /dev/audio directory
For now, just use the first audio channel in the /dev/audio directory.
In the future we can add support for watching and loading other channels
so we can route audio to multiple sound cards on the system.
2022-02-14 11:39:19 +01:00
Liav A
a1f3a48ed5 SystemServer: Create audio channel device nodes in /dev/audio directory 2022-02-14 11:39:19 +01:00
Liav A
6efa27537a Kernel/Audio: Introduce a new design architecture for the subsystem
We have 3 new components:
1. The AudioManagement singleton. This class like in other subsystems,
is responsible to find hardware audio controllers and keep a reference
to them.
2. AudioController class - this class is the parent class for hardware
controllers like the Sound Blaster 16 or Intel 82801AA (AC97). For now,
this class has simple interface for getting and controlling sample rate
of audio channels, as well a write interface for specific audio channel
but not reading from it. One AudioController object might have multiple
AudioChannel "child" objects to hold with reference counting.
3. AudioChannel class - this is based on the CharacterDevice class, and
represents hardware PCM audio channel. It facilitates an ioctl interface
which should be consistent across all supported hardware currently.
It has a weak reference to a parent AudioController, and when trying to
write to a channel, it redirects the data to the parent AudioController.
Each audio channel device should be added into a new directory under the
/dev filesystem called "audio".
2022-02-14 11:39:19 +01:00
Jakub Berkop
6218ec8afa profile: Document "read" profiling event 2022-02-14 11:38:13 +01:00
Jakub Berkop
cdfb388154 Profiler: Add ability to process read syscalls
Profiler can now process and display read events.
2022-02-14 11:38:13 +01:00
Jakub Berkop
fae991f599 profile: Command recognizes "read" event type 2022-02-14 11:38:13 +01:00
Jakub Berkop
4916c892b2 Kernel/Profiling: Add profiling to read syscall
Syscalls to read can now be profiled, allowing us to monitor
filesystem usage by different applications.
2022-02-14 11:38:13 +01:00
Idan Horowitz
bd821982e0 Kernel: Use StringView::for_each_split_view() in sys$pledge
This let's us avoid the fallible Vector allocation that split_view()
entails.
2022-02-14 11:35:20 +01:00
Idan Horowitz
e37e4a7980 Kernel: Make Inode::set_shared_vmobject() OOM-fallible
Allocating a WeakPtr can fail, so this let's us properly propagate said
failure.
2022-02-14 11:35:20 +01:00
Idan Horowitz
c620f18d8c Kernel: Evaluate block conditions only once on new mouse packets
Since we're in an IRQ each of these evaluate_block_conditions() calls
enqueues a new deferred call, so to save on some space in the deferred
call queue let's just do it once.
2022-02-14 11:35:20 +01:00
Idan Horowitz
e384f62ee2 Kernel: Make master TLS region WeakPtr construction OOM-fallible 2022-02-14 11:35:20 +01:00
Luke Wilde
b305ee8692 LibWeb: Add support for the record variant of URLSearchParams 2022-02-14 11:32:17 +01:00
Luke Wilde
b7c435de17 LibWeb: Add support for record<K, V> types as input 2022-02-14 11:32:17 +01:00
Ali Mohammad Pur
3b04693d7e js: Add a print() function to the environment
It's really annoying to write `console.log(JSON.stringify(something))`
in scripts, and the output is less than easily readable.
This exposes the existing `print(Value)` function into the JS world, and
allows us to write `print(something)` and get a neat representation in
the console.
2022-02-14 11:30:50 +01:00
Ali Mohammad Pur
3b0943d24c LibRegex: Correct the alternative matching order when one is empty
Previously we were compiling `/a|/` into what effectively would be
`/|a`, which is clearly incorrect.
2022-02-14 11:30:50 +01:00
Andrew Kaster
76e99fa6c8 Toolchain: Update Dockerfile to use gcc 11 and add texinfo package
Missed this in the gcc 11 version update, but if anyone is using this
then they'll need gcc 11 to build Lagom.
2022-02-14 12:52:06 +03:30
Karol Kosek
c157c2148f LibWeb: Don't emit current token on EOF in HTML Tokenizer
Emitting tokens on EOF caused an infinite loop, freezing the app, which
could be a bit annoying when writing an HTML comment at the end of
the file in Text Editor. :^)
2022-02-14 12:50:44 +03:30
Karol Kosek
fb5e2670d6 LibWeb: Fix highlighting HTML comments
Commit b193351a99 caused the HTML comments to flash when changing
the text cursor. Also, when double-clicking on a comment, the selection
started from the beginning of the file instead.

The following message was displaying when `TOKENIZER_TRACE_DEBUG`
was enabled:

    (Tokenizer::nth_last_position) Invalid position requested: 4th-last
    of 4. Returning (0-0).

Changing the `nth_last_position` to 3 fixes this. I'm guessing that's
because the parser is at that moment on the second hyphen of the `<!--`
string, so it has to go back only by three characters.
2022-02-14 12:50:44 +03:30
kleines Filmröllchen
704bb361bb LibCore: Allow event loops on other threads to wake up
Because the wake pipe is thread-local, it was previously not possible
to wake an event loop across a thread. Therefore, this commit
rearchitects event loop waking by making the wake function a member of
the event loop itself and having it keep a pointer to its thread's wake
pipe. The global wake() function calls wake on the current thread's
event loop.

This also fixes a bug in BackgroundAction: it should wake the event loop
it was created on, instead of the current thread's event loop.
2022-02-13 23:06:53 +01:00
kleines Filmröllchen
716a3429fa LibCore: Fix event loop stacks on non-main threads
Previously, event loop stacks on non-main threads would always crash
because the condition for "am I the lowest-stacked loop" was still
"am I the main loop", which of course is no longer sensible. A simple
switch to `is_instantiated` fixes this.
2022-02-13 23:06:53 +01:00
brapru
93496af02b LibVT: Fix triple click behavior
When triple clicking a line in the terminal the selection will span the
whole line. However, after dragging down to lines above/below the
selection will stop at the cursor.

Instead, the expected functionality of triple clicking and dragging is
to select the whole line and any whole lines dragged to after the triple
click.

Previously, the triple line counter would get reset as soon as the whole
line was selected. This patch resets the m_triple_click_timer in the
mouse up event, so that the triple click selecting functionality is
maintained during the entire click event and terminated when the event
is over.
2022-02-13 23:05:39 +01:00
Idan Horowitz
197ebe3433 Kernel: Remove dead code from ThreadSafeWeakPtr
This is a Kernel-only header, so any #ifndef KERNEL code is essentially
dead.
2022-02-13 23:02:57 +01:00
Idan Horowitz
b32cf33a23 Kernel: Remove make_weak_ptr()
New users of WeakPtr in the kernel should use try_make_weak_ptr instead
2022-02-13 23:02:57 +01:00
Idan Horowitz
c8ab7bde3b Kernel: Use try_make_weak_ptr() instead of make_weak_ptr() 2022-02-13 23:02:57 +01:00
Idan Horowitz
98c20b65cc AK+Kernel: Add an OOM-fallible try variant make_weak_ptr()
This will allow us to propagate allocation errors that may be raised by
the construction of the WeakLink.
2022-02-13 23:02:57 +01:00