Commit graph

20529 commits

Author SHA1 Message Date
Andrew Kaster
cfdd231a4d Documentation: Add Sanitizer section to RunningTests
Also, add link to RunningTests BuildInstructions, and clean up stale
commands in RunningTests to align to current build strategies.
2021-05-16 21:58:14 +01:00
Andrew Kaster
ac1d87b990 CI: Compile and run Lagom tests with ASAN and UBSAN
Make sure halt_on_error=1 is enabled so that UBSAN failures will crash
the test program and cause a failure.
2021-05-16 21:58:14 +01:00
Andrew Kaster
73adbb319c AK: Don't read past the end in BitmapView::count_in_range()
The current code is factored such that reads to the entirety of the last
byte should be dropped. This was relying on the fact that last would be
one past the end in that case. Instead of actually reading that byte
when it's completely out of bounds of the bitmask, just skip reads that
would be invalid. Add more tests to make sure that the behavior is
correct for byte aligned reads of byte aligned bitmaps.
2021-05-16 21:58:14 +01:00
Andrew Kaster
b9d65da5c8 LibCore: Use Vector instead of VLA in ArgsParser::parse()
If there happens to be zero positional arguments, this constructs a
0-length VLA, which is UB caught by UBSAN.
2021-05-16 21:58:14 +01:00
Andrew Kaster
11214bc94d AK: Don't call memcpy with null argument in ByteBuffer::copy()
This was happening in TestBase64.test_decode, while copying an empty
string.
2021-05-16 21:58:14 +01:00
Andreas Kling
00fa5dc53e Taskbar: Make shutdown dialog non-resizable and tweak button spacing 2021-05-16 21:23:31 +02:00
Andreas Kling
551e13b407 LibGUI: Put some more space between check boxes and their label text 2021-05-16 21:15:34 +02:00
Andreas Kling
3c831b146c LibGUI: Put some more space between radio buttons and their label text 2021-05-16 21:14:04 +02:00
Andreas Kling
f34a3b9521 Taskbar: Give the shutdown dialog a UI facelift :^) 2021-05-16 20:57:45 +02:00
Andreas Kling
ce47bbc965 Base: Tweak app-text-editor 32x32 icon (pencil color) 2021-05-16 20:27:17 +02:00
Liav A
8cbf3d88ff Kernel: Move ConsoleDevice initialization just after kmalloc init
This will ensure we will get all the kernel log on the second tty.
2021-05-16 19:58:33 +02:00
Liav A
dbccfc3281 Kernel: Print all logbuffer from ConsoleDevice to debug Virtual Console 2021-05-16 19:58:33 +02:00
Liav A
2e565f1b8a Meta: Update grub configuration to adopt the new textual boot mode 2021-05-16 19:58:33 +02:00
Liav A
69a54e5f64 Documentation: Update bare metal troubleshooting guide 2021-05-16 19:58:33 +02:00
Liav A
ab52108982 Kernel: Allow the user to specify the virtual console when booting 2021-05-16 19:58:33 +02:00
Liav A
99eab4667a Kernel: Print scheduler state to the display console 2021-05-16 19:58:33 +02:00
Liav A
20743e8aed Kernel/Graphics + SystemServer: Support text mode properly
As we removed the support of VBE modesetting that was done by GRUB early
on boot, we need to determine if we can modeset the resolution with our
drivers, and if not, we should enable text mode and ensure that
SystemServer knows about it too.

