Commit Graph

20631 Commits

Author SHA1 Message Date
Jean-Baptiste Boric
0262a99a1f Chess: Fix signed/unsigned issues
Make everything signed so that we don't have to deal with silly casting
issues thoughout the Chess code. I am unsure if this affects the chess
AI negatively, it seems just as "intelligent" before and after this
change :^)
2021-05-17 18:14:05 +01:00
Jean-Baptiste Boric
d0eb376520 LibArchive: Move method implementations away from header 2021-05-17 18:14:05 +01:00
Jean-Baptiste Boric
3038edab00 Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
Linus Groh
b9d3df70e0 LibJS: Increase free stack space required for function calls to 32 kiB
The previous 16 kiB weren't sufficient with ASAN enabled and would
trigger stack overflow failures.
2021-05-17 18:03:10 +01:00
Linus Groh
0aab774343 Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
Andreas Kling
bebbeda726 Revert "BitmapView: Disable mutations of the underlying Bitmap"
This reverts commit f25209113f.
2021-05-17 18:29:47 +02:00
Daniel Bertalan
c1e292e5bc LibVT: Correct color handling
VT100's documentation says that more than one SGR (Set Graphics
Rendition) parameters may be included in a single escape sequence.
However, we treated those with more than 3 parameters as color
sequences, so this behavior was not replicated.
2021-05-17 18:19:49 +02:00
Daniel Bertalan
507ace5174 LibVT: Fix progress bars not getting reset 2021-05-17 18:19:49 +02:00
Daniel Bertalan
5d80debc1f LibVT: Fix newline handling
Before this commit, we would jump to the first column after receiving
the '\n' line feed character. This is not the correct behavior, as it
should only move the cursor now. Translating the typed Return key into
the correct CR LF ("\r\n") is the TTY's job, which was fixed in #7184.

Fixes #6820
Fixes #6960
2021-05-17 18:19:49 +02:00
Lenny Maiorani
f25209113f BitmapView: Disable mutations of the underlying Bitmap
Problem:
- `BitmapView` permits changing the underlying `Bitmap`. This violates
  the idea of a "view" since views are simply overlays which can
  themselves change but do not change the underlying data.

Solution:
- Migrate all non-`const` member functions to Bitmap.
2021-05-17 18:16:35 +02:00
Idan Horowitz
ba9b3dc656 Kernel: Implement a PCI Serial Device driver
This simple driver simply finds a device in a device definitions list
and then sets up a SerialDevice instance based on the definition.

