Commit graph

600 commits

Author SHA1 Message Date
x-yl 410eb9e9ff Meta: Don't use SPICE if QEMU doesn't support it
I do seem to have a tendency for breaking everyone's builds :/
2021-07-14 17:17:06 +02:00
x-yl 6b68f16f2c Meta: Change QEMU options in run.sh to use SPICE
If QEMU has the qemu_vdagent chardev (should be present in QEMU 6.1)
then we use that as the SPICE client.

If qemu_vdagent is not present, no SPICE client will be launched by
default because it makes the display a bit choppy.

Set SERENITY_SPICE to override the default behavior and use your default
SPICE client.
2021-07-14 12:33:07 +02:00
Liav A 11fe38346c Meta: Remove options of explicit command line runners in run script
Let's remove the qcmd and q35_cmd options and instead have a simple
"q35" run option. Specifiying the kernel command line was a neat trick
I personally used for many debug sessions, but it seems better to stick
to setting it internally in the kernel or modifying the shell
SERENITY_KERNEL_CMDLINE environment variable to do this.
2021-07-13 23:24:16 +02:00
Liav A c92c944356 Meta: Tweak qemu run script to use pcie-root-ports
With this change, we use 6 PCIe root ports in the Q35 machine, and plug
the bochs-display device into one of those PCIe ports.
We plug the bochs-display as function 0 of that device, because
otherwise SeaBIOS and also the kernel will not detect its presence.
2021-07-13 23:24:16 +02:00
Idan Horowitz f09e361eef CI: Disallow spaces just before the separating colon in commit titles 2021-07-13 19:56:14 +01:00
Gunnar Beutner 77795b2c8f Meta: Make sure files are installed with the right UID and GID
Unfortunately we can't just use --chown everywhere because only rsync
version 3.1 and newer support it and the default rsync on macOS is
2.6.9.

Fixes #8711.
2021-07-13 13:30:29 +02:00
Gunnar Beutner 7347c20fe6 Meta: Fix QEMU detection for WSL2 if QEMU isn't installed on the C drive 2021-07-13 12:57:21 +02:00
Luke 448e8c6f45 Lagom/Fuzzers: Add fuzzer for FLAC loader 2021-07-13 01:15:46 +02:00
Luke 93340685ed Lagom/Fuzzers: Add fuzzer for POSIX basic regex parser 2021-07-13 01:34:22 +04:30
Andrew Kaster 8823548a4e Meta: Skip WebAssembly loop test generation
This test hangs and times out.
2021-07-12 18:42:45 +04:30
Andrew Kaster 1455604b13 AK+Meta: Remove unused AUTOCOMPLETE_DEBUG flag 2021-07-12 12:26:52 +02:00
Gunnar Beutner 7d38057705 Meta: Only use -display sdl for multiple screens when it's available 2021-07-11 23:27:43 +02:00
Gunnar Beutner bc5d50e78b Meta: Use gl=off for QEMU by default 2021-07-11 22:07:47 +02:00
Gunnar Beutner 8e4978fe04 Meta: Use the SDL backend for QEMU on Windows 2021-07-11 22:07:47 +02:00
x-yl 642aa65310 Meta: Only try to use SDL when there are multiple displays
SDL brings with it an annoying issue whereby trying to resize the window
before Serenity starts up prevents it from automatically resizing to fit
the screen.

This patch makes the previous behavior (i.e using the GTK backend) the
default unless SERENITY_SCREENS is greater than 1.
2021-07-11 21:16:56 +02:00
Gunnar Beutner baf40ad96d Documentation+Meta: Automatically add disable_virtio on Windows 2021-07-10 23:24:45 +02:00
Gunnar Beutner cc87bf46c1 Documentation+Meta: Automatically set vmx=off on Windows 2021-07-10 23:24:45 +02:00
Gunnar Beutner ee7e9f05a8 Meta: Automatically use WSL paths on Windows 2021-07-10 23:24:45 +02:00
Gunnar Beutner 9026dbbfd6 Documentation: Reorganize the build documentation 2021-07-10 23:24:45 +02:00
Gunnar Beutner 9780cdfb33 Meta: Automatically pick an appropriate GCC binary 2021-07-10 23:24:45 +02:00
Jan de Visser 99dc3469e8 Lagom: Exclude LibSQL/SQLClient.cpp and the sql utility from Lagom
Lagom doesn't seem to like IPC services, and sql needs SQLClient.
2021-07-08 17:55:59 +04:30
Jan de Visser a034774e3a LibSQL+SQLServer: Build SQLServer system service
This patch introduces the SQLServer system server. This service is
supposed to be the only process/application talking to database storage.
This makes things like locking and caching more reliable, easier to
implement, and more efficient.

