Commit graph

120 commits

Author SHA1 Message Date
Ben Wiederhake f19b88c965 Meta: Don't require setting SERENITY_ROOT for refresh script
The need for SERENITY_ROOT was basically eliminated in
73c953b674. The existing guess
'git rev-parse --show-toplevel' should be correct in all conceivable cases.
Most code just assumes the layout in git, or depends on SERENITY_ROOT as
set in the CMakeLists.txt. *Requiring* the user to set it doesn't make
sense anymore.

While I was in there anyway, I added exit code propagation. Also, 'find' should
be a tad faster now, because it doesn't enumerate files in the large ignored
directories Build/ and Toolchain/ anymore.
2020-08-15 13:38:24 +02:00
Andreas Kling a37331e236 Lagom: Add LibHTTP to Lagom (it builds fine without changes) 2020-08-15 00:05:45 +02:00
Peter Nelson a8ad0d120d Meta: allow override of QEMU -cpu argument via environment variable
Introduces a SERENITY_QEMU_CPU environment variable that allows
overriding of the qemu -cpu command line parameter. If not specified,
the argument defaults to "max".

The primary motivation behind this is to be able to enable or disable
specific features for the vCPU in order to workaround QEMU issues with
certain hardware accelerators. For example, QEMU on Windows with WPHX
sometimes fails to start unless Virtual Machine eXtensions are
disabled. This can now be done with:

  export SERENITY_QEMU_CPU="max,vmx=off"
2020-08-14 15:09:59 +02:00
Linus Groh b1e8807bc5 Meta: Check that "#include <LibM/math.h>" is not being used 2020-08-12 16:18:33 +02:00
Nico Weber 00f658b984
Lagom+LibELF: Add an ELF fuzzer, and tweak the code to survive a few minutes of fuzzing (#3071)
If a buffer smaller than Elf32_Ehdr was passed to Image, header()
would do an out-of-bounds read.

Make parse() check for that. Make most Image methods assert that the image
is_valid(). For that to work, set m_valid early in Image::parse()
instead of only at its end.

Also reorder a few things so that the fuzzer doesn't hit (valid)
assertions, which were harmless from a security PoV but which still
allowed userspace to crash the kernel with an invalid ELF file.

Make dbgprintf()s configurable at run time so that the fuzzer doesn't
produce lots of logspam.
2020-08-10 15:55:17 +02:00
Nico Weber 700f5cfc90 Lagom: Pass -Wno-deprecated-copy to clang too
Due to Serenity's use of concepts, it now requires clang 10 or newer,
and clang 10 or newer both understands and requires
-Wno-deprecated-copy.
2020-08-09 21:13:06 +02:00
Nico Weber 9c136be08b disasm: For ELF files, disassemble .text section
Since disasm is built in lagom, this requires adding LibELF to lagom.
2020-08-09 21:12:54 +02:00
Luke 4b6036bc33 Meta: Update CLion configuration to include LibM and generated files
Also bumps the CXX Standard to C++20.
2020-08-06 09:43:03 +02:00
Nico Weber a619943001 Build: Make things build with clang without needing local changes
Useful for sanitizer fuzzer builds.

clang doesn't have a -fconcepts switch (I'm guessing it just enables
concepts automatically with -std=c++2a, but I haven't checked),
and at least the version on my system doesn't understand
-Wno-deprecated-move, so pass these two flags only to gcc.
In return, disable -Woverloaded-virtual which fires in many places.

The preceding commits fixed the handful of -Wunused-private-field
warnings that clang emitted.
2020-08-04 17:42:08 +02:00
Ben Wiederhake aaa13e5739 Meta: Provide a way to only update a file if the output changes
This is only useful for build commands that update their destination in all cases
and thus sometimes confuse cmake into rebuilding everything needlessly.
2020-08-04 11:27:14 +02:00
stelar7 98e18d7339 LibCompress: Add LibCompress
For now this only contains DEFLATE, and a very simple Zlib
Eventually GZip, etc. can go here as well.
2020-08-04 11:27:07 +02:00
Emanuele Torre f128d3baf7 Meta: make check-style.sh ignore Libraries/LibCore/puff.cpp
This file was formerly named `Libraries/LibCore/puff.c` and it was not
checked by `check-style.sh` because it only checks .h and .cpp files.

Since this file was not written by us, we shouldn't check its style.

This file was also causing our Travis builds to fail.
2020-07-29 17:36:21 +02:00
Nico Weber c7652a2166 Lagom: Clean up glob after puff.c -> puff.cpp rename 2020-07-29 15:11:04 +02:00
Ben Wiederhake eccf96b703 Meta: Find potentially missing resources 2020-07-29 01:34:22 +02:00
Ben Wiederhake 8aa6b13caa Meta: Ensure that icons and other resources remain non-executable 2020-07-29 01:34:22 +02:00
Peter Elliott fc425a218d Meta: Fix style of image building scripts
Oops. I didn't know there was a style guide for the scripts.
2020-07-28 19:09:44 +02:00
Peter Elliott 6f12ab3ced Meta: Calculate image size based on size of Build/Root and Base
This reduces the size of the default build, while allowing people to
install as many ports as they want, without having to manually specify
disk size.
2020-07-28 18:32:05 +02:00
Peter Elliott 207fb054e5 Userland: Add passwd utility 2020-07-28 17:07:22 +02:00
Andreas Kling 96dce6893f Lagom: Build with -std=c++2a -Wno-deprecated-copy 2020-07-27 21:54:22 +02:00
Nico Weber 3f45e9ab1e Lagom: Add LibGemini, LibGfx
They are dependencies of LibWeb and might be useful for
running test-web on GitHub actions one day.
2020-07-23 23:02:28 +02:00
Luke 60599d03dd LibWeb+test-web: Create test-web program, add doctype test
LibWeb currently has no test suite or program. Let's change that :^)

test-web is mostly a copy of test-js, but modified for LibWeb.
test-web imports both LibJS/Tests/test-common.js and
LibWeb/Test/test-common.js

LibWeb's suite provides the ability to specify the page to load,
what to do before the page is loaded, and what to do after it's
loaded.

This also provides a test of document.doctype and its close sibling
document.compatMode.

Currently, this isn't added to Lagom because of CodeGenerators.
2020-07-23 13:11:41 +02:00
Nico Weber c22790adb2 Lagom: Add a markdown fuzzer 2020-07-14 17:45:16 +02:00
Nico Weber 417caeb14a Lagom: Add a note on how to build the fuzzers to readme 2020-07-14 17:45:16 +02:00
Andreas Kling 81ea9d1ef6 Base: Turn a whole bunch of /bin symlinks into shell aliases :^) 2020-07-07 11:35:22 +02:00
Matthew Olsson b9cf7a833f LibJS/test-js: Create test-js program, prepare for test suite refactor
This moves most of the work from run-tests.sh to test-js.cpp. This way,
we have a lot more control over how the test suite runs, as well as how
it outputs. This should result in some cool functionality!