Also, SystemServer should first check if there's a framebuffer device
node, which is an indication that text mode was not even if it was
requested. Then, if it doesn't find it, it should check what boot_mode
argument the user specified (in case it's self-test). This way if we
try to use bochs-display device (which is not VGA compatible) and
request a text mode, it will not honor the request and will continue
with graphical mode.

Also try to print critical messages with mininum memory allocations
possible.

In LibVT, We make the implementation flexible for kernel-specific
methods that are implemented in ConsoleImpl class.
2021-05-16 19:58:33 +02:00
Liav A
dac129e10b Kernel: Expand the kernel memory slot from 16 MiB to 32 MiB
Like in 8cd5477e54, we need to expand the
kernel slot again to be able to boot again.
2021-05-16 19:58:33 +02:00
Liav A
7078119c58 Kernel: Don't ref-count UsedMemoryRange during iteration 2021-05-16 19:58:33 +02:00
Liav A
8f2ddde4cb Kernel: Rename Console => ConsoleDevice
This change will help to distinguish between the console
device and the Console abstraction layer in the Graphics
subsystem later.
2021-05-16 19:58:33 +02:00
Liav A
0669dd82e2 Kernel/PCI: Add helper to determine if device can access IO space 2021-05-16 19:58:33 +02:00
Liav A
2cd1f928e1 Kernel: Drop support of GRUB VBE modesetting
We used GRUB to modeset the resolution for a long time, but for good
reasons I see no point with keeping it supported in our kernel. We
support bochs-display device on QEMU (both the VGA compatible and
non-VGA compatible variants), so for QEMU we can still boot the system
in graphical mode even without GRUB help.

Also, we now have a native driver for Intel graphics and although it
doesn't support most Intel graphics cards out there yet, it's a good
starting point to support more cards. If a user wants to boot on
bare-metal in graphical mode, all he needs to do is to add the removed
flag back again, as the kernel still supports pre-set framebuffers.
2021-05-16 19:58:33 +02:00
Liav A
cc92538d49 Kernel/Graphics: Add basic support for Intel native accelerator
We simply modeset the resolution after determining the preferred
resolution after getting the EDID from the attached display.
2021-05-16 19:58:33 +02:00
Liav A
6a728e2d76 Kernel: Introduce a new graphics subsystem
This new subsystem is replacing the old code that was used to
create device nodes of framebuffer devices in /dev.

This subsystem includes for now 3 roles:
1. GraphicsManagement singleton object that is used in the boot
process to enumerate and initialize display devices.
2. GraphicsDevice(s) that are used to control the display adapter.
3. FramebufferDevice(s) that are used to control the device node in
/dev.

For now, we support the Bochs display adapter and any other
generic VGA compatible adapter that was configured by the boot
loader to a known and fixed resolution.

Two improvements in the Bochs display adapter code are that
we can support native bochs-display device (this device doesn't
expose any VGA capabilities) and also that we use the MMIO region,
to configure the device, instead of setting IO ports for such tasks.
2021-05-16 19:58:33 +02:00
Liav A
8515a1c49d Meta: Boot the Q35 machine without VGA support
Use the bochs-display device instead :)
2021-05-16 19:58:33 +02:00
Liav A
86be477da0 Kernel: Support the bochs-display device
This device is a graphics display device that is not supporting
VGA functionality.
Therefore, it exposes a MMIO region to configure it, so we use that
region to set the framebuffer resolution.
2021-05-16 19:58:33 +02:00
Stephan Unverwerth
2dcafde330 LibGL: Implement alpha testing in SoftwareRasterizer 2021-05-16 19:27:23 +02:00
Stephan Unverwerth
1bd754882d LibGL: Implement glAlphaFunc()
This implements glAlphaFunc() for setting alpha test func and ref value
and also allows enabling and disabling GL_ALPHA_TEST
2021-05-16 19:27:23 +02:00
Gunnar Beutner
b8b8b4b566 LibCompress: Add missing #include
This previously worked because <AK/ByteBuffer.h> included
<AK/Optional.h> - and now it doesn't anymore.
2021-05-16 19:21:47 +02:00
Gunnar Beutner
006f11f23d Kernel: Avoid allocations when handling network packets 2021-05-16 17:49:42 +02:00
Gunnar Beutner
53d0150827 AK+Userland: Remove nullability feature for the ByteBuffer type
Nobody seems to use this particular feature, in fact there were some
bugs which were uncovered by removing operator bool.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
c4d0b0cd6b Userland: Don't explicitly call Vector<T>::is_null()
This method always returns false so there's no reason for calling it.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
24ca645f08 HexEditor: Call size() instead of operator bool()
This previously called operator bool by accident.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
4b5dbc15df Kernel: Fix incorrect argument when constructing DiskPartitionMetadata
The existing code invokes operator bool for the partition_type
variable.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
24376e7759 LibGfx: Avoid copying ByteBuffers while loading PNG images
This wasn't much of a problem before because copying the ByteBuffer
merely copied the RefPtr but now that ByteBuffer behaves like Vector
this causes unnecessary allocations.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
fcaf98361f AK: Turn ByteBuffer into a value type
Previously ByteBuffer would internally hold a RefPtr to the byte
buffer and would behave like a reference type, i.e. copying a
ByteBuffer would not create a duplicate byte buffer, but rather
two objects which refer to the same internal buffer.

