Commit Graph

344 Commits

Author SHA1 Message Date
Brian Gianforcaro
265e155181 Meta: Use basename for serenity.sh help message
I have this symlinked into ~/bin, when looking at the help/usage
it would previously print the fully qualified path to the script
making the help very difficult to read.
2021-04-15 17:47:09 +02:00
Peter Elliott
938924f36d Meta: Add install-ports CMake target
install-ports copys the necessary files from Ports/ to /usr/Ports. Also
refactor the compiler and destiation variables from .port_include.sh
into .hosted_defs.sh. .hosted_defs.sh does not exists when ports are
built in serenity
2021-04-12 14:06:24 +02:00
Andreas Kling
251018676f Everywhere: Update references from ReadMe.md => README.md 2021-04-11 10:52:25 +02:00
Andreas Kling
19987a9112 Meta: Update the screenshot in the ReadMe :^)
It's been almost a year since the last one, and things look a bit
different so let's add a new screenshot.
2021-04-04 09:57:36 +02:00
Liav A
8e3e3a71cb Kernel: Introduce a new HID subsystem
The end goal of this commit is to allow to boot on bare metal with no
PS/2 device connected to the system. It turned out that the original
code relied on the existence of the PS/2 keyboard, so VirtualConsole
called it even though ACPI indicated the there's no i8042 controller on
my real machine because I didn't plug any PS/2 device.
The code is much more flexible, so adding HID support for other type of
hardware (e.g. USB HID) could be much simpler.

Briefly describing the change, we have a new singleton called
HIDManagement, which is responsible to initialize the i8042 controller
if exists, and to enumerate its devices. I also abstracted a bit
things, so now every Human interface device is represented with the
HIDDevice class. Then, there are 2 types of it - the MouseDevice and
KeyboardDevice classes; both are responsible to handle the interface in
the DevFS.

PS2KeyboardDevice, PS2MouseDevice and VMWareMouseDevice classes are
responsible for handling the hardware-specific interface they are
assigned to. Therefore, they are inheriting from the IRQHandler class.
2021-04-03 11:57:23 +02:00
Brendan Coles
666aeecaa2 Meta: Resolve some pylint violations in Python lint scripts
Resolves:

* all: consider-using-sys-exit
* all: wrong-import-order
* all: TODO: Require that a few keys are set? (fixme)
* some: missing-function-docstring
* some: line-too-long
2021-04-02 23:07:58 +02:00
Linus Groh
f418115f1b LibJS: Add initial support for Promises
Almost a year after first working on this, it's finally done: an
implementation of Promises for LibJS! :^)

The core functionality is working and closely following the spec [1].
I mostly took the pseudo code and transformed it into C++ - if you read
and understand it, you will know how the spec implements Promises; and
if you read the spec first, the code will look very familiar.

Implemented functions are:

- Promise() constructor
- Promise.prototype.then()
- Promise.prototype.catch()
- Promise.prototype.finally()
- Promise.resolve()
- Promise.reject()

For the tests I added a new function to test-js's global object,
runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs().
By design, queued jobs normally only run after the script was fully
executed, making it improssible to test handlers in individual test()
calls by default [2].

Subsequent commits include integrations into LibWeb and js(1) -
pretty-printing, running queued promise jobs when necessary.

This has an unusual amount of dbgln() statements, all hidden behind the
PROMISE_DEBUG flag - I'm leaving them in for now as they've been very
useful while debugging this, things can get quite complex with so many
asynchronously executed functions.

I've not extensively explored use of these APIs for promise-based
functionality in LibWeb (fetch(), Notification.requestPermission()
etc.), but we'll get there in due time.

