Commit Graph

11722 Commits

Author SHA1 Message Date
Andreas Kling
030edbd513 UserspaceEmulator: Mark mmap regions as malloc blocks when mallocing
We don't have to be clever at all to figure out which MmapRegions are
malloc blocks, we can just mark the containing region as such when
the emulated process performs a malloc! :^)
2020-08-01 09:13:45 +02:00
Andreas Kling
5de7bae383 UserspaceEmulator: Forward errors from fork() correctly 2020-08-01 09:11:18 +02:00
AnotherTest
3455876976 Help: Optionally take an argument to search for 2020-08-01 08:39:26 +02:00
AnotherTest
21094b4725 Help: Add a search mode
This closes #2685, and brings some much needed nostalgia :^)
2020-08-01 08:39:26 +02:00
AnotherTest
6131417904 AK: Make MappedFile store why it is invalid
This makes AK::MappedFile save the errno either open() or mmap() failed
with.
2020-08-01 08:39:26 +02:00
AnotherTest
d04c833002 LibGUI: Add FilteringProxyModel
This model does not support nested indices well, in that it flattens
them all out.
That's a FIXME for the future as it does its job for now.
2020-08-01 08:39:26 +02:00
AnotherTest
c35493c156 LibGUI: Add focus hooks to TextEditor 2020-08-01 08:39:26 +02:00
AnotherTest
fd64be02e0 AK: Add StringView::contains(StringView) 2020-08-01 08:39:26 +02:00
AnotherTest
1ad51325ad Kernel+LibC: Implement 'memmem'
This commit adds an implementation of memmem, using the Bitap text
search algorithm for needles smaller than 32 bytes, and a naive loop
search for longer needles.
2020-08-01 08:39:26 +02:00
Andreas Kling
ad35436786 LibC: Expose sysconf's _SC_FOO requests as macros 2020-08-01 08:18:47 +02:00
Peter Elliott
4bf4a071a6 Applications: Stop setting initial window location
This will let the WindowManager choose the location of the window
2020-08-01 08:06:48 +02:00
Peter Elliott
5ae9eee4a3 LibGUI+WindowServer: Provide default placement to windows
This prevents windows from being opened directly on top of eachother,
and provides default behavior for when window position is not specified.

The new behavior is as follows:
- Windows that have been created without a set position are assigned one
  by WindowServer.
- The assigned position is either offset from the last window that is
  still in an assigned position, or a default position if no such window
  is available.
2020-08-01 08:06:48 +02:00
etaIneLp
586ada7a14 Kernel: Tell the bootloader to put us into graphics mode 2020-08-01 07:57:29 +02:00
Till Mayer
040848a2af FileManager: Build new path of renamed files correctly
Fixes #2932.
2020-08-01 07:57:15 +02:00
thankyouverycool
0f7bba327f Base: Center window-close.png vertically 2020-08-01 07:56:48 +02:00
thankyouverycool
2f4207f8b7 Base: New buttons and background for Redmond Themes
Updates Redmond and Redmond 2000 with new title bar buttons and
changes Redmond's background to authentic 90sCorp Teal(TM).
2020-08-01 07:56:48 +02:00
thankyouverycool
c815fa7f47 Services: Convert WindowFrame button bitmaps to themable PNGs
Custom buttons can now be set using TitleButtonIcons under the
Paths group in themes. WindowFrame recognizes window-close.png,
window-minimize.png, window-maximize.png and window-restore.png
filenames.
2020-08-01 07:56:48 +02:00
thankyouverycool
41aacdf815 LibGfx: Add Paths to themes
Paths allows themes to specify directories/files where custom
resources are located.
2020-08-01 07:56:48 +02:00
Andreas Kling
044b4cc090 LibC: Flatten malloc() and free()
This allows UE to ignore the full range of these functions instead of
just the malloc() and free() bodies.
2020-07-31 20:56:48 +02:00
Andreas Kling
c7e4c0734b UserspaceEmulator: Use a report() function instead of dbgprintf()
Ultimately we'll want to make it a bit easier to add more reporting.
This at least makes it easier to redirect the logging.
2020-07-31 20:56:48 +02:00
Andreas Kling
628b3badfb Kernel+AK: Add and use Userspace<T>::unsafe_userspace_ptr()
Since we already have the type information in the Userspace template,
it was a bit silly to cast manually everywhere. Just add a sufficiently
scary-sounding getter for a typed pointer.

Thanks @alimpfard for pointing out that I was being silly with tossing
out the type.

