Commit graph

18092 commits

Author SHA1 Message Date
Andreas Kling
d0072aef8b LibCore: Make Core::Object::event() protected 2021-03-28 11:24:22 +02:00
Andreas Kling
6f45c27d06 WindowServer: Don't call Core::Object::event() directly
To make sure event filters are respected, we should not be calling
event() directly, but rather dispatch_event().
2021-03-28 11:19:18 +02:00
Andreas Kling
54c7110d9d LibCore: Add a way to install an event filter on a Core::Object
The event filter is consulted by Object::dispatch_event() and may
decide that the event should not be delivered to the target object.
2021-03-28 11:19:18 +02:00
Andreas Kling
c91bb72964 LibC: Add vfork() as a simple wrapper around fork()
I don't know if we should implement optimized vfork(). I'm adding it
here since SDL2 uses it.
2021-03-28 00:05:29 +01:00
lucastarche
17b7779271 Chess: Added option to toggle showing moves 2021-03-27 23:37:06 +01:00
lucastarche
42f7f9d0f8 Chess: Show available moves from current piece 2021-03-27 23:37:06 +01:00
Andreas Kling
52ce7ed842 Ports: Switch to new SDL2 port
I've rebased the SDL2 port on top of the latest SDL2 main branch.
This patch simply points the SDL2 port scripts to the new branch.
2021-03-27 22:57:08 +01:00
Idan Horowitz
1ac661515e LibArchive: Bounds check header offsets in Zip Parser
Since the central directory offset in the end of central directory
record and the local file offset in each central directory header
are user-controlled arbitary data, we have to bounds check them
before using them.
2021-03-27 19:44:16 +01:00
Roi
f046654477 Base: Update modunload path
The file `modunload.md` has moved to `man8`
2021-03-27 19:43:58 +01:00
Linus Groh
e8aa998cdc LibGUI: Return symlink fallback icon if target icon cannot be determined
This is the case for symlinks that point to themselves, for example -
previously the returned icon would be empty.

Fixes #5978.
Fixes #5979.
2021-03-27 19:43:36 +01:00
Jelle Raaijmakers
9c141d0a87 Ports: Add SQLite 2021-03-27 19:43:14 +01:00
Jelle Raaijmakers
2fb3c98429 LibC: Define F_GETLK 2021-03-27 19:43:14 +01:00
Idan Horowitz
ff32002f2b Utilities: Add gzip utility
This is a small utility that is similar to gunzip but is used
for compression instead of decompression.
2021-03-27 19:30:42 +01:00
Linus Groh
9734420dfa Browser: Set parent of tab child windows
By setting the parent of the JS console, DOM inspector, view source and
download windows, they will be destroyed automatically when the main
browser window is closed.

Fixes #2373.
2021-03-27 19:24:40 +01:00
cheb
daf85fb07b Utilities: Add a delay option to the "shot" utility
This option allows for the user to set a delay before a screenshot taken.
The user could minimize the window, for example.
2021-03-27 19:24:01 +01:00
Brendan Coles
5331ae0e93 Base: man pages: document arguments, fix typos, use American English 2021-03-27 19:23:49 +01:00
Andreas Kling
5bd8a416ea LibC: Add AF_INET6, PF_INET6 and IPPROTO_IPV6 macros 2021-03-27 18:58:38 +01:00
Andreas Kling
67f89fdc87 LibC: Add POSIX macros for the ai_flags field in struct addrinfo 2021-03-27 18:57:30 +01:00
Andreas Kling
6d99345811 LibC: Add S_I{READ,WRITE,EXEC} macro aliases for BSD compatibility
These map as follows:

S_IREAD -> S_IRUSR
S_IWRITE -> S_IWUSR
S_IEXEC -> S_IXUSR
2021-03-27 18:00:41 +01:00
Liav A
3547d90a0f Kernel/Storage: Select the drive before working with busmaster register
This is a "quirk" I've observed on a Intel ICH7 test machine. Apparently
we need to select the device (master or slave) before starting to work
with the bus master register.
It's very possible that other machines are requiring this step to happen
before the DMA transfer can occur correctly.