[1]: https://tc39.es/ecma262/#sec-promise-objects
[2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-02 10:47:40 +02:00
Idan Horowitz
3b201da473 Utilities: Add simple traceroute utility
This utility traces the route packets take to a user specified host.

QEMU user networking (the type of networking we currently have setup)
does not support sending "real" raw IPv4 packets, and as such we cant
specify a custom TTL value. As a result, this utility will only work
on real hardware, qemu setup with tun networking (requires root) and
other hypervisors that support bridged adapters (VirtualBox/VMWare).
2021-03-31 23:42:24 +02:00
Luke
1ff6f2b4b2 Lagom/Fuzzers: Add fuzzer for zip file parser 2021-03-27 16:28:34 +01:00
Linus Groh
ad4cc19ca0 Meta: Pass arguments to 'serenity.sh run lagom' executable 2021-03-24 20:38:05 +01:00
Andreas Kling
d20e3dbe8b LibGUI: Remove one ancient GMENU_DEBUG debug log 2021-03-23 20:37:39 +01:00
Itamar
4cb38f6dd8 CI: Don't fail check-symbols if symbol is defiend somewhere else 2021-03-19 22:55:53 +01:00
Andreas Kling
d792200a55 LibJS: Rename GlobalObject::initialize() => initialize_global_object()
This function was shadowing Object::initialize() which cannot be called
on global objects and has a different set of parameters.
2021-03-17 16:53:35 +01:00
Luke
c983e42e8c Lagom/Fuzzers: Add fuzzers for the new Gzip and Deflate compressors 2021-03-14 11:28:12 +01:00
Luke
d27e6f0961 Lagom/Fuzzers: Add fuzzers for Latin 1, Latin 2 and UTF16-BE
No fuzzer for UTF-8 as it (currently) just returns the input.
2021-03-14 11:27:52 +01:00
Jean-Baptiste Boric
800dca3834 Kernel: Implement triply indirect block support in Ext2FSInode 2021-03-13 09:27:18 +01:00
Linus Groh
89602c6fc0 Meta: Support 'serenity.sh gdb lagom' 2021-03-12 21:27:09 +01:00
Linus Groh
eb5b2b4b4f Lagom: Add 'test' command to serenity.sh 2021-03-12 21:27:09 +01:00
Linus Groh
04fc4a8134 Meta: Make 'serenity.sh run lagom' run Lagom executables
Running the tests will be moved to a separate test command which can
then leverage the availability of different targets and run either unit
tests on the host or the image in QEMU in self-test mode. :^)
2021-03-12 21:27:09 +01:00
Linus Groh
1c85ce0324 Meta: Don't depend on toolchain for lagom target in serenity.sh
- Only call ensure_toolchain for non-lagom targets
- Use host addr2line, we can't expect the i686 toolchain's addr2line to
  support the host's binary executable format
- Don't export SERENITY_ARCH and TOOLCHAIN_DIR, don't need them anymore
2021-03-12 21:27:09 +01:00
Linus Groh
cab2982feb Meta: Add lagom_unsupported helper function to serenity.sh 2021-03-12 21:27:09 +01:00
Andreas Kling
9769542bc2 FuzzilliJs: Add missing <errno.h> include 2021-03-12 17:43:48 +01:00
Linus Groh
e93a147f26 Meta: Remove old CLion-specific files
This is not needed anymore, and likely outdated anyway.
2021-03-11 21:01:29 +01:00
Andreas Kling
cd745baa86 Meta: Add KMALLOC_DEBUG to all_the_debug_macros 2021-03-11 15:38:35 +01:00
Tom
929c90f8c8 Meta: Add gdb command to serenity.sh
This uses tmux for a split screen setup, which makes it easy do debug
the kernel while viewing the QEMU output in the same terminal.
2021-03-11 08:29:23 +01:00
Andreas Kling
2fc684f6bc Kernel: Remove ancient FIFO_DEBUG code 2021-03-09 22:10:41 +01:00
Tom
389dddd4b3 Meta: Add a build helper script
This script automatically manages the toolchain and cmake/ninja folders
making it easier to manage the different target architectures.
2021-03-09 07:28:59 +01:00
Andreas Kling
0918dd0460 Website: Add link to @ABigPickle's VLA exploit 2021-03-08 22:53:28 +01:00
Andreas Kling
dfca6b03e4 Website: Reorganize bounty page history section a little bit 2021-03-08 22:53:28 +01:00
Emanuele Torre
26c4cae77c Meta: check-newlines-at-eof.py now checks .json files and files in Base/
This makes it also check man pages and keymap files. :^)
2021-03-08 09:20:53 +01:00
Emanuele Torre
1f81bc6879 Everywhere: Remove unnecessary whitespace at the end of some lines. 2021-03-08 09:20:53 +01:00
Emanuele Torre
b7de2046e6 Meta: serenityos.org: Fix javascript error in the 2nd anniversary page.
The error as seen from chromium's devtools:

    Uncaught ReferenceError: I is not defined
        at (index):455
2021-03-08 09:20:53 +01:00
Linus Groh
a013a38e24 Meta: Make 'run.sh qgrub' work via SERENITY_RUN
It is possible to set the run.sh mode via the SERENITY_RUN environment
variable, but the SERENITY_DISK_IMAGE="grub_disk_image" override for
qgrub mode was only checking $1. This makes qgrub mode work via 'ninja
run' without explicitly setting SERENITY_DISK_IMAGE:

    SERENITY_RUN=qgrub ninja run
2021-03-06 19:55:53 +01:00
Liav A
e65fd83e23 Meta: Boot Q35 machine with SATA drive instead of using IDE drive 2021-03-05 11:29:34 +01:00
Liav A
c4463cb5df Kernel: Add basic AHCI functionality
The hierarchy is AHCIController, AHCIPortHandler, AHCIPort and
SATADiskDevice. Each AHCIController has at least one AHCIPortHandler.

