Commit Graph

23830 Commits

Author SHA1 Message Date
brapru
5b6d2644bc LibCore: Generate new passwd file by checking pw_name
LibCore::Account::generate_passwd_file should follow
generate_shadow_file by conditionally checking for the username.
Previously, usermod's set_uid changes would not reflect in the updated
passwd file as m_uid had already been changed to the updated value.
2021-07-14 08:06:30 +02:00
brapru
9b5a1b5036 Utilities: Implement usermod command
Previously there was no way to modify existing user accounts.
2021-07-14 08:06:30 +02:00
brapru
6ef6bd1ccb LibCore: Add setters for all user account properties 2021-07-14 08:06:30 +02:00
Joachim Le Fournis
1420549abf Ports: Add epsilon 15.5.0 2021-07-14 05:27:25 +02:00
Andreas Kling
c42807e3dc Kernel: Remove debug spam when PhysicalRegion::take_free_page() fails
We can have multiple PhysicalRegions (often the case when there is a
huge amount of RAM) so we really shouldn't print a debug message any
time someone tries to allocate from one. They will move on to another
region anyway.
2021-07-14 01:37:31 +02:00
Andreas Kling
5c24d18923 Kernel: Fix logic error in PhysicalRegion::contains()
This was incorrectly returning true for the address one byte past the
end of the region.
2021-07-14 01:37:19 +02:00
Andreas Kling
6cc1247395 Kernel: Cut allocation size for physical buddy bitmaps in half
We were allocating twice as much memory as we needed for these bitmaps
due to a silly typo. Found by tomuta trying to boot with 24 GiB of RAM.
2021-07-13 23:47:49 +02:00
pancake
eb7b755937 Ports: Add vlang weekly.2021.28 package 2021-07-13 23:30:59 +02:00
ForLoveOfCats
60713c5fcf KeyboardPreferenceLoader: Use correct default Num Lock config value 2021-07-13 23:25:07 +02:00
Liav A
11fe38346c Meta: Remove options of explicit command line runners in run script
Let's remove the qcmd and q35_cmd options and instead have a simple
"q35" run option. Specifiying the kernel command line was a neat trick
I personally used for many debug sessions, but it seems better to stick
to setting it internally in the kernel or modifying the shell
SERENITY_KERNEL_CMDLINE environment variable to do this.
2021-07-13 23:24:16 +02:00
Liav A
c92c944356 Meta: Tweak qemu run script to use pcie-root-ports
With this change, we use 6 PCIe root ports in the Q35 machine, and plug
the bochs-display device into one of those PCIe ports.
We plug the bochs-display as function 0 of that device, because
otherwise SeaBIOS and also the kernel will not detect its presence.
2021-07-13 23:24:16 +02:00
LuK1337
62c5a5351c LibGUI: Handle KeyDown when checking for Key_Escape in Dialog too
This makes 'escaping' the dialogs seem bit faster :^)
It also follows what RunWindow and probably others do.
2021-07-13 23:23:49 +02:00
Andreas Kling
d8ff46594a Kernel: Re-add accidentally removed friendship
PageDirectory and MemoryManager need to remain friends, for now..
2021-07-13 23:21:22 +02:00
Gunnar Beutner
2fc002f778 DynamicLoader: Add RELA support for self-relocations
GCC doesn't seem to rely on those to work, but Clang does.
2021-07-13 23:20:36 +02:00
Itamar
42eb06f045 LibCpp: Don't store entire ASTNode vector in each parser state
We previously stored the entire ASTNode vector in each parser state,
and this vector was copied whenever a state was loaded or saved.

We don't actually need to store the whole nodes list in each state
because a new state can only add new nodes to this list, and won't
mutate existing nodes.

It would suffice to only hold a vector of the nodes that were created
while parsing in the current state to keep a reference to them.

This reduces the time it takes on my machine for the c++ language
server to handle a file that #includes <LibGUI/Widget.h> from ~4sec to
~0.7sec.
2021-07-13 23:20:09 +02:00
Itamar
eb6a15d52b LibCpp: Only store error messages for the main parser state
There's no need to store parser error messages for states with
depth > 0, as they will eventually be popped from the states stack and
their error messages will never be displayed to the user.

