Commit Graph

9685 Commits

Author SHA1 Message Date
Andreas Kling
fa712d8aa5 LibVT: Don't try to set the window title to invalid UTF-8 text 2020-05-16 19:55:43 +02:00
Andreas Kling
b8498dc55e LibVT: Add incremental UTF-8 parsing to the terminal input handler
Instead of relying on the GUI code to handle UTF-8, we now process
and parse the incoming data into 32-bit codepoints ourselves.

This means that you can now show emojis in the terminal and they will
only take up one character cell each. :^)
2020-05-16 19:49:24 +02:00
Andreas Kling
06f3eb0ecd LibVT: Tweak input parsing related names 2020-05-16 19:30:46 +02:00
Andreas Kling
c4edc4c550 LibVT: Switch VT::Line to being backed by 32-bit codepoints
This will allow us to have much better Unicode support. It does incur
a memory usage regression which we'll have to optimize to cover.
2020-05-16 19:30:43 +02:00
Andreas Kling
cd29844632 LibIPC: Allow opt-in UTF-8 validation on message parameters
You can now mark String message parameters with the [UTF8] attribute.
This will cause the generated decoder to perform UTF-8 validation and
reject the message if the given parameter is not a valid UTF-8 string.

This frees up the receiving side from having to do this validation at
a higher level.
2020-05-16 14:13:09 +02:00
Andreas Kling
f7a75598bb Kernel: Remove Process::any_thread()
This was a holdover from the old times when each Process had a special
main thread with TID 0. Using it was a total crapshoot since it would
just return whichever thread was first on the process's thread list.

Now that I've removed all uses of it, we don't need it anymore. :^)
2020-05-16 12:40:15 +02:00
Andreas Kling
24d5855428 Kernel: Let the wait blocker inspect *all* child threads of a process
Previously would only grab the first thread in the thread list that
had the same PID as our waitee and check if it was stopped.
2020-05-16 12:38:24 +02:00
Andreas Kling
0e7f85c24a Kernel: Sending a signal to a process now goes to the main thread
Instead of falling back to the suspicious "any_thread()" mechanism,
just fail with ESRCH if you try to kill() a PID that doesn't have a
corresponding TID.
2020-05-16 12:33:48 +02:00
Andreas Kling
c9e38c5255 Kernel: Remove awkward "#define printf dbgprintf" 2020-05-16 12:03:25 +02:00
Andreas Kling
21d5f4ada1 Kernel: Absorb LibBareMetal back into the kernel
This was supposed to be the foundation for some kind of pre-kernel
environment, but nobody is working on it right now, so let's move
everything back into the kernel and remove all the confusion.
2020-05-16 12:00:04 +02:00
Andreas Kling
c12cfdea87 Build: Remove -Wno-volatile flag
I've fixed all the warnings about invalid use of the "volatile" keyword
so it should be fine to enable this now.
2020-05-16 11:35:16 +02:00
Andreas Kling
204fb27333 Kernel: Remove now-unused KernelInfoPage.h 2020-05-16 11:34:54 +02:00
Andreas Kling
2d35810e0a Kernel: Add TimeManagement::now_as_timeval()
Hide the implementation of time-of-day computation in TimeManagement.
2020-05-16 11:34:01 +02:00
Andreas Kling
2dc051c866 Kernel: Remove sys$getdtablesize()
I'm not sure why this was a syscall. If we need this we can add it in
LibC as a wrapper around sysconf(_SC_OPEN_MAX).
2020-05-16 11:34:01 +02:00
Andreas Kling
426c4e387d Kernel: Use copy_to_user() in sys$gettimeofday() 2020-05-16 11:34:01 +02:00
Andreas Kling
3a92d0828d Kernel: Remove the "kernel info page" used for fast gettimeofday()
We stopped using gettimeofday() in Core::EventLoop a while back,
in favor of clock_gettime() for monotonic time.

Maintaining an optimization for a syscall we're not using doesn't make
a lot of sense, so let's go back to the old-style sys$gettimeofday().
2020-05-16 11:33:59 +02:00
Dominik Madarasz
4e27c58be7 Build: FreeBSD support 2020-05-16 11:01:14 +02:00
Andreas Kling
76bcd284f9 AK: Remove experimental clang -Wconsumed stuff
This stopped working quite some time ago due to Clang losing track of
typestates for some reason and everything becoming "unknown".

Since we're primarily using GCC anyway, it doesn't seem worth it to try
and maintain this non-working experiment for a secondary compiler.