This also changes ByteBuffer so that it has some internal capacity
much like the Vector<T> type. Unlike Vector<T> however a byte
buffer's data may be uninitialized.

With this commit ByteBuffer makes use of the kmalloc_good_size()
API to pick an optimal allocation size for its internal buffer.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
f0fa51773a AK+Userland: Fix some compiler warnings and make variables const-ref
This fixes a few compiler warnings and makes some variables const-ref
in preparation for the next commit which changes how ByteBuffer works.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
fbdc3b0ee2 Userland: Add missing #includes
These two header files relied on transitive header includes.
2021-05-16 17:49:42 +02:00
DragonAlex98
47ec5cf340 ImageViewer: Stop animation timer when deleting/changing image
Previously deleting an animated image wouldn't make the animation timer
stop. This resulted in the animation still running in the ViewWidget.

Moreover the timer wasn't stopped when loading different images, which
led to high CPU usage when going from an animated image to a
non-animated one.
2021-05-16 16:22:21 +01:00
DragonAlex98
bce119036a ImageViewer: Disable image actions when there is no image
Previously some actions like Rotate/Flip/Set as Desktop Wallpaper would
make the application crash if no image was loaded. Now image actions are
enabled/disabled based on whether an image has been loaded or not.
2021-05-16 16:22:21 +01:00
Itamar
400d3ddb08 LanguageServers: Rename AutoCompleteEngine => CodeComprehensionEngine
This feels like a better name since the "autocomplete engine" can, in
addition to providing autocomplete suggestions, also find declarations
of symbols and report back the symbols that are defined in a document.

Also, Cpp/ParserAutoComplete has been renamed to CppComprehensionEngine
and Shell/AutoComplete has been renamed to ShellComprehensionEngine.
2021-05-16 16:39:21 +02:00
Itamar
b1531b78f6 HackStudio+CppLanguageServer: Remove lexer-based autocomplete engine
The parser-based autocomplete engine is at a point where it's stable
enough that I don't think there's a need for the lexer-based
alternative anymore.
2021-05-16 16:39:21 +02:00
Timothy Flynn
ddb278ab85 Solitaire: Add key combo to dump the state of the layout
Useful for chasing down bugs.
2021-05-16 16:37:51 +02:00
Timothy Flynn
ce030ca584 AK+Meta: Add a debug option for Solitaire 2021-05-16 16:37:51 +02:00
Timothy Flynn
68e86dc804 Solitaire: Add shift modifier to hidden "game over" key combo
Makes it a bit less likely that someone will hit it on accident and ruin
their game.
2021-05-16 16:37:51 +02:00
Timothy Flynn
e310b9cd0d Solitaire: Add setting for number of cards to be drawn
Klondike Solitaire has a couple more modes, but this adds modes for 1-
and 3-card draws.
2021-05-16 16:37:51 +02:00
Timothy Flynn
3a45bf5254 Solitaire: Add stack for the playable cards on top of the waste stack
While the waste stack and the playable card on top of the waste stack
are collectively referred to as the "waste", it's programatically nice
to separate them to enable 3-card-draw mode. In that mode, the playable
stack will contain 3 cards with a slight x-axis shift, while the waste
stack underneath will remain unshifted. So rather than introducing some
ugly logic to CardStack to handle this, it's more convenient to have a
separate stack on top of the waste stack.
2021-05-16 16:37:51 +02:00
Daniel Bertalan
d5ea04cdfb LibC+Kernel: Add sys/ttydefaults.h
This non-POSIX header is used in Linux/BSD systems for storing the
default termios settings. This lets us setup new TTYs' `m_termios.c_cc`
in a nicer way than using a magic string.
2021-05-16 16:31:30 +02:00
Linus Groh
7ec8cb97e9 LibVT: Run clang-format on Terminal.cpp
Some trailing whitespace is causing the CI to fail. :^)
2021-05-16 15:16:50 +01:00
Stephan Unverwerth
d6e8634576 LibGL: Add glBlendFunc() and glShadeModel() to call lists 2021-05-16 15:53:58 +02:00