summaryrefslogtreecommitdiff
path: root/Meta/CMake
AgeCommit message (Collapse)Author
2021-05-20StateMachineGenerator: Put output into the CMake build directoryAndreas Kling
Don't pollute the source directory with generated code.
2021-05-20Meta: Make generate_state_machine() generate a proper targetAli Mohammad Pur
And use GENERATED_SOURCES (or add_dependencies) to make LibVT depend on that target. Fixes a FIXME.
2021-05-18LibJS+LibTest: Move out the test-js test runner into LibTestAli Mohammad Pur
2021-05-18LibGfx: Add support for DDS imagesstelar7
2021-05-17LibWasm: Start implementing a naive bytecode interpreterAli Mohammad Pur
As the parser now flattens out the instructions and inserts synthetic nesting/structured instructions where needed, we can treat the whole thing as a simple parsed bytecode stream. This currently knows how to execute the following instructions: - unreachable - nop - local.get - local.set - {i,f}{32,64}.const - block - loop - if/else - branch / branch_if - i32_add - i32_and/or/xor - i32_ne This also extends the 'wasm' utility to optionally execute the first function in the module with optionally user-supplied arguments.
2021-05-17Build: Stop using precompiled headers (PCH)Andreas Kling
This had very bad interactions with ccache, often leading to rebuilds with 100% cache misses, etc. Ali says it wasn't that big of a speedup in the end anyway, so let's not bother with it. We can always bring it back in the future if it seems like a good idea.
2021-05-16Kernel/Graphics + SystemServer: Support text mode properlyLiav A
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-16Kernel/Graphics: Add basic support for Intel native acceleratorLiav A
We simply modeset the resolution after determining the preferred resolution after getting the EDID from the attached display.
2021-05-16AK+Meta: Add a debug option for SolitaireTimothy Flynn
2021-05-16LibVT: Implement new ANSI escape sequence parserDaniel Bertalan
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-14AK: Remove unused STRINGIMPL_DEBUG instrumentationAndreas Kling
2021-05-14Kernel: Add the ability to verify we don't kmalloc under spinlock.Brian Gianforcaro
Ideally we would never allocate under a spinlock, as it has many performance and potentially functionality (deadlock) pitfalls. We violate that rule in many places today, but we need a tool to track them all down and fix them. This change introduces a new macro option named `KMALLOC_VERIFY_NO_SPINLOCK_HELD` which can catch these situations at runtime via an assert.
2021-05-13CMake: Make missing medium icon a FATAL_ERRORBrian Gianforcaro
Now that all of the medium icons pass this check, we can make it FATAL_ERROR to stop any new violations from being checked in.
2021-05-13CMake: Fix message levels for error conditions during configurationBrian Gianforcaro
Make messages which should be fatal, actually fail the build. - FATAL is not a valid mode keyword. The full list is available in the docs: https://cmake.org/cmake/help/v3.19/command/message.html - SEND_ERROR doesn't immediately stop processing, FATAL_ERROR does. We should immediately stop if the Toolchain is not present. - The app icon size validation was just a WARNING that is easy to overlook. We should promote it to a FATAL_ERROR so that people will not overlook the issue when adding a new application. We can only make the small icon message FATAL_ERROR, as there is currently one violation of the medium app icon validation.
2021-05-10LibPDF: Parse page structuresMatthew Olsson
This commit introduces the ability to parse the document catalog dict, as well as the page tree and individual pages. Pages obviously aren't fully parsed, as we won't care about most of the fields until we start actually rendering PDFs. One of the primary benefits of the PDF format is laziness. PDFs are not meant to be parsed all at once, and the same is true for pages. When a Document is constructed, it builds a map of page number to object index, but it does not fetch and parse any of the pages. A page is only parsed when a caller requests that particular page (and is cached going forwards). Additionally, this commit also adds an object_cast function which logs bad casts if DEBUG_PDF is set. Additionally, utility functions were added to ArrayObject and DictObject to get all types of objects from the collections to avoid having to manually cast.
2021-05-08LibWasm: Start implementing a basic WebAssembly binary format parserAli Mohammad Pur
This can currently parse a really simple module. Note that it cannot parse the DataCount section, and it's still missing almost all of the instructions. This commit also adds a 'wasm' test utility that tries to parse a given webassembly binary file. It currently does nothing but exit when the parse fails, but it's a start :^)
2021-05-08AK+LibCpp: Remove DEBUG_SPAM in favour of per-application definesAli Mohammad Pur
What happens if one file defines DEBUG_SPAM, and another doesn't, then we link them together and get ODR violations? -- @ADKaster
2021-05-08LibGL: Implement a basic OpenGL 1.x compatible libraryJesse Buhagiar
This currently (obviously) doesn't support any actual 3D hardware, hence all calls are done via software rendering. Note that any modern constructs such as shaders are unsupported, as this driver only implements Fixed Function Pipeline functionality. The library is split into a base GLContext interface and a software based renderer implementation of said interface. The global glXXX functions serve as an OpenGL compatible c-style interface to the currently bound context instance. Co-authored-by: Stephan Unverwerth <s.unverwerth@gmx.de>
2021-04-25AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMakeAndrew Kaster
As many macros as possible are moved to Macros.h, while the macros to create a test case are moved to TestCase.h. TestCase is now the only user-facing header for creating a test case. TestSuite and its helpers have moved into a .cpp file. Instead of requiring a TEST_MAIN macro to be instantiated into the test file, a TestMain.cpp file is provided instead that will be linked against each test. This has the side effect that, if we wanted to have test cases split across multiple files, it's as simple as adding them all to the same executable. The test main should be portable to kernel mode as well, so if there's a set of tests that should be run in self-test mode in kernel space, we can accomodate that. A new serenity_test CMake function streamlines adding a new test with arguments for the test source file, subdirectory under /usr/Tests to install the test application and an optional list of libraries to link against the test application. To accomodate future test where the provided TestMain.cpp is not suitable (e.g. test-js), a CUSTOM_MAIN parameter can be passed to the function to not link against the boilerplate main function.
2021-04-21Meta: Add an option to precompile some very common AK headersAli Mohammad Pur
Until we get the goodness that C++ modules are supposed to be, let's try to shave off some parse time using precompiled headers. This commit only adds some very common AK headers, only to binaries, libraries and the kernel (tests are not covered due to incompatibility with AK/TestSuite.h). This option is on by default, but can be disabled by passing `-DPRECOMPILE_COMMON_HEADERS=OFF` to cmake, which will disable all header precompilations. This makes the build about 30 seconds faster on my machine (about 7%).
2021-04-20AK+Meta: Add a debug option for LibSQLTimothy Flynn
2021-04-20Meta: Add allow-list for icon size detection in CMakeBrian Gianforcaro
The only icons we are currently warning about are designed and rendered as small icons intentionally, as their only use is in desktop applets, and thus are exempt to this rule. This reduces build spam back down to a minimum. I should have just done this in the first place, back in #4729
2021-04-18Meta: Mark x86 debug register macros as false positives for CIFalseHonesty
2021-04-17Kernel: Add base support for VirtIO devicesIdan Horowitz
Based on pull #3236 by tomuta, this adds helper methods for generic device initialization, and partily-broken virtqueue helper methods Co-authored-by: Tom <tomut@yahoo.com> Co-authored-by: Sahan <sahan.h.fernando@gmail.com>
2021-04-03Kernel: Introduce a new HID subsystemLiav A
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-02LibJS: Add initial support for PromisesLinus Groh
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-03-23LibGUI: Remove one ancient GMENU_DEBUG debug logAndreas Kling
2021-03-13Kernel: Implement triply indirect block support in Ext2FSInodeJean-Baptiste Boric
2021-03-11Meta: Add KMALLOC_DEBUG to all_the_debug_macrosAndreas Kling
2021-03-09Kernel: Remove ancient FIFO_DEBUG codeAndreas Kling
2021-03-05Kernel: Add basic AHCI functionalityLiav A
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-04Kernel: Remove unused KMALLOC_DEBUG_LARGE_ALLOCATIONS modeAndreas Kling
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-04HackStudio/LanguageServers: Move some components out of CppAnotherTest
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-02-28LibWeb: Add actual document loading for the CSS (at)import ruleSviatoslav Peleshko
2021-02-20LibLine: Avoid refreshing the entire line when inserting at the endAnotherTest
This patchset allows the editor to avoid redrawing the entire line when the changes cause no unrecoverable style updates, and are at the end of the line (this applies to most normal typing situations). Cases that this does not resolve: - When the cursor is not at the end of the buffer - When a display refresh changes the styles on the already-drawn parts of the line - When the prompt has not yet been drawn, or has somehow changed Fixes #5296.
2021-02-14LibCrypto: Make a better ASN.1 parserAnotherTest
And use it to parse RSA keys. As a bonus, this one shouldn't be reading out of bounds or messing with the stack (as much) anymore.
2021-02-13Meta: Fix debug-flag detectionBen Wiederhake
Detection broke when we moved from '#ifdef DEBUG_FOO dbgln()' to 'dbgln<DEBUG_FOO>()'. This patch makes detection more general, which sadly runs into more false-positives. No rotten code was found, hooray! :^)
2021-02-13Utilities: Make syscall(1) explain what it's doingBen Wiederhake
2021-02-11LibCore: Added FileWatcher, a binding for the watch_file syscallDexesTTP
This wrapper abstracts the watch_file setup and file handling, and allows using the watch_file events as part of the event loop via the Core::Notifier class. Also renames the existing DirectoryWatcher class to BlockingFileWatcher, and adds support for the Modified mode in this class.
2021-02-05Kernel: Add NE2000 network card driverJean-Baptiste Boric
Remember, friends don't let friends use NE2000 network cards :^)
2021-01-29LibWeb: Flesh out prepare_script and execute_scriptLuke
This fills in a bunch of the FIXMEs that was in prepare_script. execute_script is almost finished, it's just missing the module side. As an aside, let's not assert when inserting a script element with innerHTML.
2021-01-27HackStudio: Integate with C++ parser-based autocompleteItamar
By default, C++ auto completion will still be performed by the lexer-based logic. However, the parser-based logic can be switched on via the menubar.
2021-01-27LibCpp: Add the beginning of a C++ parserItamar
This parser will be used by the C++ langauge server to provide better auto-complete (& maybe also other things in the future). It is designed to be error tolerant, and keeps track of the position spans of the AST nodes, which should be useful later for incremental parsing.
2021-01-25Everywhere: Hook up remaining debug macros to Debug.h.asynts
2021-01-25Everywhere: Use CMake to generate AK/Debug.h.asynts
This was done with the help of several scripts, I dump them here to easily find them later: awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in) do find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \; done # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list. awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-22Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-17Kernel: Some futex improvementsTom
This adds support for FUTEX_WAKE_OP, FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET, FUTEX_REQUEUE, and FUTEX_CMP_REQUEUE, as well well as global and private futex and absolute/relative timeouts against the appropriate clock. This also changes the implementation so that kernel resources are only used when a thread is blocked on a futex. Global futexes are implemented as offsets in VMObjects, so that different processes can share a futex against the same VMObject despite potentially being mapped at different virtual addresses.
2021-01-17Kernel+Userland: Remove shared buffers (shbufs)Andreas Kling
All users of this mechanism have been switched to anonymous files and passing file descriptors with sendfd()/recvfd(). Shbufs got us where we are today, but it's time we say good-bye to them and welcome a much more idiomatic replacement. :^)