Profiling shows that this change reduces the % of backtraces that
contain the store_state & load_state functions from ~95% to ~70%.

Empirically this change reduces the time it takes on my machine for the
c++ language server to handle a file that #includes <LibGUI/Widget.h>
from ~14sec to ~4sec.
2021-07-13 23:20:09 +02:00
Gunnar Beutner
2c41e89d08 LibDebug: Implement symbolication for x86_64 2021-07-13 23:19:33 +02:00
Gunnar Beutner
567fa4b2f0 LibDebug: Fix spelling mistake 2021-07-13 23:19:33 +02:00
Gunnar Beutner
4cf24c6ba2 Userland: Prefer using ARCH() over __LP64__ 2021-07-13 23:19:33 +02:00
Andreas Kling
de4ba1f39b Kernel: Remove some friendships and make some classes non-copy/moveable 2021-07-13 23:19:00 +02:00
Andreas Kling
424afdd72b Kernel: Remove some unnecessary includes in VM/Physical* 2021-07-13 23:11:06 +02:00
Andreas Kling
0a21d421d9 Kernel: Print a summary of physical zones during boot
Let's not print out every single zone, since that gets very noisy on
machines with a lot of RAM. :^)
2021-07-13 23:08:45 +02:00
Andreas Kling
bf5e4326ac Kernel: Fix bogus address calculation in initialize_physical_pages()
We were incorrectly using sizeof(PhysicalPageEntry) for some address
calculations instead of sizeof(PageTableEntry).

It still worked correctly because they happen to be the same size.
2021-07-13 23:08:45 +02:00
Andreas Kling
e323942623 Kernel: Only loop through usable zones when allocating >1 physical page
We still have to loop here, since a zone can be "usable" while not
being able to satisfy a multi-page allocation request.
2021-07-13 23:08:45 +02:00
Andreas Kling
379bcd26e4 Kernel: Avoid O(n) loop over zones when allocating from PhysicalRegion
We now keep all the PhysicalZones on one of two intrusive lists within
the PhysicalRegion.

The "usable" list contains all zones that can be allocated from,
and the "full" list contains all zones with no free pages.
2021-07-13 23:08:45 +02:00
Andreas Kling
9ae067aa7f Kernel: Make PhysicalRegion eternally allocated 2021-07-13 22:40:25 +02:00
Andreas Kling
959ceb4424 Kernel: Remove PhysicalRegion::finalize_capacity()
There's no reason to delay calculating the capacity (total page count)
of each PhysicalRegion. Just do it in the constructor.
2021-07-13 22:40:25 +02:00
Andreas Kling
5171249540 Kernel: Simplify the way PhysicalRegions are constructed
Instead of creating a PhysicalRegion and then expanding it over and
over as we traverse the memory map on boot, we now compute the final
size of the contiguous physical range up front, and *then* create a
PhysicalRegion object.
2021-07-13 22:40:25 +02:00
Andreas Kling
479df315d2 Kernel: Make PhysicalZone an eternally allocated object
Until we start supporting hot-pluggable RAM, these will not be freed
or reallocated during the kernel's lifetime. :^)
2021-07-13 22:40:25 +02:00
Andreas Kling
6ea5db20ff Kernel: Remove unused used/free pages API's from PhysicalRegion 2021-07-13 22:40:25 +02:00
Andreas Kling
be90e51355 Kernel: Remove API for requesting physical allocation alignment
Nobody was using this API to request anythign about `PAGE_SIZE`
alignment, so let's get rid of it for now. We can reimplement it if
we end up needing it.

Also note that it wasn't actually used anywhere.
2021-07-13 22:40:25 +02:00
Andreas Kling
ba87571366 Kernel: Implement zone-based buddy allocator for physical memory
The previous allocator was very naive and kept the state of all pages
in one big bitmap. When allocating, we had to scan through the bitmap
until we found an unset bit.

This patch introduces a new binary buddy allocator that manages the
physical memory pages.

