summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-08-02Kernel: mount system call (#396)Jesse
It is now possible to mount ext2 `DiskDevice` devices under Serenity on any folder in the root filesystem. Currently any user can do this with any permissions. There's a fair amount of assumptions made here too, that might not be too good, but can be worked on in the future. This is a good start to allow more dynamic operation under the OS itself. It is also currently impossible to unmount and such, and devices will fail to mount in Linux as the FS 'needs to be cleaned'. I'll work on getting `umount` done ASAP to rectify this (as well as working on less assumption-making in the mount syscall. We don't want to just be able to mount DiskDevices!). This could probably be fixed with some `-t` flag or something similar.
2019-08-02CEventLoop: Devirtualize take_pending_events_from(CEventLoop)Andreas Kling
2019-08-02Meta: Added instructions for WSL in the README. (#399)Bobby Raduloff
2019-08-02AK: Simplify RefPtr and NonnullRefPtr's leak_ref() functionsAndreas Kling
Use AK::exchange() to switch out the internal storage. Also mark these functions with [[nodiscard]] to provoke an compile-time error if they are called without using the return value.
2019-08-02AK: Add anti-null assertions in RefPtr.Andreas Kling
This gives us better error messages when dereferencing null RefPtrs.
2019-08-02AK: Fix ref leaks in RefPtr assignment operators.Andreas Kling
Many of the RefPtr assignment operators would cause ref leaks when we call them to assign a pointer that's already the one kept.
2019-08-02AK: Explicitly delete NonnullRefPtr::operator=(RefPtr).Andreas Kling
This gives us much better error messages when you try to use them. Without this change, it would complain about the absence of functions named ref() and deref() on RefPtr itself. With it, we instead get a "hey, this function is deleted" error. Change operator=(T&) to operator=T(const T&) also, to keep assigning a const T& to a NonnullRefPtr working.
2019-08-02AK: Fix ref leak in NonnullRefPtr::operator=(T&).Andreas Kling
We would leak a ref when assigning a T& to a NonnullRefPtr that already contains that same T.
2019-08-02AK: Add assertions when dereferencing an OwnPtr.Andreas Kling
This will make it immediately obvious what the problem is when you're dereferencing a null OwnPtr.
2019-08-02AK: Add a test for iterating a HashTable during clear (should assert)Andreas Kling
Ideally we should also verify that the assertion actually happens, but we need some support in the TestSuite framework for that.
2019-08-02TestSuite: Hijack the ASSERT macros during unit tests.Andreas Kling
Instead of aborting the program when we hit an assertion, just print a message and keep going. This allows us to write tests that provoke assertions on purpose.
2019-08-02AK: Fix typo in the WeakPtr test. Behavior was actually correct.Andreas Kling
Also remove an unused variable.
2019-08-02AK: Fix typo in TestVector.cpp, oops.Andreas Kling
2019-08-01Kernel: Clean up thread stacks when a thread diesAndreas Kling
We were forgetting where we put the userspace thread stacks, so added a member called Thread::m_userspace_thread_stack to keep track of it. Then, in ~Thread(), we now deallocate the userspace, kernel and signal stacks (if present.) Out of curiosity, the "init_stage2" process doesn't have a kernel stack which I found surprising. :^)
2019-08-01Kernel: Delete non-main threads immediately after finalizing themAndreas Kling
Previously we would wait until the whole process died before actually deleting its threads.
2019-08-01Scheduler: Fix bitrotted SCHEDULER_RUNNABLE_DEBUG codeAndreas Kling
The runnable lists have moved from Thread to Scheduler.
2019-08-01Scheduler: Fix deadlock when first scheduling candidate being inspectedAndreas Kling
Somewhat reproducible by opening ProcessManager and trying to view the stacks for WindowServer. Regressed in 53262cd08b08f3d4d2b77cff9c348e84b1bf5eb9.
2019-08-01LibHTML: Make some use of Vector::empend().Andreas Kling
2019-08-01ProcFS: Make some use of Vector::empend().Andreas Kling
2019-08-01Ext2FS: Make some use of Vector::empend().Andreas Kling
2019-08-01AK: Use Vector::empend() a bit in the unit tests, and fix a bug.Andreas Kling
There was a bug in the "prepend_vector_object" test but it was masked by us not printing failures. (The bug was that we were adding three elements to the "objects" vector and then checking that another vector called "more_objects" indeed had three elements. Oops!)
2019-08-01TestSuite: Actually print failed comparions.. :^)Andreas Kling
2019-08-01AK: Don't allow constructing an OwnPtr from a const NonnullOwnPtr&Andreas Kling
OwnPtr's must move around, they can't be copy constructed.
2019-08-01AK: Add Vector::empend().Andreas Kling
This is a complement to append() that works by constructing the new element in-place via placement new and forwarded constructor arguments. The STL calls this emplace_back() which looks ugly, so I'm inventing a nice word for it instead. :^)
2019-08-01Documentation: Add a paragraph about NonnullOwnPtr to SmartPointers.mdAndreas Kling
2019-08-01SystemServer: Remove always-true "if (pid == 0)" checkAndreas Kling
This code should probably be structured differently to handle things like children dying, etc. But not right now. Found by PVS-Studio.
2019-08-01GDirectoryModel: Fix redundant identical comparison.Andreas Kling
Found by PVS-Studio.
2019-08-01LibCore: Initialize pid/id variables in CoreIPC{Client,Server}Andreas Kling
Also rename CoreIPCServer::m_pid to m_client_pid for clarification. Found by PVS-Studio.
2019-08-01more: Don't printf(string), printf("%s", string)!Andreas Kling
Found by PVS-Studio.
2019-08-01ProcFS: Align the buffer used for the CPUID brand string.Andreas Kling
I'm not sure if this actually matters, but it won't hurt anyone to use a 32-bit aligned buffer here. Found by PVS-Studio.
2019-08-01AK: Make Bitmap movable but not copyable.Andreas Kling
We were falling back to an incorrect compiler-generated copy ctor for this class, and let's not do that. Found by PVS-Studio.
2019-08-01Kernel: Remove unnecessary null check in Process::fork()Andreas Kling
Found by PVS-Studio.
2019-08-01ProcessManager: Fix timer leak in ProcessStacksWidgetAndreas Kling
CObjects should really be reference-counted instead of this error-prone (but convenient) model. Found by PVS-Studio.
2019-08-01pidof: Remove redundant bool check.Andreas Kling
Found by PVS-Studio.
2019-08-01Painter: Scaling RGBA32 bitmaps treated the source as alpha-less RGB32Andreas Kling
Found by PVS-Studio.
2019-08-01Kernel+LibC: A lot of the signal handling code was off-by-one.Andreas Kling
There is no signal 0. The valid ones are 1 (SIGHUP) through 31 (SIGSYS) Found by PVS-Studio.
2019-08-01LibC: In fgetc(), fread() will never return < 0.Andreas Kling
Furthermore, fread() has already handled EOF, so there's no need to do it again. If we read a character, return it, otherwise return EOF. Note that EOF means "EOF or error" here.
2019-08-01CEventLoop: Add a missing initializer to EventLoopTimer.Andreas Kling
2019-08-01JsonParser: Merge the parsing of '\n' and '\r' in quoted stringsAndreas Kling
2019-08-01CIODevice: printf() thought it was calling ::write() but it was write()Andreas Kling
There's some confusion between the write syscall and CIODevice::write() here. The internal write() returns a boolean, and has already whined in case the syscall failed, so we don't need to do that again.
2019-08-01Lagom: Append to CMAKE_CXX_FLAGS instead of overwriting it.Andreas Kling
2019-07-31GDirectoryModel: Tweak default width of permission bits columnAndreas Kling
Now that GTableView elides text content by default, this column was a little too wide and ended up getting elided sometimes.
2019-07-31GTableView: Elide cell content so it doesn't overflow the cell rectAndreas Kling
I originally thought I'd have to implement text clipping in Painter for this, but it seems like I can get away without doing that today. :^) Fixes #390.
2019-07-31WindowServer: Fix bad assertion when setting wallpaperAndreas Kling
The create_thread() syscall returns the thread ID now, not 0.
2019-07-31WindowServer: Allow moving the Launcher window type.Andreas Kling
2019-07-31Ext2FS: Fix fetching of the major/minor device numbers for st_rdev.Andreas Kling
This is how it seems to work: - If ext2_inode.i_blocks[0] is non-zero, it contains the major/minor. - Otherwise, it's in ext2_inode.i_blocks[1].
2019-07-31LibGUI: Simplify GTreeView ancestor traversalConrad Pankoff
2019-07-31FileManager: Show home directory by default, or command line argumentConrad Pankoff
FileManager used to open up with the root directory loaded by default. Now it will try to load either 1) the first argument specified on the command line, 2) the user's home directory, or 3) the root directory. Fixes #389
2019-07-31LibGUI: Reify intermediate nodes during index traversalConrad Pankoff
In the event where you want to find the index of a deeply-nested path with a GFileSystemModel that hasn't yet traversed most of that path, it is possible for a false negative failure to occur. This failure is caused by the GFileSystemModel incorrectly bailing out of the search when it hits the first unseen path segment that is not at the very end of the path. This patch fixes this problem by reifying the intermediate nodes during that search and traversal process.
2019-07-31Kernel: Port /proc/PID/fds to JSONRobin Burchell