In the future we may want to make this API non-public as well.
2020-07-31 20:56:48 +02:00
Itamar
5cd7159629 Kernel: Add _SC_PAGESIZE to sysconf
This unbreaks the gcc and binutils ports.
Previously, when _SC_PAGESIZE was missing, these packages opted to
use their own versions of getpagesize which made their build fail
because of conflicting definitions of the function.
2020-07-31 18:26:33 +02:00
Maciej Zygmanowski
cf78c16afd Userland: Add basic `lsof' command 2020-07-31 18:26:18 +02:00
AnotherTest
b00ffc860b LibCrypto: Do not trim leading zeros in export_data by default
This fixes the issue with the exported data having a leading zero,
causing RSA::encrypt to trim the block down, and ruining the encryption.

Fixes #2691 :^)
2020-07-31 18:25:20 +02:00
Andreas Kling
180207062c Kernel: Use Userspace<T> in sys$utime()
And again, another helper overload.
2020-07-31 16:38:47 +02:00
Andreas Kling
62a4099581 Kernel: Use Userspace<T> in sys$getcwd() and sys$chdir()
Add more validation helper overloads as we go. :^)
2020-07-31 16:34:47 +02:00
Andreas Kling
314dbc10d4 Kernel: Use Userspace<T> for sys$read() and sys$stat()
Add validation helper overloads as needed.
2020-07-31 16:28:37 +02:00
Andreas Kling
e39a410546 AK: Add Userspace<T>, a wrapper for userspace pointers
This will be used in the kernel to wrap pointers into userspace memory
without convenient direct access. The idea is to use the compiler to
enforce that we don't dereference userspace pointers.
2020-07-31 16:26:44 +02:00
Ben Wiederhake
538a3a2579 Userland: Add missing checks for MappedFile.is_valid() 2020-07-31 11:34:06 +02:00
Ben Wiederhake
17248ab6fe AK: On failed mmap, don't claim that there's a readable page 2020-07-31 11:34:06 +02:00
Andreas Kling
d19d6a63c6 Kernel: Add missing license headers to some syscall files 2020-07-31 01:01:41 +02:00
Andreas Kling
3023a89e9b Kernel: Remove SmapDisabler in sys$setsockopt() 2020-07-31 00:29:26 +02:00
Andreas Kling
292cd53192 Kernel: Remove SmapDisabler in sys$ioctl()
Use copy_{to,from}_user() in the various File::ioctl() implementations
instead of disabling SMAP wholesale in sys$ioctl().

This patch does not port IPv4Socket::ioctl() to those API's since that
will be more involved. That function now creates a local SmapDisabler.
2020-07-31 00:17:25 +02:00
Andreas Kling
be7add690d Kernel: Rename region_from_foo() => find_region_from_foo()
Let's emphasize that these functions actually go out and find regions.
2020-07-30 23:52:28 +02:00
Andreas Kling
2e2de125e5 Kernel: Turn Process::FileDescriptionAndFlags into a proper class 2020-07-30 23:50:31 +02:00
Andreas Kling
f2a152e930 Kernel: Simplify the ScopedSpinLock template
We can just templatize the LockType here. This makes my Qt Creator
syntax highlighting work again. :^)
2020-07-30 23:43:37 +02:00
Andreas Kling
949aef4aef Kernel: Move syscall implementations out of Process.cpp
This is something I've been meaning to do for a long time, and here we
finally go. This patch moves all sys$foo functions out of Process.cpp
and into files in Kernel/Syscalls/.

It's not exactly one syscall per file (although it could be, but I got
a bit tired of the repetitive work here..)

This makes hacking on individual syscalls a lot less painful since you
don't have to rebuild nearly as much code every time. I'm also hopeful
that this makes it easier to understand individual syscalls. :^)
2020-07-30 23:40:57 +02:00
Andreas Kling
027c450d6d Kernel: Run clang-format on Scheduler.cpp 2020-07-30 21:46:06 +02:00
AnotherTest
07ea2b672b Shell: Tweak tests to use 'echo -n' when newlines are significant 2020-07-30 18:47:41 +02:00
AnotherTest
6df2f8a8cb Userland: Add support for the '-n' flag to 'echo' 2020-07-30 18:47:41 +02:00
AnotherTest
3b3e90714f Shell: Add tests for '&&' and '||' parsing and evaluation 2020-07-30 18:47:41 +02:00
AnotherTest
c4888f4b5f Shell: Fix parse mistake in '&&' not being recursive 2020-07-30 18:47:41 +02:00
AnotherTest
4be2cb895c Shell: Do not assume that wstatus is valid after wait() returns 0
According to the linux waitid manpage, the value of wstatus is
unspecified if wait() returns 0, so we should not assume that any
value it holds is correct (including the exit code).
This is only applicable to the Lagom build.
2020-07-30 18:47:41 +02:00
AnotherTest
681bb1fb23 AK: Add (more) tests for String(View)::split*
This patchset adds some tests for String(View)::split*, hopefully
documenting their behaviour in some cases.
2020-07-30 18:47:41 +02:00
stelar7
dad22c5d5a LibCrypto: Add some checksum algorithms
Namely CRC32 and Adler32
2020-07-30 17:08:19 +02:00
stelar7
8c5f08ea94 Meta: Add .gitattributes file
This file is used to configure Git to properly handle line endings
2020-07-30 17:07:40 +02:00
Luke
98bea083c4 Kernel: Make BXVGA detection actually detect VBoxVGA
I decided to play around with trying to run Serenity in VirtualBox.
It crashed WindowServer with a beautiful array of multi-color
flashing letters :^)

Skipping getting side-tracked seeing that it chose MBVGA in the
serial debug and trying to debug why it caused such a display,
I finally checked BXVGA.

While find_framebuffer_address checks for VBoxVGA, init_stage2 didn't.
Whoops!
2020-07-30 17:01:41 +02:00
AnotherTest
1df9293ea4 LibWeb: Complete the redirect URL before loading it
the "Location" header is allowed to be a relative URL (as is the case in
our very own WebServer!)
2020-07-30 16:56:15 +02:00
Nico Weber
8e8cbe6a12 LibX86: FPU instructions never have a lock prefix 2020-07-30 16:53:33 +02:00
Nico Weber
8593bdb711 LibX86: Disassemble most remaining FPU instructions
Some of the remaining instructions have different behavior for
register and non-register ops.  Since we already have the
two-level flags tables, model this by setting all handlers in
the two-level table to the register op handler, while the
first-level flags table stores the action for the non-reg handler.
2020-07-30 16:53:33 +02:00