Commit graph

7041 commits

Author SHA1 Message Date
Andreas Kling d46071c08f Kernel: Assert on page fault during IRQ
We're not equipped to deal with page faults during an IRQ handler,
so add an assertion so we can immediately tell what's wrong.

This is why profiling sometimes hangs the system -- walking the stack
of the profiled thread causes a page fault and things fall apart.
2020-02-21 15:49:34 +01:00
Andreas Kling 2a679f228e Kernel: Fix bitrotted DEBUG_IO logging 2020-02-21 15:49:30 +01:00
howar6hill a78ae917d8 mv: Use ArgsParser, and check lstat for failure 2020-02-21 15:16:28 +01:00
Sergey Bugaev 1d2986ea15 Kernel: Fix a panic in VFS::rename()
If we get an -ENOENT when resolving the target because of some part, that is not
the very last part, missing, we should just return the error instead of panicking
later :^)

To test:
    $ mkdir /tmp/foo/
    $ mv /tmp/foo/ /tmp/bar/

Related to https://github.com/SerenityOS/serenity/issues/1253
2020-02-20 19:13:20 +01:00
Sergey Bugaev 3439498744 Kernel: Support trailing slashes in VFS::mkdir()
This is apparently a special case unlike any other, so let's handle it
directly in VFS::mkdir() instead of adding an alternative code path into
VFS::resolve_path().

Fixes https://github.com/SerenityOS/serenity/issues/1253
2020-02-20 19:13:20 +01:00
howar6hill 7ff256aab6 Base: Add a man page for lspci 2020-02-20 15:13:42 +01:00
howar6hill e352ee23e5 Userland: Fix nullptr dereference if we fail to open the PCIDB
In the code below, db could be null, and would cause UB.
Instead of crashing, let's simply skip symbolicating names.

Fixes #1247
2020-02-20 15:13:42 +01:00
howar6hill 83668299a6
host: Use ArgsParser to parse arguments, and add man page (#1252)
Fixes #1246.
2020-02-20 15:12:55 +01:00
Shannon Booth 088d7be19c WindowServer: Stop exposing open_menu_stack in MenuManager
The open menu stack is an internal data structure that outside classes
shouldn't really need to know about. Add MenuManager::has_open_menu()
so that the WindowManager can still know whether a menu is open or not.
2020-02-20 15:11:31 +01:00
Shannon Booth 238b6871e0 WindowServer: Fix not all menus closing after system menu toggle
We were failing to check if the current menu being set was already open.
This could result in multiple occurrences of the menu in the open menu stack.

When we close all menus descending from a menu we only delete the first
occurrence of a given menu from the menu stack (a fair assumption to make as
a menu should only be open once).

Because of this a menu (or multiple instances of it) could remain in the open
menu stack when it should actually be closed, leading to goofy behaviour.

Fixes #1238
2020-02-20 15:11:31 +01:00
Tibor Nagy 6e2a16c8a8 LibGfx+LibGUI: Allow theming the focus outline of AbstractButton 2020-02-20 14:19:30 +01:00
Tibor Nagy e490fc9e35 FontEditor: Make the application theme-aware 2020-02-20 14:19:30 +01:00
Tibor Nagy 59b9e9cd4d Minesweeper: Use system theme colors for empty square borders 2020-02-20 14:19:30 +01:00
Tibor Nagy bbfefb8827 WindowServer: Geometry labels should follow the system theme 2020-02-20 14:19:30 +01:00
Tibor Nagy 1da3be82ad WindowServer: MenuManager should use selection text color from system theme 2020-02-20 14:19:30 +01:00
Tibor Nagy c8bc53e987 LibGfx+LibGUI: Allow theming the text cursor 2020-02-20 14:19:30 +01:00
Andreas Kling 7592f9afd5 AK: Use size_t for CircularQueue and CircularDeque 2020-02-20 13:20:34 +01:00
Andreas Kling 88b9fcb976 AK: Use size_t for ByteBuffer sizes
This matches what we already do for string types.
2020-02-20 13:20:34 +01:00
Andreas Kling 1dfc66c7cc Ports: Add git port
There are various issues with this port that need to be fixed, but it's
at least possible to inspect and modify the SerenityOS repo if I clone
it into the disk image from the outside.

Very cool! :^)
2020-02-20 07:07:33 +01:00
Andreas Kling cd495786a8 LibC: Implement crappy version of pread()
This patch adds a crappy pread() just to get "git" working locally.
A proper version would be implemented in the kernel so that we don't
have to mess with the file descriptor's offset at all.
2020-02-20 06:59:23 +01:00
Andreas Kling 7c12d66f61 LibC: Stub out getpass() 2020-02-20 06:58:48 +01:00
Andreas Kling c3b09c7242 LibC: Add h_errno and stub out getservbyname() 2020-02-20 06:58:16 +01:00
Andreas Kling cf4da485e6 LibC: Add inet_ntoa() 2020-02-20 06:57:47 +01:00
Andreas Kling 0ba458cfa0 Kernel+LibC: Add SO_REUSEADDR macro
Note that this is not actually implemented, I'm just defining it.
2020-02-20 06:57:01 +01:00
Andreas Kling 2a1cad73fe LibC: Add an empty <netinet/tcp.h>
This is enough to placate anyone who includes it without actually using
anything from it. :^)
2020-02-20 06:51:28 +01:00
Andreas Kling 4ddae2c069 LibC: Add some missing macros to inttypes.h 2020-02-20 06:51:16 +01:00
Andreas Kling 124c588f81 LibC: Don't assert on fflush(nullptr)
We're supposed to flush all open streams when this happens, but since
we don't know how to do that yet, let's just log a FIXME and not crash.
2020-02-19 23:12:29 +01:00
Andreas Kling e0d589c074 LibC: Add hack implementation of gmtime_r() matching gmtime() 2020-02-19 23:09:37 +01:00
Andreas Kling 23a54636ea AK: Fix bug where "%s" with field width would print too many characters
I introduced this while implementing "%.*s", oops.
2020-02-19 23:02:15 +01:00
Andreas Kling a87544fe8b Kernel: Refuse to allocate 0 bytes of virtual address space 2020-02-19 22:19:55 +01:00
Andreas Kling 26fb3f7269 LibELF: Short-circuit symbolication when there are no symbols 2020-02-19 22:18:41 +01:00
Andreas Kling 4a66de580e LibC: Always inline the printf character helpers 2020-02-19 22:11:04 +01:00
Andreas Kling 151467b569 AK: Support "%.*s" in format strings
Work towards #623.
2020-02-19 22:08:13 +01:00
Andreas Kling eaa680ab8e WindowServer+LibGUI: Force full window repaints after theme change
We were not repainting windows that were occluded at the time of the
theme changing. This patch adds a way to bypass occlusion testing when
invalidating window rects.