This commit also refactors test-common.js to mimic the jest library.
This should allow tests to be much more expressive :)
2020-07-06 23:40:35 +02:00
Nico Weber e91dd14fab run.sh: Remove cpu_reset debug output
It's fairly wordy and early OS startup seems to work well,
so this doesn't have to be on by default.
2020-07-06 17:03:26 +02:00
AnotherTest 2b80a45f82 Meta: Do not run shellcheck on our Shell's scripts 2020-07-05 15:43:14 +02:00
AnotherTest 639c1a1737 Shell: Build as part of Lagom as well
Bringing the Serenity Shell to your very own host system :^)
2020-07-05 15:43:14 +02:00
Andreas Kling 8661af9b72 Profiler: Rename from ProfileViewer :^) 2020-07-01 19:43:17 +02:00
Emanuele Torre 6f8042d8e5 Meta: make Meta/run.sh qgrub work. 2020-07-01 12:53:39 +02:00
Emanuele Torre 8f071137d1 Meta: Give SERENITY_ROOT a default value in CLion/run.sh 2020-07-01 12:53:39 +02:00
Emanuele Torre e62475d6e7 Meta: run.sh: fix usage comments 2020-07-01 12:53:39 +02:00
Emanuele Torre 1d9791bcdf Meta: Allow running run.sh from any where by setting SERENITY_BUILD
If SERENITY_BUILD is not set or empty, SERENITY_BUILD is treated as if
it was set to '.'.

`run.sh` will cd to SERENITY_BUILD before running the emulator.

Also, export SERENITY_BUILD in `Meta/CLion/run.sh` since we are using it
in `Meta/run.sh`.

Also, allow using a different bochs configuration file by setting the
SERENITY_BOCHSRC variable.
2020-07-01 12:53:39 +02:00
Emanuele Torre aabb482d5c Meta: move Kernel/.bochsrc => Meta/bochsrc
The run script is not in Kernel/ anymore, let's move `.bochsrc` in Meta/
so that it can be used with the new build system.

