Age | Commit message (Collapse) | Author |
|
The process of expanding memory requires allocations and deallocations
on the heap itself. So, while we're trying to expand the heap, don't
remove memory just because we might briefly not need it. Also prevent
recursive expansion attempts.
|
|
If allocating a page table triggers purging memory, we need to call
quickmap_pd again to make sure the underlying physical page is
remapped to the correct one. This is needed because purging itself
may trigger calls to ensure_pte as well.
Fixes #3370
|
|
We should be able to gracefully fail a commit in low-memory situations.
|
|
|
|
When cloning a purgeable memory region (which happens on fork),
we need to preserve the "was purged" and "volatile" state of the
original region, or they will always appear as non-volatile and
unpurged regions in the child process.
Fixes #3374.
|
|
Patch from Anonymous.
|
|
features
The exit condition for the loop was sizeof(m_features) * 8,
which was 32. Presumably this was supposed to mean 32 bits, but it
actually made it stop as soon as it reached the 6th bit.
Also add detection for more SIMD CPU features.
|
|
Also adds FIXME for VirtualBox.
|
|
This doesn't need to be its own syscall either. :^)
|
|
|
|
Add an ExpandableHeap and switch kmalloc to use it, which allows
for the kmalloc heap to grow as needed.
In order to make heap expansion to work, we keep around a 1 MiB backup
memory region, because creating a region would require space in the
same heap. This means, the heap will grow as soon as the reported
utilization is less than 1 MiB. It will also return memory if an entire
subheap is no longer needed, although that is rarely possible.
|
|
This doesn't need to be its own syscall. Thanks @BenWiederhake for
the idea. :^)
|
|
Source: https://wiki.osdev.org/Shutdown
|
|
|
|
|
|
|
|
A change introduced in 5e01234 made it the resposibility of each
filesystem to have the file types returned from
'traverse_as_directory' match up with the DT_* types.
However, this caused corruption of the Ext2FS file format because
the Ext2FS uses 'traverse_as_directory' internally when manipulating
the file system. The result was a mixture between EXT2_FT_* and DT_*
file types in the internal Ext2FS structures.
Starting with this commit, the conversion from internal filesystem file
types to the user facing DT_* types happens at a later stage,
in the 'FileDescription::get_dir_entries' function which is directly
used by sys$get_dir_entries.
|
|
This fixes an issue we had in the git port where git would not
recognize untracked files (for example in 'git status').
When git used readdir, the 'd_type' field in the dirent struct contained
bad values (Specifically, it contained the values defiend in
Kernel/FileSystem/ext2_fs.h instead of the ones in LibC/dirent.h).
After this fix, we can create a new git repository with 'git init', and
then stage and commit files as usual.
|
|
When unmapping regions, check if page tables can be freed.
This is a follow-up change for #3254.
|
|
An IRQ handler should always be ready to respond to any IRQ.
We must remember that hardware can generate IRQs without any interaction
from our code at all. Ignoring IRQs in such cases is obviously not the
right thing to do.
|
|
|
|
Make sure the expression is evaluated as time_t so that it does
the right thing after 2037, and factor things so that the constants
look less magical.
|
|
The JS tests pointed out that the implementation in DateTime
had an off-by-one in the month when doing the leap year check,
so this change fixes that bug.
|
|
I believe the implementation in RTC.cpp had an off-by-one
in the year passed to is_leap_year(). If that's true, then this
fixes that too.
|
|
|
|
We can't use a HashMap with a small key that doesn't guarantee
collisions. Change it to a HashTable instead.
Fixes #3254
|
|
We need to hold the memory manager lock so nobody else can modify
these lists while we're iterating them.
|
|
|
|
|
|
This avoids kmalloc overwriting it because it may be within the
kmalloc or eternal pool.
|
|
MemoryManager cannot use the Singleton class because
MemoryManager::initialize is called before the global constructors
are run. That caused the Singleton to be re-initialized, causing
it to create another MemoryManager instance.
Fixes #3226
|
|
Rather than hardcoding where the kmalloc pool should be, place
it at the end of the kernel image instead. This avoids corrupting
global variables or other parts of the kernel as it grows.
Fixes #3257
|
|
We should not be moving ref-counted objects.
|
|
When trying to scroll up on virtualizers that don't use the VMware
backdoor and instead use PS2MouseDevice, it would actually scroll
down rapidly.
Looking into it, the mouse delta for scrolling down was 1 and 15
for scrolling up. 15 is suspiciously -1 for a nibble.
According to https://isdaman.com/alsos/hardware/mouse/ps2interface.htm
the Z is actually 4 bits for Intellimouse.
This fixes scrolling up on virtualizers such as VirtualBox.
|
|
These are not called in the kernel or by libstdc++ anyway.
Remove the tempting function, and prevent future overflows.
|
|
1. Preallocate args hashmap to prevent rehashing.
2. Use move to prevent string copies.
|
|
|
|
The kernel no longer needs sprintf (which might, in theory, overflow),
so we can hide the C++ declaration and make the function uncallable
from within the kernel.
However, libstdc++ still links against it, as libstdc++ uses it for
demangling, from AK::demangle().
|
|
|
|
In contrast to sprintf, which might overflow the given buffer.
I feel bad about the code duplication, but that is a pre-existing issue.
|
|
This reverts commit f48feae0b2a300992479abf0b2ded85e45ac6045.
|
|
|
|
|
|
This reverts commit f0906250a181c831508a45434b9f645ff98f33e4.
|
|
This reverts commit 8a75e0b892ab8e1c4765ac4e2f7289b258f1bf5a.
|
|
This reverts commit 5a98e329d157a2db8379e0c97c6bdc1328027843.
|
|
This reverts commit 41c005cb140c8a9ae94e6b68456d8d6f1d925a8f.
|
|
This reverts commit a89ccd842becdfbc951436da5384d8819374e0f4.
|
|
This reverts commit b306f240a4a3ef4a8f5797734457572e0026cc0c.
|
|
Rather than hardcoding where the kmalloc pool should be, place
it at the end of the kernel image instead. This avoids corrupting
global variables or other parts of the kernel as it grows.
Fixes #3257
|