Commit Graph

26483 Commits

Author SHA1 Message Date
Liav A
01ae614727 Kernel/VirtIO: Remove redundant VirtIO word from filenames
Now that all related VirtIO classes are in the VirtIO namespace, let's
just remove the redundant VirtIO word from filenames.
2021-08-31 16:51:13 +02:00
Liav A
e418740645 Kernel/VirtIO: Move everything into the VirtIO namespace
Before of this change, many specific classes to VirtIO were in the
Kernel namespace, which polluted it.
Everything should be more organized now, but there's still room for
improvement later.
2021-08-31 16:51:13 +02:00
Liav A
9a03c00f45 Kernel/VirtIO: Remove the m_class_name member
This class member was used only to determine the device type when
printing messages to the debug log. Instead, remove this class member,
and add a quick way to find the device type according to how the VirtIO
specification says to do that.

This simplifies construction of VirtIODevices a bit, because now the
constructor doesn't need to ask for a String identified with the device
type.
2021-08-31 16:51:13 +02:00
Liav A
5a0aa66b73 Kernel/PCI: Fix offset error of the PCI_SUBSYSTEM values
Apparently both PCI_SUBSYSTEM_ID and PCI_SUBSYSTEM_VENDOR_ID offsets
should be swapped from one to another to be correct.
2021-08-31 16:51:13 +02:00
Liav A
b596af363c Kernel/VirtIO: Make RNG device to not be a CharacterDevice
This class as a CharacterDevice really was not useful, because you
couldn't even read from it.
Also, the random number generator interface should be the /dev/random,
so any other interface to get random numbers is generally not a good
idea.
Instead, let's keep this functionality as an entropy source for random
numbers generation, but without exposing a device node.
2021-08-31 16:51:13 +02:00
TheFightingCatfish
c9b384da92 echo: Support octal, hexadecimal and unicode escape sequences 2021-08-31 16:49:45 +02:00
Joe Bentley
c2f62a03ff AudioApplet: Fix applet positioning bug
Currently when clicking the percentage toggle, there is a delay
in moving the applet window position. This is because after
the applet is resized, the applet area is repositioned
asynchronously. This takes advantage of the new AppletAreaRectChange
event to reposition the slider window when necessary.
2021-08-31 16:49:22 +02:00
Joe Bentley
9df79a77da WindowServer: Add message to notify clients of applet area resize
Applets and windows would like to be able to know when the applet
area has been resized. For example, this happens asynchronously after
an applet has been resized, so we cannot then rely on the applet area
position synchronously after resizing. This adds a new message
applet_area_rect_changed and associated Event AppletAreaRectChange,
and the appropriate virtual functions.
2021-08-31 16:49:22 +02:00
Musab Kılıç
1179d5d921 GameOfLife: Don't enable rotate button if a pattern isn't selected 2021-08-31 15:46:58 +01:00
Andreas Kling
fac0bbe739 Build: Pass "-z separate-code" to linker
This tells the linker to not combine read-only data and executable code,
instead favoring multiple PT_LOAD headers with more precise permissions.

This greatly reduces the amount of executable pages in all our programs
and libraries.

/usr/lib/libjs.so before:

  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x2fc77c 0x2fc77c R E 0x1000
  LOAD           0x2fc900 0x002fd900 0x002fd900 0x0c708  0x0dd1c  RW  0x1000

/usr/lib/libjs.so after:

  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x80e60  0x80e60  R   0x1000
  LOAD           0x081000 0x00081000 0x00081000 0x25f6c9 0x25f6c9 R E 0x1000
  LOAD           0x2e1000 0x002e1000 0x002e1000 0x1c27c  0x1c27c  R   0x1000
  LOAD           0x2fd900 0x002fe900 0x002fe900 0x0c708  0x0dd1c  RW  0x1000

As you can see, we go from 0x2fc77c bytes of executable memory down to
0x25f6c9 (a ~20% reduction!) The memory that was previous executable is
now simply read-only instead. :^)
2021-08-31 16:46:16 +02:00
Andreas Kling
5046a1fe38 Kernel: Ignore zero-sized PT_LOAD headers when loading ELF images 2021-08-31 16:46:16 +02:00
Andreas Kling
0819f0a3fd LibELF: Allow (but ignore) PT_LOAD headers with zero size
GNU ld sometimes generates zero-sized PT_LOAD headers when running with
the "-z separate-code" option. Let's not choke on such headers, we can
just ignore them and move along.
2021-08-31 16:46:16 +02:00
Mustafa Quraish
c853bc2ba6 PixelPaint: Rename Mode to FillMode for Ellipse/Rectangle
The prior commits add the `DrawMode` enum to keep track of where
the shape is being drawn from. With this addition, the prior `Mode`
enum name is confusing, so this commit renames it to `FillMode` to
be more explicit :^)
2021-08-31 16:45:57 +02:00
Mustafa Quraish
6ccdc018b4 PixelPaint: Add ability to draw rectangle from center
Essentially the same logic as the prior commit, but now for the
`RectangleTool` class. Pressing `alt` lets you draw the rectangle
with the starting position as the center.
2021-08-31 16:45:57 +02:00
Mustafa Quraish
1a3481f35b PixelPaint: Add ability to draw ellipse from center
Like other common image editing applications, now if you press
`alt` while drawing an ellipse, it uses the starting position as
the center of the ellipse as opposed to one of the corners of the
bounding rect.