Each PhysicalRegion is divided into zones (PhysicalZone) of 16MB each.
Any extra pages at the end of physical RAM that don't fit into a 16MB
zone are turned into 15 or fewer 1MB zones.

Each zone starts out with one full-sized block, which is then
recursively subdivided into halves upon allocation, until a block of
the request size can be returned.

There are more opportunities for improvement here: the way zone objects
are allocated and stored is non-optimal. Same goes for the allocation
of buddy block state bitmaps.
2021-07-13 22:40:25 +02:00
Andreas Kling
be83b3aff4 AK: Make Bitmap::set() non-const 2021-07-13 22:40:25 +02:00
Karol Kosek
5c89305fc6 LibGUI: Don't clear textbox on save mode in FilePicker
This fixes a rather frustrating issue during saving a file,
when clicking on a folder (to change the path of saved file)
caused the filename to disappear from the text box.
2021-07-13 21:16:44 +02:00
Idan Horowitz
f09e361eef CI: Disallow spaces just before the separating colon in commit titles 2021-07-13 19:56:14 +01:00
Idan Horowitz
804d592303 LibJS: Add missing has_constructor override to Generator Functions 2021-07-13 20:40:57 +02:00
Luke
e9eae9d880 LibWeb: Add extracting character encoding from a meta content attribute
Some Gmail emails contain this.
2021-07-13 20:23:44 +02:00
Tom
b919789db2 Kernel: Kill user mode threads that are marked to die
Threads that don't make syscalls still need to be killed, and we can
do that at any time we want so long the thread is in user mode and
not somehow blocked (e.g. page fault).
2021-07-13 20:23:10 +02:00
Tom
fa8fe40266 Revert "Kernel: Make sure threads which don't do any syscalls are t..."
This reverts commit 3c3a1726df.

We cannot blindly kill threads just because they're not executing in a
system call. Being blocked (including in a page fault) needs proper
unblocking and potentially kernel stack cleanup before we can mark a
thread as Dying.

Fixes #8691
2021-07-13 20:23:10 +02:00
Linus Groh
552185066e LibC: Use C-style void cast in assert() 2021-07-13 19:02:20 +01:00
Karol Kosek
d34ef6d997 FileManager: Add Rename action to context and application menu
Prior to this change, the only way to rename a file was to press F2
on keyboard.
2021-07-13 17:54:37 +02:00
Karol Kosek
886e011608 LibGUI: Add Rename action 2021-07-13 17:54:37 +02:00
kleines Filmröllchen
f634949d26 LibAudio: Use new Vector formatter 2021-07-13 17:40:07 +02:00
kleines Filmröllchen
1e1fa4eac4 AK: Add Formatter for Vector
For debugging purposes, it is very useful to look at a Vector in a
simple list representation. Therefore, the new Formatter for Vector
provides a string representation of the following form:

```
[ 1, 2, 3, 4, 5 ]
```

This requires the content type of Vector to be formattable with default
arguments.

The current implementation ignores width and precision, which may be
accounted for later or passed down to the content formatter.
2021-07-13 17:40:07 +02:00
Gunnar Beutner
5f3773b715 LibC: Increase minimum alignment for malloc() to 16 bytes
This is required to make SSE instructions work when building with
Clang. Apparently Clang uses SSE instructions where GCC didn't so
we didn't previously run into this problem.
2021-07-13 17:31:22 +02:00
ngc6302h
3b81ba7c4f HashMap: Rename finders with a more accurate and self-descripting name 2021-07-13 17:31:00 +02:00
ngc6302h
213e2af281 HashTable: Rename finders with a more accurate and self-descripting name 2021-07-13 17:31:00 +02:00
ngc6302h
de7831153f Vector: Homogenize type and parameter names for predicates 2021-07-13 17:31:00 +02:00
luk1337
334499a3f4
du: Don't fail immediately when directory can't be read (#8719) 2021-07-13 17:30:38 +02:00
Gunnar Beutner
77795b2c8f Meta: Make sure files are installed with the right UID and GID
Unfortunately we can't just use --chown everywhere because only rsync
version 3.1 and newer support it and the default rsync on macOS is
2.6.9.

Fixes #8711.
2021-07-13 13:30:29 +02:00