An AHCIPortHandler is an interrupt handler that takes care of
enumeration of handled AHCI ports when an interrupt occurs. Each
AHCIPort takes care of one SATADiskDevice, and later on we can add
support for Port multiplier.

When we implement support of Message signalled interrupts, we can spawn
many AHCIPortHandlers, and allow each one of them to be responsible for
a set of AHCIPorts.
2021-03-05 11:29:34 +01:00
Andreas Kling
38c8dc22cf Kernel: Remove unused KMALLOC_DEBUG_LARGE_ALLOCATIONS mode
This was a thing back when the system was so little that any kernel
allocation above 1 MiB was basically guaranteed to be a bug. :^)
2021-03-04 11:25:45 +01:00
AnotherTest
e59a631511 HackStudio/LanguageServers: Move some components out of Cpp
This makes them available for use by other language servers.
Also as a bonus, update the Shell language server to discover some
symbols and add go-to-definition functionality :^)
2021-03-04 11:21:43 +01:00
Luke
28a705d3c7 Lagom/Fuzzers: Add fuzzers for LibCompess
Adds fuzzers for Deflate, Gzip and Zlib.
2021-03-04 09:19:29 +01:00
Idan Horowitz
45a11ead9a Meta: Stop excluding getopt.cpp from linting
This file was already "serenified" by @bugaevc long ago.
2021-03-03 23:42:32 +01:00
Idan Horowitz
c12781a6a2 LibCore+LibHTTP+LibGfx: Switch to LibCompress
This commit removes the only 3rd party library (and its usages)
in serenity: puff, which is used for deflate decompression. and
replaces it with the existing original serenity implementation
in LibCompress. :^)
2021-03-03 23:42:32 +01:00
Andrew Kaster
1aa605bc03 Meta: Run test-js and test-compress as CTest executables
Reduces the number of steps in the Actions workflow this way :^)
2021-03-02 09:00:21 +01:00
Andrew Kaster
669b6c43aa AK/Lagom: Modify TestSuite to return how many tests failed from main
This allows us to remove the FAIL_REGEX logic from the CTest invocation
of AK and LibRegex tests, as they will return a non-zero exit code on
failure :^).

Also means that running a failing TestSuite-enabled test with the
run-test-and-shutdown script will actually print that the test failed.
2021-03-01 11:12:36 +01:00
Tom
5b1edc0678 Meta: Allow specifying custom grub config file for build-image-grub.sh
This allows passing a custom grub config file as second argument to
build-image-grub.sh.
2021-03-01 11:11:56 +01:00
Luke
a66f96ff62 Lagom/Fuzzers: Add WAV fuzzer 2021-03-01 11:09:09 +01:00
Andrew Kaster
611bbc43be Base/CI: Boot serenity in CI in a mode that runs tests on target
Build a new version of Serenity in CI that doesn't have all the debug
symbols on, or we'd be waiting a very long time to boot.

Insert a TestRunner entry into SystemServer.ini that will run a shell
script that runs tests in /bin and /usr/Tests and shuts down the system
in the new self-test boot mode. Also make sure enough basic services are
started in self-test such that the tests will actually run properly.
2021-02-28 18:19:37 +01:00
Andrew Kaster
ca8319f800 Meta: Add run target for CI
This invocation of qemu has no VGA, no sound, no graphics, debug output
going to a file, and defaults to printing /dev/ttyS0 to stdout.
2021-02-28 18:19:37 +01:00
Andrew Kaster
e787738c24 Meta: Build AK and LibRegex tests in Lagom and for Serenity
These tests were never built for the serenity target. Move their Lagom
build steps to the Lagom CMakeLists.txt, and add serenity build steps
for them. Also, fix the build errors when building them with the
serenity cross-compiler :^)
2021-02-28 18:19:37 +01:00
Sviatoslav Peleshko
183ebaee91 LibWeb: Add actual document loading for the CSS (at)import rule 2021-02-28 10:27:32 +01:00
Linus Groh
24120d9dca Lagom: Build with -Wno-literal-suffix when using GCC
This is already set in the root CMakeLists.txt as well as here for Clang
(-Wno-user-defined-literals), but was forgotten for GCC which made an
Lagom-only build (cmake ../Meta/Lagom [...]) fail.
2021-02-27 16:38:21 +01:00
Linus Groh
590ae7a36d Lagom: CMakeLists.txt housekeeping
- Remove unused LIBM_SOURCES
- Some cosmetic and whitespace changes
2021-02-27 16:38:21 +01:00