summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-21Kernel: Improve time keeping and dramatically reduce interrupt loadTom
This implements a number of changes related to time: * If a HPET is present, it is now used only as a system timer, unless the Local APIC timer is used (in which case the HPET timer will not trigger any interrupts at all). * If a HPET is present, the current time can now be as accurate as the chip can be, independently from the system timer. We now query the HPET main counter for the current time in CPU #0's system timer interrupt, and use that as a base line. If a high precision time is queried, that base line is used in combination with quering the HPET timer directly, which should give a much more accurate time stamp at the expense of more overhead. For faster time stamps, the more coarse value based on the last interrupt will be returned. This also means that any missed interrupts should not cause the time to drift. * The default system interrupt rate is reduced to about 250 per second. * Fix calculation of Thread CPU usage by using the amount of ticks they used rather than the number of times a context switch happened. * Implement CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE and use it for most cases where precise timestamps are not needed.
2020-12-21Userland: userdel: Resolve home directory realpath before removalBrendan Coles
2020-12-21LibGfx: Extraction of Streamer from P*MLoaderLenny Maiorani
Problem: - `Streamer` is the same in [PBM,PGM,PPM]Loader class implementations. Solution: - Extract it to its own header file to reduce maintenance burden. - Implement `read` in terms of `read_bytes` to make the class "DRY". - Decorate all functions with `constexpr`.
2020-12-21UserspaceEmulator: Implement profiling, disown, purge syscallsBrendan Coles
2020-12-21Userland: useradd: Add command line option to set user passwordBrendan Coles
2020-12-21LibGUI: Soft tab expansion should be based on insertion columnAndreas Kling
We were using the line length as the column, which worked as long as you were at the end of the line, but not so well otherwise. :^)
2020-12-21Ports: Add initial stress-ng port to find bugs in serenityBrian Gianforcaro
This is a very WIP port bringing stress-ng to SerenityOS. stress-ng is great at doing multi-workload stress testing, this allows it to find unique and interesting intermixed pairs of stressful operations which cause bugs. This initial port just rips out an non applicable functionality in order to get the port to compile.
2020-12-21LibC: Add SCNu64 and SCNd64 macros for stress-g portBrian Gianforcaro
2020-12-21Build: Create device files according to the new major-minor numbersLiav A
2020-12-21Kernel: Introduce the StorageManagement classLiav A
The StorageManagement class has 2 roles: 1. During boot, it should find all storage controllers in the machine, and then determine what is the boot device. 2. Later on boot, it is a registrar of all storage controllers and storage devices. Thus, it could be used to show information about these devices when implemented. This change allows the user to specify a boot driver other than /dev/hda and if it's connected in the machine - it will boot.
2020-12-21Kernel: Change the indexing of storage devices in IDEController classLiav A
Previously, the indexing scheme was that 0 is Primary-Master, 1 is Primary-Slave, 2 is Secondary-Master, 3 is Secondary-Slave. Instead of merely matching between numbers to the channel & position, the IDEController code will try to find all available drives connected to the two channels, then it will create a Vector with nonnull RefPtr to them. Then we take use the given index with this Vector.
2020-12-21Kernel: Add a method to gather the devices count of a Storage controllerLiav A
Also, change device() method to be const.
2020-12-21Kernel: Add a method to check the type of a StorageControllerLiav A
Also, the device method in the StorageController class is public now.
2020-12-21Kernel: Allow to initialize an IDE device on the secondary channelLiav A
We now use major number 3, and the minor number is set to 0 or 2 if initialized on the primary channel, otherwise 1 or 3 on the secondary channel.
2020-12-21Kernel: Introduce the new Storage subsystemLiav A
This new subsystem is somewhat replacing the IDE disk code we had with a new flexible design. StorageDevice is a generic class that represent a generic storage device. It is meant that specific storage hardware will override the interface. StorageController is a generic class that represent a storage controller that can be found in a machine. The IDEController class governs two IDEChannels. An IDEChannel is responsible to manage the master & slave devices of the channel, therefore an IDEChannel is an IRQHandler.
2020-12-21Kernel: Allow to install a real IRQ handler on a spurious oneLiav A
IRQ 7 and 15 on the PIC architecture are used for spurious interrupts. IRQ 7 could also be used for LPT connection, and IRQ 15 can be used for the secondary IDE channel. Therefore, we need to allow to install a real IRQ handler and check if a real IRQ was asserted. If so, we handle them in the usual way. A note on this fix - unregistering or registering a new IRQ handler after we already registered one in the spurious interrupt handler is not supported yet.
2020-12-21Kernel: Add various methods to handle interrupts in the PCI subsystemLiav A
For now, we only are able to enable or disable pin based interrupts. Later, when implemented, we could utilize MSI & MSI-X interrupts.
2020-12-21Kernel: Add a method to retrieve the Physical ID for a PCI addressLiav A
2020-12-21PCI: Add list of capabilities for each device during first enumerationLiav A
2020-12-21Kernel: Add the DeviceController class in the PCI subsystemLiav A
Such device is not an IRQHandler by itself, but actually a controller of many IRQ or MSI devices. The purpose of this class is to manage multiple sources of interrupts. For example, a generic ISA IDE controller controls 2 IRQ sources - 14 and 15. So, when we initialize the IDE controller, it will initialize two IDE channels (also known as PATAChannels) to utilize IRQ 14 and 15, respectively. NVMe with MSI-X support can theoretically handle up to 2048 interrupts.
2020-12-21LibVT+Terminal: Add the option to disable the bellAlex McGrath
2020-12-21Breakout: Add player lives game mechanic and pause functionalityBrendan Coles
2020-12-21Kernel: Don't skip if found free page to allocate from a super regionLiav A
This was a bad pattern that wasn't detected because we only had one super physical region that was initialized by MemoryManager.
2020-12-21AK: Make JsonParser::parse_number properly parse >32bit intsSahan Fernando
2020-12-21AK: Test StringUtils::convert_to_int for different typesSahan Fernando
2020-12-21AK: Check for overflow in StringUtils::convert_to_intSahan Fernando
2020-12-21AK: Generalize AK::String::to_int() for more typesSahan Fernando
2020-12-21Build: Embed application icons directly in the executables.William Marlow
New serenity_app() targets can be defined which allows application icons to be emedded directly into the executable. The embedded icons will then be used when creating an icon for that file in LibGUI.
2020-12-21LibGUI: Get executable file icons from PNGs stored in ELF sections.William Marlow
If an ELF application contains sections called "serenity_icon_s" or "serenity_icon_m" then parse these as PNG images and use them for the 16x16 and 32x32 executable file icons respectively. If the application is not an ELF binary, the sections do not exist, the sections are not valid PNGs, or the file cannot be read then the default application icon will be used.
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-20AllOf: Common iterator typesLenny Maiorani
Problem: - Interface is too permissive. It permits iterators of different types as long as they are comparable. Solution: - Require iterators be the same type.
2020-12-20Kernel: Randomize memory location of the dynamic loader :^)Andreas Kling
This should make it a little bit harder for those who would mess with our loader.
2020-12-20Kernel: Ptrace should not assert on poke in non-mapped tracee memoryAndreas Kling
2020-12-20Kernel: Activate SUID/SGID credentials earlier in sys$execve()Andreas Kling
Switch on the new credentials before loading the new executable into memory. This ensures that attempts to ptrace() the program from an unprivileged process will fail. This covers one bug that was exploited in the 2020 HXP CTF: https://hxp.io/blog/79/hxp-CTF-2020-wisdom2/ Thanks to yyyyyyy for finding the bug! :^)
2020-12-20Kernel: Silence debug spam about select() being interruptedAndreas Kling
2020-12-20Kernel: Silence debug spam when running dynamically linked programsAndreas Kling
2020-12-20LibGfx: Teach all image decoders to fail on bitmap allocation failureAndreas Kling
We don't need to wait for oss-fuzz to find this for us. :^)
2020-12-20UserspaceEmulator: Add lazy caching of debug info for shared librariesAndreas Kling
Keep the debug symbols for shared libraries in memory after we opened them the first time. This dramatically speeds up symbolication of backtraces when running dynamically linked programs in UE.
2020-12-20LibGfx: Fail PNG decode if output bitmap can't be allocatedAndreas Kling
Otherwise we'll assert soon afterwards. Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28838
2020-12-20LibGUI: Make the GML parser a bit more fault-tolerantAndreas Kling
It will now fail and whine in the debug log instead of asserting.
2020-12-20LibGUI: Make GUI::Label auto-sizing declarativeAndreas Kling
You can now set the "autosize" property on a GUI::Label and it will automatically update its width preference to fit the text.
2020-12-20LibGUI: Rename ProgressBar property caption => text and expose to GMLAndreas Kling
2020-12-20FileManager: Move the main window UI to GMLAndreas Kling
This was pretty straightforward although it does expose a bunch of missing functionality (mostly properties.)
2020-12-20LibGUI: Add a couple more Widget registrationsAndreas Kling
Make it possible to instantiate BreadcrumbBar, ProgressBar and TreeView from GML. :^)
2020-12-20LibGUI: Introduce GML - a simple GUI Markup Language :^)Andreas Kling
This patch replaces the UI-from-JSON mechanism with a more human-friendly DSL. The current implementation simply converts the GML into a JSON object that can be consumed by GUI::Widget::load_from_json(). The parser is not very helpful if you make a mistake. The language offers a very simple way to instantiate any registered Core::Object class by simply saying @ClassName @GUI::Label { text: "Hello friends!" tooltip: ":^)" } Layouts are Core::Objects and can be assigned to the "layout" property: @GUI::Widget { layout: @GUI::VerticalBoxLayout { spacing: 2 margins: [8, 8, 8, 8] } } And finally, child objects are simply nested within their parent: @GUI::Widget { layout: @GUI::HorizontalBoxLayout { } @GUI::Button { text: "OK" } @GUI::Button { text: "Cancel" } } This feels a *lot* more pleasant to write than the JSON we had. The fact that no new code was being written with the JSON mechanism was pretty telling, so let's approach this with developer convenience in mind. :^)
2020-12-20LibWeb: Don't leave "border" CSS property around after expansionAndreas Kling
The "border" property is a shorthand that expands into multiple longhand properties. We shouldn't leave it set in a StyleProperties after expanding it.
2020-12-19AK: Remove bogus test case for CircularDuplexStream.asynts
2020-12-19WindowServer: Put tooltip windows above notification windowsAndreas Kling
2020-12-19AK: Remove awkward ByteBuffer construction modes (wrap & adopt)Andreas Kling
ByteBuffer previously had a flag that determined whether it owned the bytes inside it or not (m_owned.) Owned ByteBuffers would free() on destruction and non-owned ones would not. This was a huge source of confusion and made it hard to reason about lifetimes since there were no compile-time clues about whether a buffer was owned or non-owned. The adopt mode was used at some point to take over ownership of a random malloc'ed buffer, but nothing was using it so this patch removes that as well.
2020-12-19LibTLS+Userland: Remove all uses of ByteBuffer::slice_view()Andreas Kling
This was another way to get a non-owning ByteBuffer wrapper.