Also make bochs use `grub_disk_image` instead of `_disk_image`
2020-07-01 12:53:39 +02:00
Emanuele Torre 86685623a2 Meta: CLion/run.sh should be executable 2020-07-01 12:53:39 +02:00
Emanuele Torre 8233ab197f Meta: make CLion/run.sh use run.sh
We don't need to copy `run.sh` and modify it: we can just set
environment variables.

Now, we don't have to modify two files everytime we make a change to the
run.sh script.

Also make SERENITY_BUILD overridable with environment variables,why not?
2020-07-01 12:53:39 +02:00
Emanuele Torre f7f1c3d748 Meta: use "better" syntax to set SERENITY_KERNEL_CMDLINE in run.sh :^)
This removes some FIXMEs.

In bash, we could avoid `shift`:
    SERENITY_KERNEL_CMDLINE="${@:2}"

But let's stick to POSIX sh for now.
2020-07-01 12:53:39 +02:00
Emanuele Torre 0cee39355c Meta: quote variables in run.sh where it makes sense 2020-07-01 12:53:39 +02:00
AnotherTest 880c3fb83f Userland: Add a 'test' utility
This adds an incomplete implementation of the test util, missing some
user/group checks, and `-l STRING`.
It also symlinks '[' to 'test'.
2020-06-27 16:08:52 +02:00
Emanuele Torre 8e24a17d0d Meta: default SUDO_UID and SUDO_GID to 0 in build-image-*.sh scripts
In the GNU coreutils version of chown, ":" is a valid argument
(the command will result in a no-op), but POSIX chown does not
consider that valid.

If the user who ran build-image-*.sh was root, SUDO_UID and SUDO_GID
would not be set and, if the version of chown installed on the system
did not allow passing just a ":" as argument, the script would fail.

Let's default the value of SUDO_UID and SUDO_GID to 0 just in case.
2020-06-21 10:13:04 +02:00
Emanuele Torre 4a784d4d1b Meta: get rid of sync.sh using the technique used in the previous commit 2020-06-21 10:13:04 +02:00
Emanuele Torre e42f4abd61 Meta: tweak build-image-grub.sh to allow running make grub-image..
without sudo.
2020-06-21 10:13:04 +02:00
Andreas Kling fbfae033cc Meta: Tweak QtCreator .files sync script to include .idl files 2020-06-21 00:58:55 +02:00
Andreas Kling 6e78279614 keymap: Add back a tiny utility for setting the system keyboard layout
This patch removes the setuid-root flag from the KeyboardSettings GUI
application and adds back the old "keymap" program.

It doesn't feel very safe and sound to have a GUI program runnable
as setuid-root, so in the next patch I'll be making KeyboardSettings
call out to the "keymap" program to do its bidding.
2020-06-18 22:19:57 +02:00
Andreas Kling c45c5ded34 WebContent: Start work on browser process separation :^)
The "WebContent" service provides a very restricted instance of LibWeb
running as an unprivileged user account. This will be used to implement
process separation in Browser, among other things.

This first cut of the service only spawns a single WebContent process
when someone connects to /tmp/portal/webcontent. We will soon switch
this over to spawning a new process for each connection.

Since this feature is very immature, we'll be bringing it up inside of
Demos/WebView as a separate demo program. Eventually this will become
a reusable widget that anyone can embed and easily get out-of-process
web content in their GUI.

This is pretty, pretty cool! :^)
2020-06-17 20:09:44 +02:00
Andreas Kling 723f4e5ee6 Meta: Scale back overly informal user-facing strings
We were getting a little overly memey in some places, so let's scale
things back to business-casual.

Informal language is fine in comments, commits and debug logs,
but let's keep the runtime nice and presentable. :^)
2020-06-17 18:35:49 +02:00
Sergey Bugaev 8ecac16c03 Base+Meta: Rename the wheel group to goodboys :^) 2020-06-17 15:02:03 +02:00
Matthew Olsson e8e728454c AK: JsonParser improvements
- Parsing invalid JSON no longer asserts
    Instead of asserting when coming across malformed JSON,
    JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
  parse() call. Examples of things that were valid and no longer are:
    - undefineddfz
    - {"foo": 1}abcd
    - [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
2020-06-13 12:43:22 +02:00
Andreas Kling 5448a670c0 Base: Symlink /dev/urandom to /dev/random
Some software expects to find /dev/urandom so we might as well provide.
Gets rid of one dropbear patch. :^)
2020-06-08 21:42:33 +02:00
Hüseyin ASLITÜRK ddeb0ab1ad Applications: Add new KeyboardSettings application
GUI application to manage Keyboard settings.
2020-06-08 09:28:18 +02:00