Commit graph

20524 commits

Author SHA1 Message Date
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
Stephan Unverwerth
da57563c1c LibGL: Implement glShadeModel()
This turns off interpolation of vertex colors when GL_FLAT is selected.
2021-05-16 15:53:58 +02:00
Daniel Bertalan
26953c2be1 LibVT: Implement ST (ESC \) escape sequence
Closes #7175
2021-05-16 15:53:02 +02:00
Daniel Bertalan
7b9051afe5 LibVT: Fix 8-bit control codes clobbering UTF-8
Bytes in the 0x80..0x9F range were treated as C1 control codes,
which prevented them from being parsed as UTF-8 bytes.

This caused some characters (like U+DF, encoded as 0xC3 0x9F)
from being recognized as printable characters.
2021-05-16 14:17:04 +02:00
Daniel Bertalan
e0b6cfec1a LibVT: fix SM/RM not respecting private markers
Since we now store intermediate characters separately, the intermediates
should be checked for the presence of the '?' DEC private marker, not
the first parameter.
2021-05-16 11:50:56 +02:00
Daniel Bertalan
be519022c3 LibVT: Implement new ANSI escape sequence parser
This commit replaces the former, hand-written parser with a new one that
can be generated automatically according to a state change diagram.

The new `EscapeSequenceParser` class provides a more ergonomic interface
to dealing with escape sequences. This interface has been inspired by
Alacritty's [vte library](https://github.com/alacritty/vte/).

I tried to avoid changing the application logic inside the `Terminal`
class. While this code has not been thoroughly tested, I can't find
regressions in the basic command line utilities or `vttest`.

`Terminal` now displays nicer debug messages when it encounters an
unknown escape sequence. Defensive programming and bounds checks have
been added where we access parameters, and as a result, we can now
endure 4-5 seconds of `cat /dev/urandom`. :D

We generate EscapeSequenceStateMachine.h when building the in-kernel
LibVT, and we assume that the file is already in place when the userland
library is being built. This will probably cause problems later on, but
I can't find a way to do it nicely.
2021-05-16 11:50:56 +02:00