The driver currently only supports "WCH CH382 2S" pci serial boards,
as that is the only device available for me to test with, but most
other pci serial devices should be as easily addable as adding a
board_definitions entry.
2021-05-17 18:15:25 +02:00
Idan Horowitz
62f69cc50f Kernel: Use IOAddress instead of direct IO calls in SerialDevice 2021-05-17 18:15:25 +02:00
Idan Horowitz
a5699a141d Kernel: Add a put_char(char) method to SerialDevice
This can be used to print a single char to the serial port the
SerialDevice instance handles.
2021-05-17 18:15:25 +02:00
Idan Horowitz
c75ca4ea8f Kernel: Bit mask line control options in SerialDevice::set_line_control
The line control option bits (parity, stop bits, word length) were
masked and then combined incorrectly, resulting in them not being set
when requested.
2021-05-17 18:15:25 +02:00
Idan Horowitz
be57c424f3 Kernel: Swap baud rate divisor registers in SerialDevice::set_baud
These were accidentally the wrong way around (LSB part of the divisor
into the MSB register, MSB part of the divisor into the LSB register)
as can be seen in the specification (and in the comments themselves)
2021-05-17 18:15:25 +02:00
Idan Horowitz
0e5aba16ef Kernel: Use unsigned instead of signed types in SerialDevice
Addresses are unsigned by definition, and the conversion from signed
to unsigned and back in SerialDevice looked a bit dubious.
2021-05-17 18:15:25 +02:00
Idan Horowitz
3ad0a0d8c3 Kernel: Initialize the PCI Bus earlier in the boot sequence
We now initialize the PCI Bus as early as possible, to allow for
early boot (PCI based) serial logging.
2021-05-17 18:15:25 +02:00
Gunnar Beutner
843f861f97 LibELF: Fix an integer overflow in Image::find_sorted_symbol
The expression address - candidate.address can yield a value that
cannot safely be converted to an i32 which would result in
binary_search failing to find some symbols.
2021-05-17 14:58:13 +02:00
Timothy Flynn
44ceee1e14 Base: Fix 16x16 analog clock icon
This icon somehow got replaced with a Buggie image in
07341c3594.
2021-05-17 14:56:21 +02:00
Gunnar Beutner
51db8085f8 Demos: Add Mandelbrot demo
This adds a very rudimentary Mandelbrot viewer. It supports zooming
and pretty much nothing else. Not even color smoothing or super
sampling.
2021-05-17 13:35:39 +02:00
Andreas Kling
7e799529b9 WindowServer+LibGUI: Make menubar allocation asynchronous
Same as with menu allocation, move menubar ID management to the client
side, removing more IPC stalls during application startup.
2021-05-17 13:33:41 +02:00
Andreas Kling
baab0a5bef WindowServer+LibGUI: Make menu allocation asynchronous
This was only synchronous since WindowServer managed the ID allocation.
Doing this on the client side instead allows us to make create_menu()
an asynchronous IPC call, removing a bunch of IPC stalls during
application startup.
2021-05-17 13:33:41 +02:00
Gunnar Beutner
52054eb922 UE: Make sure we return the right values for get{peer,sock}name
These two functions didn't previously return error codes correctly and
would crash when an invalid address buffer was specified.
2021-05-17 13:32:19 +02:00
Gunnar Beutner
07341c3594 LibCore: Close accepted sockets on exec() and make them non-blocking
Previously accept() would copy the listener socket's cloexec and
non-blocking flag. With that fixed however TCPServer and LocalServer
now leak file descriptors into child processes and are blocking.
2021-05-17 13:32:19 +02:00
Gunnar Beutner
89956cb0d6 Kernel+Userspace: Implement the accept4() system call
Unlike accept() the new accept4() system call lets the caller specify
flags for the newly accepted socket file descriptor, such as
SOCK_CLOEXEC and SOCK_NONBLOCK.
2021-05-17 13:32:19 +02:00
Gunnar Beutner
529f605ac8 UE: Make sure the buffers for get{sock,peer}name() are large enough
Previously struct sockaddr was used which isn't guaranteed to be
large enough to hold the socket address get{sock,peer}name() returns.

Also, the addrlen argument was initialized incorrectly and should
instead use the address length specified by the caller.
2021-05-17 13:32:19 +02:00
Gunnar Beutner
fbfd0ed5ab LibCore: Open files with O_CLOEXEC by default
This changes Core::File::open() to specify O_CLOEXEC by default
so that we don't leak file descriptors into child processes. The
new behavior can be overriden by specifying OpenMode::KeepOnExec.
2021-05-17 13:32:19 +02:00
Andreas Kling
67ed580532 Chess: Make the main widget a GUI::Frame for a nicer look :^) 2021-05-17 12:02:38 +02:00
Andreas Kling
2083d1a3d6 WindowServer: Ignore window base size in aspect ratio enforcement
This makes windows with an aspect ratio behave more naturally if they
also have a base size (e.g from the main widget being a GUI::Frame.)
2021-05-17 12:01:17 +02:00
Daniel Bertalan
f0375e3efe Kernel+LibC: Support more termios settings in TTY
This commit adds support for the various ECHO* lflags and fixes some
POSIX conformance issues around newline handling. Also included are
error messages when setting not implemented settings.
2021-05-17 11:00:48 +02:00
Ali Mohammad Pur
b1b0db946e LibJS: Default-initialize the current_node pointer member in CallFrame
Some parts of the code depend on this being nullptr without actually
initializing it, leading to odd random crashes.
e.g. `VM::call_internal`.
2021-05-17 09:41:26 +02:00
Lenny Maiorani
adbf555e64 LibCrypto: Fix incorrectly constexpr variable
Problem:
- Clang ToT reports an error because `digest_size` cannot be evaluated
  at compile-time.