In LibSQL we added a client component that does the ugly IPC nitty-
gritty for you. All that's needed is setting a number of event handler
lambdas and you can connect to databases and execute statements on them.

Applications that wish to use this SQLClient class obviously need to
link LibSQL and LibIPC.
2021-07-08 17:55:59 +04:30
Max Wipfli 2d71eaadcd Meta: Add the ConfigureComponents utility
This adds a utility program which is essentially a command generator for
CMake. It reads the 'components.ini' file generated by CMake in the
build directory, prompts the user to select a build type and optionally
customize it, generates and runs a CMake command as well as 'ninja
clean' and 'rm -rf Root', which are needed to properly remove system
components.

The program uses whiptail(1) for user interaction.
2021-07-06 21:54:51 +02:00
Ali Mohammad Pur f5d4e26ff7 Meta+LibWasm: Correctly parse the invokee name in toplevel invokes 2021-07-06 17:55:00 +04:30
Ali Mohammad Pur 963f5e69e0 Meta+LibWasm: Generate calls to functions when they don't have results 2021-07-06 17:55:00 +04:30
Idan Horowitz 53f70e5208 LibJS: Remove the default length & attributes from define_native_*
These are usually incorrect, and people sometimes forget to add the
correct values as a result of them being optional, so they should just
be specified explicitly.
2021-07-06 14:20:30 +01:00
Idan Horowitz a6b8291a9b LibJS: Add define_direct_property and remove the define_property helper
This removes all usages of the non-standard define_property helper
method and replaces all it's usages with the specification required
alternative or with define_direct_property where appropriate.
2021-07-06 14:20:30 +01:00
Gunnar Beutner 5c3f781031 Meta: Fix building Lagom on Linux 2021-07-06 02:10:37 +02:00
Gunnar Beutner 01db5205ab LibThreading: Fix building the library on macOS 2021-07-06 00:06:32 +02:00
Linus Groh 7efc52c3d3 Meta: Remove the LibJS OBJECT_DEBUG debug macro
I didn't add any debug logging to the object rewrite, so this is now
unused. It's much more correct though, so we can get away with adding
ad-hoc logging, should that ever be necessary :^)

Side note: this should have a prefix, i.e. JS_OBJECT_DEBUG. The previous
name is too generic.
2021-07-04 22:07:36 +01:00
Andreas Kling 49d0b9e808 LibTTF: Memory map TTF fonts instead of reading them into heap memory
All GUI applications currently load all TTF fonts on startup
(to populate the Gfx::FontDatabase. This could probably be smarter.)

Before this patch, everyone would open the files and read them into
heap-allocated storage. Now we simply mmap() them instead. :^)
2021-07-04 21:34:26 +02:00
Andreas Kling 560109bd42 LibTTF: Make TTF::Font loading API return error strings 2021-07-04 21:34:26 +02:00
Gunnar Beutner de152832be Meta: Add missing quotes in Meta/run.sh 2021-07-03 20:08:54 +02:00
Idan Horowitz 0e35c50da3 Meta: Use virtualization acceleration if available in CI runs 2021-07-03 18:32:39 +01:00
Liav A 70278d57ba Meta: Add a few more graphics devices to the Q35 for testing purposes 2021-07-03 16:28:49 +02:00
Gunnar Beutner d0c4524234 Meta: Provide better instructions when QEMU is not installed or too old 2021-07-03 12:06:20 +02:00
Gunnar Beutner 0ec1077bcb Meta: Prefer to use the QEMU binaries from the toolchain directory 2021-07-03 12:06:20 +02:00
Liav A acd2604a31 Revert "Revert "Revert "Kernel: Fix PCI layout of i440fx QEMU machine"""
This reverts commit a808fff2ec.