Also, when reading with DMA, we should set the transfer direction before
clearing the interrupt status.

For the sake of completeness, I added a few lines in places that I
deemed it to be reasonable to clear the interrupt status there.
2021-03-27 16:40:16 +01:00
Liav A
1d0c183388 Kernel/Storage: Add some debug printing about IDE controllers 2021-03-27 16:40:16 +01:00
Liav A
186e03b99d Kernel/Storage: Remove redundant public declaration in IDEController.h 2021-03-27 16:40:16 +01:00
Liav A
b96e4c1308 Kernel/Storage: Use more locking in the IDE code
This change should make it less possible for race conditions to happen
and cause fatal errors when accessing the hardware.
2021-03-27 16:40:16 +01:00
Liav A
8b446fb579 Kernel/Storage: Add support for non-bus mastering IDE controllers
Although unlikely to happen, a user can have an IDE controller that
doesn't support bus master capability. If that's the case, we need to
check for this, and create an IDEChannel (not BMIDEChannel) to allow
IO operations with the controller.
2021-03-27 16:40:16 +01:00
Liav A
833a6bd047 Kernel/Storage: Move IDE bus master handling code into a separate class
If the user requests to force PIO mode, we just create IDEChannel
objects which are capable of sending PIO commands only.
However, if the user doesn't force PIO mode, we create BMIDEChannel
objects, which are sending DMA commands.

This change is somewhat simplifying the code, so each class is
supporting its type of operation - PIO or DMA. The PATADiskDevice
should not care if DMA is enabled or not.