The EllipseTool class now keeps track of a `DrawMode`, which is
either `DrawMode::FromCorner` (default), or `DrawMode::FromCenter`
(the option added by this commit).

The `draw_using()` function was modified to now take in the start
and end positions and construct the `ellipse_intersecting_rect`
itself, since we need to construct it differently based on the
drawing mode.
2021-08-31 16:45:57 +02:00
Karol Kosek
d04c8d478f KeyboardSettings: Reuse generic GUI::ItemListModel
This change removes the manually created model class
in order to use a generic GUI::ItemListModel.

Besides from code reusability, it also makes the list
searchable as you type.
2021-08-31 16:43:18 +02:00
Karol Kosek
4bad2bf100 LibGUI: Reuse draw_item_text function in ListView
This commit will highlight searched text!
2021-08-31 16:43:18 +02:00
Karol Kosek
ebe8778876 LibGUI: Enable searching through ListView items by keyboard
ComboBoxes and a FontPicker window will now react to keyboard press.
2021-08-31 16:43:18 +02:00
Karol Kosek
c2a89cac4e LibGUI: Make ItemListModel searchable 2021-08-31 16:43:18 +02:00
Karol Kosek
8dbb996200 Spreadsheet: Implement begin() and end() 2021-08-31 16:43:18 +02:00
Karol Kosek
f56e240981 Spreadsheet: Add RowIterator::index() 2021-08-31 16:43:18 +02:00
Jesse Buhagiar
59eab8148d Kernel/Userland: Expose usb device address and use it in lsusb
We now expose the `USBDevice`'s address in the SysFS object. This means
that device addresses are no longer determined by the name of the file
in the `/bus/usb/` directory. This was an incorrect way of determining
device address, as a standard PC can have multiple USB controllers
(and hence multiple buses) that can have overlapping device IDs.
2021-08-31 16:38:49 +02:00
Tobias Christiansen
32b4470ea3 Shell: Use new Statistics tool in 'time -n' command
The new Statistics utility is now used when calling 'time -n' to get
some more information of the timings. For now only the standard
deviation is given in addition to the average.

This commit completely undos #9645 because everything that touched moved
into AK::Statistics.
2021-08-31 16:38:22 +02:00
Tobias Christiansen
dcf06a4f40 AK: Add Statistics helper
This patch adds a helper to AK which allows for basic statistical
analysis of values.
The median algorithm is very naive and slow, but it works.
2021-08-31 16:38:22 +02:00
Ali Mohammad Pur
60d43d6969 AK: Don't perform the shift when it's too large when decoding LEB128
Prior to this, we calculated whether the shift was too large for the
result, and then did the shift regardless.
Found by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6046441716973568
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
98624fe03f LibRegex: Implement min/max repetition using the Repeat bytecode
This makes repetitions with large max bounds work correctly.
Also fixes an OOM issue found by OSS-Fuzz:
https://oss-fuzz.com/testcase?key=4725721980338176
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
b64d6bb3a3 LibWasm: Limit the number of function locals
It's possible for the module to request too many locals, we now reject
such modules instead of trying to allocate space for them.
The value itself is chosen arbitrarily, so future tweaks _might_ be
necessary.
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4755809098661888
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
05c65f9b5d LibRegex: Limit the number of nested capture groups allowed in BRE
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4869334212673536
2021-08-31 16:37:49 +02:00
Linus Groh
c171aa40a8 LibJS: Implement Temporal.Instant.prototype.toJSON() 2021-08-31 16:35:51 +02:00
Linus Groh
463eb361ad LibJS: Implement Temporal.Instant.prototype.toLocaleString() 2021-08-31 16:35:51 +02:00
Linus Groh
576be0f8e7 LibJS: Implement Temporal.Instant.prototype.toString() 2021-08-31 16:35:51 +02:00
Karol Kosek
1c65ee6edf LibAudio: Implement decoding verbatim blocks in FLAC
They're mostly used in literal random data, so it isn't like
there is a high demand for it, but it's cool to have more complete
implementation anyway. :^)
2021-08-31 16:35:37 +02:00
sin-ack
a086be993b LibGUI: Bias text towards bottom when tabs at top have uneven spacing
This makes the text on inactive tabs in Browser look a lil' bit nicer.
:^)
2021-08-31 16:34:55 +02:00
sin-ack
4959fa4f1e LibGUI: Adjust content area and focus rect of tab buttons
This improves the look of tabs and their focus rects. In particular, the
concept of a "text rect" is removed, and whatever tab content area is
left over after the icon and close button are added is used as the area
to draw the text into. This approach is simpler than having a separate
text rect.
2021-08-31 16:34:55 +02:00
Owen Smith
22ec21bd61 Kernel: Don't VERIFY_NOT_REACHED in LocalSocket::has_attached_peer()
Invoking sendmsg on a listening socket triggers this assertion as
sendto calls has_attached_peer before checking the result of
send_buffer_for.
2021-08-31 16:00:53 +02:00
kleines Filmröllchen
0dc6fe9102 Piano: Use LibDSP to implement delay
This is the first step in transitioning Piano to a full LibDSP backend.
For now, the delay effect is replaced with a (mostly identical)
implementation in LibDSP.