I highly suspect the reason it was not working before was fixed in
017c5fc7d9, so the SB16 DMA can work even
if we initialize another E1000 network adapter.
2021-07-02 13:16:12 +02:00
Idan Horowitz 3265141286 Meta: Make serenity.sh pass the SERENITY_ARCH cmake argument for x86_64
This is required as our CMake config defaults to i686 if not overriden
manually via the SERENITY_ARCH argument.
2021-07-01 18:08:16 +02:00
Gal Horowitz d0c7a48186 Meta: Add environment variable for disabling qemu's gdb socket
When running QEMU on windows, the `-s` does not work, and causes QEMU to
crash, you can now use the environment variable to disable that option.
2021-06-30 18:49:04 +01:00
Gal Horowitz eed6adb6fc Meta: Do not use gl=on if building in WSL2
The existing check only detects WSL1, this adds a new check which also
detects WSL2.
2021-06-30 18:49:04 +01:00
Liav A 3d89938c4a SystemServer+Meta: Use the new SysFS
We make SystemServer to mount the new SysFS in /sys.
2021-06-29 20:53:59 +02:00
Gunnar Beutner 449d34a154 Meta: Change default GDB layout
This adds a TUI window that displays disassembly/source code which
I've found quite useful.
2021-06-29 20:03:36 +02:00
Gunnar Beutner 0cb937416b Meta: Install 64-bit libgcc_s.so for x86_64 targets 2021-06-28 22:29:28 +02:00
Sahan Fernando 16eb0803fc Meta: Choose the QEMU display backend based on whats available 2021-06-28 07:01:11 +04:30
stelar7 1f33c517df Meta: Do not use gl=on if building in WSL 2021-06-27 15:48:08 +02:00
Sahan Fernando 44174a44bd Meta: Use virtio-vga instead of virtio-gpu if using multiple monitors 2021-06-26 18:45:35 +02:00
Tom 8fe52b8306 Meta: Force relative mouse coordinates with multiple screens
QEMU appears to always relay absolute mouse coordinates relative to the
screen that the mouse is pointed to, without any way for us to know
what screen it was. So, when dealing with multiple displays force using
relative coordinates only.
2021-06-25 23:54:37 +02:00
Tom 3d5340d033 Meta: Add SERENITY_SCREENS environment variable
This allows specifying how many screens we should use. This also then
only enables virtio-gpu if more than one display is requested.