Later on, we could write an IDEChannel class for UDMA modes,
that are available and documented on Intel specifications for their IDE
controllers.
2021-03-27 16:40:16 +01:00
Liav A
dfb6b296cf Kernel: Make IDEChannel Ref-counted
Technically not supported by the original ATA specification, IDE
hot swapping is still in practice possible, so the only sane way
to start support it is with ref-counting the IDEChannel object so if we
remove a PATADiskDevice, it's not gone with it.
2021-03-27 16:40:16 +01:00
Liav A
531037db7e Kernel: Remove support for CHS addressing
An article about IDE limits states that:
"Hard drives over 8.4 GB are supposed to report their geometry as
16383/16/63. This in effect means that the `geometry' is obsolete, and
the total disk size can no longer be computed from the geometry, but is
found in the LBA capacity field returned by the IDENTIFY command.
Hard drives over 137.4 GB are supposed to report an LBA capacity of
0xfffffff = 268435455 sectors (137438952960 bytes). Now the actual disk
size is found in the new 48-capacity field."
(https://tldp.org/HOWTO/Large-Disk-HOWTO-4.html) which is the main
reason to not support CHS as harddrives with less than 8.4 GB capacity
are completely obsolete.

Another good reason is that virtually any harddrive in the last 20 years
or so, supports LBA mode. Therefore, it's probably OK to just ignore CHS
as it's unlikely to encounter a harddrive that doesn't support LBA.

This is somewhat simplifying the IDE initialization and access code.
Also, we should use the ATAIdentifyBlock structure if possible,
so now we do it instead of using macros to calculate offsets.

With the usage of the ATAIdentifyBlock structure, we now use the
48-bit LBA max count if the drive indicates it supports 48-bit LBA mode.
2021-03-27 16:40:16 +01:00
Liav A
4bb8986752 Kernel: Generalize the ATAIdentifyBlock structure 2021-03-27 16:40:16 +01:00
Idan Horowitz
4317db7498 LibArchive: Make bounds checks stricter in the Zip parser
We now also check we have enough space in the incoming buffer for the
various signatures and optional (length specified) fields. This helps
prevents a possible heap overflow read.
2021-03-27 16:28:48 +01:00
Luke
1ff6f2b4b2 Lagom/Fuzzers: Add fuzzer for zip file parser 2021-03-27 16:28:34 +01:00
Linus Groh
e288541a9b Taskbar: Set window title as taskbar button tooltip
This way it's easier to find the right window when many are open at the
same time, as all buttons share a limited amount of horizontal space and
titles get truncated quickly.
2021-03-27 16:28:21 +01:00
Linus Groh
2fde87e67d WindowServer: Also keep menus open when activated via Ctrl + return key
I see no reason to limit this awesome feature to mouse clicks. :^)
2021-03-27 11:33:41 +01:00
Cesar Torres
0198ecca21 AudioServer: don't set an upper limit on volume in mixer
Let's not limit volume so we can play clips at over 100% without
the need to process the audio samples twice.
2021-03-27 10:20:55 +01:00
Cesar Torres
fd126578d9 SoundPlayer: Add samplerate variable to visualizations
also fix conflict
2021-03-27 10:20:55 +01:00
Cesar Torres
2e28b8ebcc SoundPlayer: Add playlist supprt
And a M3U(8) parser
2021-03-27 10:20:55 +01:00
Cesar Torres
e4d6a56a28 AudioPlayer: Further decouple the player from the GUI 2021-03-27 10:20:55 +01:00
Cesar Torres
f9e4bff487 SoundPlayer: Reduce sample buffer size and add a sample load event 2021-03-27 10:20:55 +01:00
Cesar Torres
7aa5297835 SoundPlayer: Update the SoundPlayer interface
Also fix rebase conflict
2021-03-27 10:20:55 +01:00
Cesar Torres
45e928bfb2 SoundPlayer: Adapt the existing SampleWidget visualization to
the new abstraction
2021-03-27 10:20:55 +01:00
Cesar Torres
876c62409a SoundPlayer: Add a no-visualization visualization :^)
For now it displays one of SerenityOS's wallpapers, but it should
show the playing file's cover, if any.
2021-03-27 10:20:55 +01:00
Cesar Torres
773c3586f1 SoundPlayer: Move the SoundPlayer-specific Slider widget to another file 2021-03-27 10:20:55 +01:00
Cesar Torres
f6f2f67c56 SoundPlayer: Add a 'Bars' audio visualization 2021-03-27 10:20:55 +01:00
Cesar Torres
b02f01843a SoundPlayer: Add abstractions for players and visulizations
This can make them easier to be swappable in realtime
2021-03-27 10:20:55 +01:00
Cesar Torres
809f1d984d SoundPlayer: Implement the Fast Fourier Transform algorithm 2021-03-27 10:20:55 +01:00
Cesar Torres
f4f5a1c0e7 AK: Add complex number library
Useful for diverse algorithms.
Also added some tests for it.
2021-03-27 10:20:55 +01:00
Cesar Torres
0d5e1e9df1 Everywhere: rename 'Sample' type to 'Frame'
Because it's what it really is. A frame is composed of 1 or more samples, in
the case of SerenityOS 2 (stereo). This will make it less confusing for
future mantainability.
2021-03-27 10:20:55 +01:00
networkException
f4bd095aa3 shot: Added option to output to clipboard instead of file
This allows screenshots to be easily used in PixelPaint for example :^)
2021-03-27 09:07:02 +01:00
Idan Horowitz
c01f4c3ed8 gunzip: Fail gracefully on bad input
Instead of crashing on a missing input file, looping forever on an
invalid gzip compressed file, and crashing on permissions issues in
the output file, handle all issues gracefully by logging and returning.
2021-03-26 23:00:10 +01:00
Linus Groh
0b799dd3b7 LibJS: VERIFY(!this_value.is_empty()) in VM::call_internal()
Just a sanity check, this must never happen. Manual invocations of
call() e.g. in LibWeb bindings must pass js_undefined() if no specific
this value is desired, which OrdinaryCallBindThis will then use as-is or
turn into the global this value in non-strict mode.
2021-03-26 22:59:47 +01:00
Linus Groh
056ffa4abb LibWeb: Call requestAnimationFrame() callback with undefined this value
We were leaking an empty value via the callback's this value:

    requestAnimationFrame(function () {
        this; // <-- empty value
    });
2021-03-26 22:59:47 +01:00