Fixes #1249.
2020-02-19 16:46:28 +01:00
Liav A 8a2dc5d188 LibC: Fix big endian definitions 2020-02-19 16:08:28 +01:00
Liav A 01ae3e9c85 AK: Use endianness flags to determine if conversion is necessary 2020-02-19 16:08:28 +01:00
howar6hill 940de40f28
Userland: Add userdel program (#1217) 2020-02-19 12:59:09 +01:00
Tibor Nagy 6eae2ef9cf HexEditor: Make the application theme-aware
Also updates the ruler style a bit to be more consitent with TextEditor.
2020-02-19 12:24:39 +01:00
Tibor Nagy 33864ab715 LibGUI: Update TextEditor to use ruler colors from the system theme 2020-02-19 12:24:39 +01:00
Tibor Nagy e1da7ca979 Base: Add ruler colors to system themes 2020-02-19 12:24:39 +01:00
Tibor Nagy 5cf5ddf6cb LibGfx: Add ColorRoles for rulers 2020-02-19 12:24:39 +01:00
Andreas Kling f17c377a0c Kernel: Use bitfields in Region
This makes Region 4 bytes smaller and we can use bitfield initializers
since they are allowed in C++20. :^)
2020-02-19 12:03:11 +01:00
Andreas Kling d02c169851 Build: Build with -std=c++2a
Let's get ready for C++20 :^)
2020-02-19 12:03:11 +01:00
Andreas Kling ef38c49619 WindowServer+LibGUI+LibHTML: Fix build with -std=c++2a 2020-02-19 12:03:01 +01:00
Tibor Nagy ca4d4cac45 HexEditor: Clear tracked changes when setting a new buffer 2020-02-19 10:10:53 +01:00
Tibor Nagy 97878dfb4d HexEditor: Fix out of bounds cursor
Fixing out of bounds cursor in three different cases:
- when the buffer is empty
- when loading new files
- when entering values at the end of the buffer
2020-02-19 10:10:53 +01:00
Andreas Kling a31ca1282e Base: Rename /dev/psaux to /dev/mouse
Since this device doesn't actually hand out raw PS/2 aux packets,
let's just call it "mouse" instead. :^)
2020-02-18 14:30:39 +01:00
Andreas Kling bead20c40f Kernel: Remove SmapDisabler in sys$create_shared_buffer() 2020-02-18 14:12:39 +01:00
Andreas Kling 9aa234cc47 Kernel: Reset FPU state on exec() 2020-02-18 13:44:27 +01:00
Andreas Kling 315538245f realpath: Use pledge() 2020-02-18 13:29:54 +01:00