This also adds an environment variable SERENITY_QEMU_DISPLAY_BACKEND
which allows overriding the default qemu display backend, as it may
not be available.
2021-06-25 22:20:55 +02:00
Sahan Fernando b9ad6058aa Kernel: Add VirtIOGPU graphics device 2021-06-25 19:26:30 +02:00
kleines Filmröllchen 988763c0ef Toolchain: Add the AFLACLOADER_DEBUG macro
This enables FLAC debugging output, which is used
with the new FLAC loader introduced in later commits.
2021-06-25 20:48:14 +04:30
Gunnar Beutner f17b4e561f Meta: Increase RAM amount for Bochs
Booting with 128 MB of RAM is kind of tough.
2021-06-25 15:19:09 +02:00
Gunnar Beutner c9747a3236 Kernel: Build the x86_64 kernel as an ELF32 executable
Multiboot only supports ELF32 executables. This changes the build
process to build an ELF32 executable which has a 32-bit entry point,
but consists of mostly 64-bit code.
2021-06-25 15:19:09 +02:00
Gunnar Beutner 1979c7d185 Meta: Run 64-bit kernels with qemu-system-x86_64 2021-06-25 15:19:09 +02:00
Jan de Visser 4198f7e1af LibSQL: Move Lexer and Parser machinery to AST directory
The SQL engine is expected to be a fairly sizeable piece of software.
Therefore we're starting to restructure the codebase for growth.
2021-06-24 00:36:53 +02:00
coderdreams 9ffb3e7e30 LibCore: Add unit test for File::read_line 2021-06-22 18:54:40 +04:30
Ali Mohammad Pur 79d4913f76 LibWasm: Generate all spec tests, even ones that aren't valid modules
`wasm-as` will do some semantic analysis on the modules, which is not
something we're looking for here.
Instead, use `wat2wasm` to generate the exact module.
2021-06-22 00:26:25 +04:30
Ali Mohammad Pur 9c5d38b7db Meta+LibWasm: Add support for module linking tests
This commit makes the linking tests in the wasm spec test run.
2021-06-22 00:26:25 +04:30
Peter Bocan 4d5ffd364a LibCrypto+LibTLS: Split and move test suite into Tests directory
This change splits test-crypto.cpp from Userland into separate test
suites located in Tests/ directory.
2021-06-19 19:05:36 +04:30
Itamar 03ef2a479a LibCoreDump: Include source locations of inlined functions in backtrace 2021-06-19 14:51:18 +02:00
Luke f29036dc98 Lagom/Fuzzers: Add fuzzers for all current hashing functions
Namely MD5, SHA1, SHA256, SHA384 and SHA512.
2021-06-18 21:44:56 +01:00
Sam Atkins 0e680cb17a Meta: Ensure long messages fit in commit tweet
Abbreviating the commit message to 240 characters was not always enough.
As a bonus, we now add an ellipsis to abbreviated messages.
2021-06-18 13:34:17 +01:00
sin-ack e2215cc0e1 Lagom: Add an install target
This is used by libjs-test262-runner to be able to copy the libraries
within its own build directory in order to link with them.
2021-06-17 21:20:24 +01:00
Gunnar Beutner 6e094b8dbe Meta: Increase additional space for disk images
Previously we'd add 100MB on top of what du returned for the Root
directory. This increases that to 500MB.
2021-06-17 11:03:51 +02:00
Gunnar Beutner d7a03397af Meta: Allow building images without most utilities
Previously the build script assumed that certain utilities were always
available.
2021-06-17 11:03:51 +02:00
Gunnar Beutner 0dd03413d6 Meta: Add support for declaring components
Components are a group of build targets that can be built and installed
separately. Whether a component should be built can be configured with
CMake arguments: -DBUILD_<NAME>=ON|OFF, where <NAME> is the name of the
component (in all caps).

Components can be marked as REQUIRED if they're necessary for a
minimally functional base system or they can be marked as RECOMMENDED
if they're not strictly necessary but are useful for most users.

A component can have an optional description which isn't used by the
build system but may be useful for a configuration UI.

Components specify the TARGETS which should be built when the component
is enabled. They can also specify other components which they depend on
(with DEPENDS).

This also adds the BUILD_EVERYTHING CMake variable which lets the user
build all optional components. For now this defaults to ON to make the
transition to the components-based build system easier.

The list of components is exported as an INI file in the build directory
(e.g. Build/i686/components.ini).

Fixes #8048.
2021-06-17 11:03:51 +02:00
Brian Gianforcaro f0fbaa00a4 Meta: Remove gdb pretty printer for AK::InlineLinkedList 2021-06-16 10:40:01 +02:00
Ali Mohammad Pur 1414c7b049 LibJS: Add a basic pass manager and add some basic passes
This commit adds a bunch of passes, the most interesting of which is a
pass that merges blocks together, and a pass that places blocks that
flow into each other next to each other, and a very simply pass that
removes duplicate basic blocks.
Note that this does not remove the jump at the end of each block in that
pass to avoid scope creep in the passes.
2021-06-15 22:06:33 +04:30
networkException 472721b774 Everywhere: Use new discord invite url :^)
Replaces all instances of the previous discord invite link
with a shiny new vanity url.
2021-06-14 22:41:37 +01:00
Apoorv Mishra f32ab73acc
Meta: Fix QEMU version check in run.sh
The QEMU version check in `Meta/run.sh` fails on macOS because the BSD
version of `grep` does not support the `-P` option. Using `sed` instead.
2021-06-13 12:05:48 +01:00
Jesse Buhagiar 06f1edb516 USB: Further Implement USB Structures
These are the actual structures that allow USB to work (i.e the ones
actually defined in the specification). This should provide us enough
of a baseline implementation that we can build on to support
different types of USB device.
2021-06-12 18:17:25 +04:30
x-yl ac712b07f9 Meta: Fuzz the LibIMAP Parser 2021-06-11 23:58:28 +04:30
Gunnar Beutner 87b1da4441 Revert "Meta: Use Intel 82574 instead of Intel 82540 in the run script"
This reverts commit 84b2dc0fb8.
2021-06-11 11:32:19 +02:00
Idan Horowitz a898e01d4d Kernel: Add driver for RTL8168 & RTL8111 NICs
These are pretty common on older LGA1366 & LGA1150 motherboards.