The new ProcessorParameterSlider attaches to a LibDSP::Processor's
range parameter (LibDSP::ProcessorRangeParameter) and changes it
automatically. It also has the ability to update an external GUI::Label.
This is used for the three delay parameters and it will become useful
for auto-generating UI for Processors.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
a749b16674 Libraries: Add LibDSP
LibDSP is a library for digital signal processing, and is primarily
intended to support the future DAW version of Piano.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
8f4b577405 AK: Make SinglyLinkedList::remove() public
This is a nice API to have outside of the class, and it is convenient
for LibDSP.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
ad6a332268 Piano: Add velocity and pitch support
As Piano will later move to the RollNote defintions of LibDSP, it's a
good idea to already insert velocity and pitch support, even though it's
currently not used.
2021-08-31 17:03:55 +04:30
Hediadyoin1
fdef6e5f76 AK: Add FixedPoint arithmetic helper
Co-authored-by: Hendiadyoin1 <leon2002.la@gmail.com>
Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
2021-08-31 17:03:55 +04:30
Brian Gianforcaro
beb8c48f26 Meta: Don't allow overlap in sonar cube file classification
Test files were getting analyzed twice, which the tool does
not like, and causes it to exit with a fatal error.

Also make the workflow run in PRs anytime the file is edited,
so that we can get immediate feedback without waiting till the
next day.
2021-08-31 12:41:18 +02:00
Nicholas Hollett
0d98bba167 Profiler: Add a flamegraph view for the stack
The flamegraph makes it easier to quickly spot expensive functions,
based on the width of their bar.
2021-08-31 12:40:51 +02:00
Nicholas Hollett
4fe380f6da LibGfx: Add color helper for getting shades and tints
Shades are colors darker than the color, tints are colors lighter.
This is helpful in places where we need a bunch of similar colors
with some small differences.
2021-08-31 12:40:51 +02:00
Andrew Kaster
60e27dea9c Meta: Require unzip and tar explicitly in CMakeLists
This should help stem the tide of people hopping in the build problems
channel on discord because they don't have unzip installed.
2021-08-31 12:39:46 +02:00
Karol Kosek
6caedc71c1 Base: Fix outline in the 32x32 filetype-font icon
The outline was already black in general, besides one dark blue pixel
on the right side of the picture.
2021-08-31 12:38:40 +02:00
Karol Kosek
3238654ae8 Base: Remove half-transparent pixels in filetype-spreadsheet icons
Some pixels weren't fully transparent in the top-right corner, which
was pretty visible on file selection in File Manager on default theme.

The files has been also compressed using the Zopfli algorithm, since
they would have been rewritten here anyway.
2021-08-31 12:38:40 +02:00
Andreas Kling
a5992a4ef8 FileManager: Tweak layout spacing in file properties window
There wasn't enough vertical spacing between the TabWidget and the three
(Ok/Cancel/Apply) buttons at the bottom.
2021-08-31 02:43:50 +02:00
Andreas Kling
ea7e5be85a Base: Redraw the basic 16x16 arrow icons
This time with a consistent light source (top left) and a color scheme
closer to the SerenityOS default colors. :^)
2021-08-31 02:31:27 +02:00
Andreas Kling
7c9e01e4f5 Base: Tweak 16x16 open-parent-directory icon
Make the bottom left corner of this icon rounded, to match all the other
directory icons in the system.
2021-08-31 02:29:32 +02:00
Andreas Kling
af9d4281eb LibC: Run clang-format on setjmp.h 2021-08-31 01:37:30 +02:00