Also it doesn't look like the Clang team is actively maintaining this
flag anyway. So good-bye, -Wconsumed. :/
2020-05-16 10:55:54 +02:00
Andreas Kling
16c858d9f0 Kernel: Remove dubious use of "volatile" in E1000 adapter driver 2020-05-16 10:55:54 +02:00
Andreas Kling
03eb0e5638 Kernel: Let's say that IO::delay(N) delays for N microseconds
Supposedly that's how much delay you get when doing I/O on port 0x80.
2020-05-16 10:55:54 +02:00
Andreas Kling
85aafe492d Kernel: Remove dubious use of "volatile" in HPET code 2020-05-16 10:55:54 +02:00
Andreas Kling
ca4f714d68 Kernel: Use consistent names for kmalloc globals and remove volatile 2020-05-16 10:55:54 +02:00
Shannon Booth
154a6e69a4 Shell: Use DirIterator::SkipParentAndBaseDir 2020-05-16 10:09:00 +02:00
Andrew Kaster
e5ad6a491e LibELF: Handle DT_SONAME dynamic entries
Store the offset in the string table for the DT_SONAME entry. Now that
the build uses cmake, cmake is helpfully passing --Wl,-soname to the
linker for shared objects. This makes the LinkDemo run again.
2020-05-16 09:52:57 +02:00
Shannon Booth
3d153e5ed3 Build: Disable deprecated volatile warning
We will probably need to fix this at some stage, but for now let's just
disable the warning.
2020-05-16 09:51:31 +02:00
Shannon Booth
2ffbdf5680 Toolchain/Ports: Update to gcc 10.1.0 2020-05-16 09:51:31 +02:00
Shannon Booth
113a95e9e1 Kernel: Annotate UnhandledInterruptHandler::eoi with [[noreturn]] 2020-05-16 09:51:31 +02:00
Shannon Booth
df43e09433 LibGUI+WindowServer: Allow applications to set custom cursor bitmaps
This will allow e.g PaintBrush to use custom cursors for each tool.
2020-05-16 09:44:55 +02:00
Shannon Booth
8c1b01e79b Kernel: Tidy up SharedBuffer interface
Make is_shared_with() const and hide private members.
2020-05-16 09:44:00 +02:00
Sergey Bugaev
f7ae66cee3 ClipboardHistory: Add a clipboard history applet :^)
It will listen for clipboard content changes in the backgroud. Once you click
on its icon, it will pop up a window listing all recorded clipboard contents.
You can then double-click on an item to copy it again.
2020-05-16 09:13:25 +02:00
Sergey Bugaev
acc107a44f FileManager+LibGUI+Userland: Switch clipboard to MIME types
We will now actually use MIME types for clipboard. The default type is now
"text/plain" (instead of just "text").

This also fixes some issues in copy(1) and paste(1).
2020-05-16 09:11:46 +02:00
Andreas Kling
de7827faf7 LibM: Fix floor() and floorf() for negative numbers
And add a LibJS test to exercise the code. :^)
2020-05-15 22:05:59 +02:00
Andreas Kling
8f293b7543 LibM: Add floorf() for @rexim :^) 2020-05-15 21:51:02 +02:00
Andreas Kling
16965db86b LibVT: Move out the Line class from Terminal to its own class 2020-05-15 18:57:50 +02:00
Sergey Bugaev
345fbd1fc1 LibCore: Fix timer expiration processing
The previous code did not account for the case when there are timers present,
but none are enabled, and used a zero polling timeout.

Fixes https://github.com/SerenityOS/serenity/issues/2222
2020-05-15 17:41:54 +02:00
Sergey Bugaev
b8fef58c0c ProfileViewer: Fix opening the kernel image
The kernel image is now at /boot/Kernel (not /boot/kernel), so adjust
the paths accordingly.
2020-05-15 17:41:54 +02:00
AnotherTest
6fcdfe1169 Shell: Correct program stop behaviour
Prior to this, we would only wait for program exit; the shell should
stop waiting once the program has been stopped.
Fixes #2230
2020-05-15 14:44:57 +02:00
Andreas Kling
c6ddbd1f3e LibJS: Add side-effect-free version of Value::to_string()
There are now two API's on Value:

- Value::to_string(Interpreter&) -- may throw.
- Value::to_string_without_side_effects() -- will never throw.

These are some pretty big sweeping changes, so it's possible that I did
some part the wrong way. We'll work it out as we go. :^)

Fixes #2123.
2020-05-15 13:50:42 +02:00
Andreas Kling
d8aa2a6997 AK: StringBuilder with 0 initial capacity shouldn't build null String
With 0 initial capacity, we don't allocate an underlying ByteBuffer
for the StringBuilder, which would then lead to a null String() being
returned from to_string().

This patch makes sure we always build a valid String.
2020-05-15 13:50:42 +02:00
Linus Groh
85f2987848 Docs: Update required clang-format version to 10 in CONTRIBUTING.md 2020-05-15 12:26:23 +02:00
Sergey Bugaev
7aad44b825 Shell: Print correct errno when execvp() fails
Amusingly enough, this was caused by yet another bug.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
888329233b LibC: Fix execvp() errno
Of course, using dbg() in the middle will change errno (most likely, reset
it to zero).
2020-05-15 11:43:58 +02:00
Sergey Bugaev
752617cbb2 Kernel: Disallow opening socket files
You can still open files that have sockets attached to them from inside
the kernel via VFS::open() (and in fact, that is what LocalSocket itslef uses),
but trying to do that from userspace using open() will now fail with ENXIO.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
00c166e2ca Base: Allow NotificationServer to access the Clipboard
Otherwise it fails to even start.
2020-05-15 11:43:58 +02:00
Sergey Bugaev
e5a231e36f Clipboard: Remove accidentally commited file 2020-05-15 10:01:35 +02:00
Sergey Bugaev
32f8e57834 Build: Ask GCC to always emit colorful diagnostics 2020-05-15 10:01:35 +02:00
Sergey Bugaev
486540fa90 Build: Allow using CMake 3.16
Because apparently that's what a lot of people have,
and they report it works fine.
2020-05-15 10:01:35 +02:00
Andreas Kling
97a8b6e402 Clipboard: Add missing copyright header 2020-05-15 10:00:17 +02:00
Linus Groh
4e0ed34d7e js: Throw a regular SyntaxError for errors from the parser 2020-05-15 09:53:52 +02:00
Linus Groh
33defef267 LibJS: Let parser keep track of errors
Rather than printing them to stderr directly the parser now keeps a
Vector<Error>, which allows the "owner" of the parser to consume them
individually after parsing.

The Error struct has a message, line number, column number and a
to_string() helper function to format this information into a meaningful
error message.

The Function() constructor will now include an error message when
throwing a SyntaxError.
2020-05-15 09:53:52 +02:00