NOTE: Since the registers datasheets for all versions of the chip
besides versions 1 - 3  are still under NDAs i had to collect
several "magical vendor constants" from the *BSD driver and the
linux driver that i was not able to name verbosely, and as such
these are labeled with the comment "vendor magic values".
2021-06-10 21:54:51 +02:00
Liav A 84b2dc0fb8 Meta: Use Intel 82574 instead of Intel 82540 in the run script 2021-06-09 22:44:09 +04:30
Liav A c6480a0426 Kernel/Net: Support Intel 82574 adapter
We call it E1000E, because the layout for these cards is somewhat not
the same like E1000 supported cards.

Also, this card supports advanced features that are not supported on
8254x cards.
2021-06-09 22:44:09 +04:30
Apoorv Mishra 5d57384bc4 Meta: Check installed QEMU version
`ninja install` fails with a clueless error message if the installed
QEMU version is less than 5.0.
2021-06-09 18:53:32 +02:00
Andreas Kling 675b0aee24 Websites: Some updates for the serenityos.org front page
- Add link to the Discord server
- Remove reference to Freenode IRC channel since it's no longer used
- Add sponsorship links for Linus :^)
2021-06-08 10:56:52 +02:00
Andreas Kling 7cbe4daa7c LibJS: Move bytecode debug spam behind JS_BYTECODE_DEBUG :^) 2021-06-07 18:11:59 +02:00
FalseHonesty 403bb07443 LibVideo: Scaffold LibVideo and implement simplistic Matroska parser
This commit initializes the LibVideo library and implements parsing
basic Matroska container files. Currently, it will only parse audio
and video tracks.
2021-06-06 17:47:00 +02:00
Ali Mohammad Pur 51c2c69357 AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
2021-06-06 00:27:30 +04:30
Ali Mohammad Pur d7ba15371b Meta: Don't make wasm tests pass when they cannot read a module
Instead, just let them be treated as failing their respective test.
2021-06-04 16:07:42 +04:30
NonStandardModel c4c577b2bf Meta: Sort debug macros alphabetically 2021-06-03 18:44:45 +01:00
Ali Mohammad Pur 6b5d1eedcb Meta: Make the wasm test generator cast numbers to i32 when needed
Otherwise the sign would be out of whack
2021-06-02 16:09:16 +04:30
Ali Mohammad Pur 7fb458b7c9 Meta: Generate failing tests for unsupported assertions in wasm tests
Let's not ignore a test just because our test generator doesn't
understand it, assume the worst and generate a failing test case
instead.
2021-06-02 16:09:16 +04:30
Linus Groh 21a62fe836 Meta: Remove duplicated ensure_toolchain from serenity.sh 2021-06-02 00:34:41 +01:00
Jelle Raaijmakers 468bb54677 Meta: Make serenity.sh invoke cmake when build.ninja is missing 2021-06-01 11:33:56 +01:00
Max Wipfli 0d0ed4962f AK: Add a new, spec-compliant URLParser
This adds a new URL parser, which aims to be compliant with the URL
specification (https://url.spec.whatwg.org/). It also contains a
rudimentary data URL parser.
2021-06-01 09:28:05 +02:00
Nick Miller 10ba6f254c Kernel: Rename instances of IO port 0xe9 to BOCHS_DEBUG_PORT 2021-05-31 19:06:13 +01:00
Luke 3bc2527ce7 Lagom/Fuzzers: Add SQL parser fuzzer 2021-05-31 17:07:52 +04:30
Brian Gianforcaro 26cb64573c CMake: Hide KMALLOC_VERIFY_NO_SPINLOCK_HELD so folks don't find it
Since I introduced this functionality there has been a steady stream of
people building with `ALL_THE_DEBUG_MACROS` and trying to boot the
system, and immediately hitting this assert. I have no idea why people
try to build with all the debugging enabled, but I'm tired of seeing the
bug reports about asserts we know are going to happen at this point.

So I'm hiding this value under the new ENABLE_ALL_DEBUG_FACILITIES flag
instead. This is only set by CI, and hopefully no-one will try to build
with this thing (It's documented as not recommended).

Fixes: #7527
2021-05-31 11:30:47 +01:00
Gunnar Beutner 5f18cf75c5 AK: Replace ByteBuffer::grow with resize()/ensure_capacity()
Previously ByteBuffer::grow() behaved like Vector<T>::resize().
However the function name was somewhat ambiguous - and so this patch
updates ByteBuffer to behave more like Vector<T> by replacing grow()
with resize() and adding an ensure_capacity() method.

This also lets the user change the buffer's capacity without affecting
the size which was not previously possible.

Additionally this patch makes the capacity() method public (again).
2021-05-31 14:49:00 +04:30
Andreas Kling 33f2eeea4a pls: Drastically simplify this program
Since this program is setuid-root, it should be as simple as possible.

To that end, remove `/etc/plsusers` and use filesystem permissions to
achieve the same thing. `/bin/pls` is now only executable by `root` or
members of the `wheel` group.

Also remove all the logic that went to great lengths to `unveil()` a
minimal set of filesystem paths that may be used for the command.
The complexity-to-benefit ratio did not seem justified, and I think
we're better off keeping this simple.

Finally, remove pledge promises the moment they are no longer needed.
2021-05-30 23:09:37 +02:00
Edwin Hoksberg e68780e1ad WebServer: Put dbgln's behind WEBSERVER_DEBUG
These dbgln's caused excessive load in the WebServer process,
accounting for ~67% of the processing time when serving a webpage
with a bunch of resources like serenityos.org/happy/2nd/.
2021-05-30 17:41:56 +01:00
Ben Wiederhake 774107f37c Fuzz+LibGfx: When fuzzing GIFLoader, try to load all frames 2021-05-30 14:42:34 +01:00
Jesse Buhagiar d44e2c9ad9 Userland: Check sudoers file perms and owner in pls
As per comment found in #6319 by @bcoles, `pls` should check the
permissions and owner of the sudoers file to ensure that it hasn't
been compromised.
2021-05-29 22:33:12 +04:30
Jesse Buhagiar 82b48d867d Userland: Implement pls, a sudo clone 2021-05-29 22:33:12 +04:30
Andrew Kaster 3ece67d62d Meta/CI: Remove IRC notifications
With the increased volume of PRs being opened and merged lately,
multiple people have complained that the IRC is absolutely flooded with
SerenityBot posts. Remove the IRC notifications from the CI scripts, and
the Meta script that handles parsing the github actions context into
an IRC message.
2021-05-29 19:35:49 +02:00
Liav A c1a4dfeffb Kernel/Graphics: Remove unnecessary derived FramebufferDevice classes
It seems like overly-specific classes were written for no good reason.
Instead of making each adapter to have its own unique FramebufferDevice
class, let's generalize everything to keep implementation more
consistent.
2021-05-27 22:39:13 +02:00
Ali Mohammad Pur 0e4431af33 Meta: Run the Wasm spec tests in CI
Since LibWasm is still not capable of passing all of the spec tests,
ignore failing tests, only fail the build if some segfault/abort/etc
occurs.
2021-05-27 17:28:41 +04:30