Solution:
- Change from using the member function to the `static` shadow of the
  NTTP.
2021-05-17 08:16:46 +02:00
Liav A
e6f333ae00 Kernel: Print failed attempt to shutdown the machine
Because we don't parse ACPI AML yet, If we are not able to shut down
the machine with "hacky" emulation methods - halt and print this state
to the users so they know they can shutdown the machine by themselves.
2021-05-17 00:30:40 +01:00
Liav A
02b73cb93d Kernel/Graphics: Be more consistent about arguments passing
This fixes a bug that was reported on this discord server by
@ElectrodeYT - due to the confusion of passing arguments in different
orders, we messed up and triggered a page fault due to faulty sizes.
2021-05-17 00:30:40 +01:00
Grant Yap
ca9101e5f0 Piano: Use the return key emoji in the key labels
The new way labels are stored unfortunately makes it *slightly* less
convenient to update the lists of white key and black key labels.
2021-05-17 00:16:49 +01:00
Grant Yap
186102dcc6 Emoji: Add a return key symbol 2021-05-17 00:16:49 +01:00
Ömer Kurttekin
cab821cd22
Ports: Update the packages.db directory in README
"packages.db" used to be directly in the "Build" directory but it has
been moved to "Build/i686/Root/usr/Ports/" in 6877a5b.
2021-05-16 22:52:51 +01:00
Siddharth Kapoor
dbd9d13857
Meta: Run 'du' with '--apparent-size', except on macOS
Fixes #7172.
2021-05-16 22:50:46 +01:00
Erik Biederstadt
2eb9dca782
GLTeapot: Add support for loading OBJ files containing extra information
If the OBJ loader encounters a file with vertex normals or texture
coordinates then it will no longer crash.
2021-05-16 22:48:23 +01:00
Luke
1258d06f74 LibWeb: Fix "adopt" => "adopt_ref" change in adoptNode exceptions
This was accidentally changed in
b91c49364d
2021-05-16 22:08:49 +01:00
Linus Groh
d7c0370c57 GameOfLife: Don't randomize cells on board resize
Loosing all game state for a simple resize of the board is quite
disappointing, so let's not do that. :^)
2021-05-16 23:00:21 +02:00
Linus Groh
7dea3d41cb GameOfLife: Use a frame as the board widget container
This adds a bit of depth and looks very nice :^)
2021-05-16 23:00:21 +02:00
Linus Groh
9151364e22 GameOfLife: Add vertical separator between interval and action buttons 2021-05-16 23:00:21 +02:00
Linus Groh
d859bde337 GameOfLife: Move "ms" interval label to GML
There's no reason not to!
2021-05-16 23:00:21 +02:00
Linus Groh
e7dc0bdba3 GameOfLife: Auto-size toolbar labels 2021-05-16 23:00:21 +02:00
Linus Groh
9a3f62adc7 GameOfLife: Remove some unused includes 2021-05-16 23:00:21 +02:00
Linus Groh
030360c787 GameOfLife: Add some margin to the toolbar layout
Ideally the inner widgets / vertical separators would have some as well,
but I'm not sure how right now. One step at a time. :^)
2021-05-16 23:00:21 +02:00
Linus Groh
f89eb0e4ce GameOfLife: Switch from single indexed vector to rows+columns
This is not only easier to comprehend code-wise and avoids some function
overloads, but also makes resizing the board while preserving game state
*a lot* easier. We now no longer have to allocate a new board on every
resize, we just grow/shrink the individual row vectors.
Also fixes a crash when clicking the board widget outside of the drawn
board area.
2021-05-16 23:00:21 +02:00
Linus Groh
00bfcef5be Base: Make 16x16 Play/Pause/Stop icons a bit smaller
These all looked out of place both when used on a regular button (e.g.
in the SoundPlayer application) and a toolbar action button (e.g. in the
GameOfLife application). This makes them a bit smaller (hand-drawn, not
scaled down).
2021-05-16 23:00:21 +02:00
Liav A
7995e115b8 Kernel/Graphics: Round size value when mapping real framebuffer 2021-05-16 21:59:10 +01:00