Commit graph

18222 commits

Author SHA1 Message Date
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
Federico Guerinoni
49a062f81d LibGUI: Show human readable size in filemanager
The size is visible only in TableView mode of the filemanager.
2021-03-26 22:59:09 +01:00
Linus Groh
8fe7983cc5 LibMarkdown: Remove unused Paragraph::add_line() declaration 2021-03-26 22:58:36 +01:00
Timothy Flynn
cd82fd24e2 Browser: Add right-click context menu item for editing bookmarks
This allows users to right-click on a bookmark button to open a small
dialog for editing bookmark titles and URLs.
2021-03-26 22:58:31 +01:00
Timothy Flynn
990e362a17 LibGUI: Allow assigning a value to a specific index in JsonArrayModel 2021-03-26 22:58:31 +01:00
Timothy Flynn
4babf6e4e1 AK: Allow assigning a value to a specific index in a JsonArray 2021-03-26 22:58:31 +01:00
Timothy Flynn
74e9a892e3 LibWeb: Compute height of absolutely positioned blocks when possible
Section 10.6.4 rule 5 of the CSS height property spec outlines a method
to compute the height of an absolutely positioned block when the 'top'
and 'bottom' CSS properties are specified.
2021-03-26 22:58:13 +01:00
Timothy Flynn
03990fcb89 LibWeb: Consider floating children when computing auto-height
The case for computing auto-height of block elements which have block-
level children was erroneously skipping some children:

1. If the block element itself is absolute or floating, all children
   were skipped due to a likely typo ("box" vs. "child_box" inside the
   for-each loop).

2. Floating children should only be skipped if the block element's
   'overflow' property computes to 'visible', per section 10.6.3 of the
   CSS height property spec. If the property computes to another value,
   section 10.6.7 only indicates that absolutely positioned children
   should be skipped.
2021-03-26 22:58:13 +01:00
Andreas Kling
f018100d21 Utilities: Add a simple "shot" utility for grabbing screenshots :^)
This little CLI program grabs the current screen image from
WindowServer and saves it as a PNG file.
2021-03-26 20:33:23 +01:00
Andreas Kling
d9f8f6a2d0 WindowServer: Add an IPC call for taking a screenshot
This patch adds Messages::WindowServer::GetScreenBitmap. It returns the
currently displayed on-screen bitmap as-is, as a Gfx::ShareableBitmap.
2021-03-26 20:33:23 +01:00
Timothy Flynn
557927f25b LibWeb+WebContent: Support displaying favicons in OOPWV
In single process mode, the browser will display a page's favicon in
both the location bar and tab. This adds the same support for multi-
process mode.
2021-03-26 16:55:51 +01:00
Michel Hermier
ff0d4c6f7c Kernel: Remove unused WorkQueue::m_name. 2021-03-26 16:54:05 +01:00
Michel Hermier
51ad3da999 Kernel: Remove unused MBRPartitionTable::m_partitions_count. 2021-03-26 16:54:05 +01:00
Michel Hermier
4ac49eabd5 Kernel: Remove unused FileBlockCondition::m_file. 2021-03-26 16:54:05 +01:00
Michel Hermier
a359f477a7 Kernel: Remove unused EBRPartitionTable::m_partitions_count. 2021-03-26 16:54:05 +01:00
Michel Hermier
37be679d6e Kernel: Remove unused AHCIPort::ScatterList::m_device_block_size. 2021-03-26 16:54:05 +01:00
Andreas Kling
ecb0ae9c33 WindowServer: Keep menu open when activating a menu item with Ctrl held
This makes it easy to "try out" different options (like system themes!)
in a menu without having to re-open the menu over and over. :^)
2021-03-26 14:45:15 +01:00
Andreas Kling
b31b904ad0 WindowServer: Redraw all menus on system theme change 2021-03-26 14:42:38 +01:00
Andreas Kling
4b6fba1e4c WindowServer+LibGfx: Make menubar menus slightly larger
Also make sure the left/right padding is equally large.
2021-03-26 14:25:37 +01:00
Andreas Kling
3020f5efd9 Taskbar: Add more prominent Help app icon in the start menu 2021-03-26 13:54:56 +01:00
Andreas Kling
b8a9f433f9 Taskbar: Move "About SerenityOS" to the top of the start menu 2021-03-26 13:31:10 +01:00