Age | Commit message (Collapse) | Author |
|
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.
|
|
This avoids kmalloc overwriting it because it may be within the
kmalloc or eternal pool.
|
|
Just default the InitFunction template argument.
|
|
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.
|
|
|
|
The CMOS sets bit 2 (0x4) if times are binary, if it's not
set they're in BCD.
The CMOS sets bit 1 (0x1) if hours are on a 12 hour clock.
In that case, the highest bit in the hour byte is set for
PM times (both in binary and BCD times).
Three bugs:
1. The lower 7 bits were masked off incorrectly when calling
bcd_to_binary(). Use 0x7F as mask, not 0x70.
2. The highest bit to check if a time was PM was checked after
BCD conversion of the low 7 bits, which clobbered that bit.
Do the check before BCD conversion.
3. In the 12 hour clock, midnight and noon are "12", so those
need to be converted to 0 even if for non-PM times (else
midnight is "12", not "0").
With this, SerenityOS consistently shows UTC as the current time,
as it should.
If folks want it to display local time instead, they can get this
by adding `-rtc base=localtime` to Meta/run.sh -- but a better fix
would be to add timezone management and convert from UTC system
clock to the user timezone at display time.
|
|
|
|
There is no guarantee that the memory manager lock is held when
physical pages are released, so just acquire the memory manager
lock.
|
|
Fixes #3226
|
|
This allows easier one-time thread-safe atomic initialization
of the various singletons in the Kernel.
|
|
|
|
Previously we were putting strings at the bottom of the allocated stack
region, and pointer arrays (argv, env, auxv) at the top. There was no
reason for this other than "it seemed easier to do it that way at the
time I wrote it."
This patch packs the strings and pointer vectors into the same area at
the top of the stack.
This reduces the memory footprint of all programs by 4 KiB. :^)
|
|
This does not add any behaviour change to the processes, but it ties a
TTY to an active process group via TIOCSPGRP, and returns the TTY to the
kernel when all processes in the process group die.
Also makes the TTY keep a link to the original controlling process' parent (for
SIGCHLD) instead of the process itself.
|
|
The initial inode link count was wrong in Ext2FS, as the act of adding
new inodes to their new parent bumps the count.
This regressed in df66c28479e9206adeef1f40f8c0e448c8aea77e.
|
|
This fixes a bunch of unchecked kernel reads and writes, seems like they
would might exploitable :). Write of sockaddr_in size to any address you
please...
|
|
Note that the data member is of type ImmutableBufferArgument, which has
no Userspace<T> usage. I left it alone for now, to be fixed in a future
change holistically for all usages.
|
|
|
|
|
|
|
|
This object was cumbersome and annoying (mostly due to its manually
managed, statically sized name buffer.) And now we no longer need it!
|
|
We were only using this as a temporary helper object while constructing
directories. Create a simpler Ext2FSDirectoryEntry instead for this.
|
|
The list of children can just be a bunch of { name, inode }.
|
|
We don't have to ask the VFS to find our child inode, we have a pointer
to it right here.
|
|
Unlike DirectoryEntry (which is used when constructing directories),
DirectoryEntryView does not manage storage for file names. Names are
just StringViews.
This is much more suited to the directory traversal API and makes
it easier to implement this in file system classes since they no
longer need to create temporary name copies while traversing.
|
|
|
|
AK/HashTable.h is not needed from SpuriousInterruptHandler
|
|
We should support more than 65535 threads, after all. :^)
|
|
Fixes #3182.
|
|
Pledges and Veil state don't really make sense for kernel mode
processes, as they can do what ever they want since they are in
kernel mode. Make this clear in the system monitor UI by marking
these entries as null.
|
|
|
|
These are not called anywhere in the kernel anyway.
|
|
|
|
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9".
The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30".
Let's use the correct name, at least in code.
Only changes the name of the constants, no other behavior change.
|
|
I originally defined the bytes() method for the String class, because it
made it obvious that it's a span of bytes instead of span of characters.
This commit makes this more consistent by defining a bytes() method when
the type of the span is known to be u8.
Additionaly, the cast operator to Bytes is overloaded for ByteBuffer and
such.
|
|
|
|
The behaviour of the PT_TRACEME feature has been broken for some time,
this change fixes it.
When this ptrace flag is used, the traced process should be paused
before exiting execve.
We previously were sending the SIGSTOP signal at a stage where
interrupts are disabled, and the traced process continued executing
normally, without pausing and waiting for the tracer.
This change fixes it.
|
|
This is racy in userspace and non-racy in kernelspace so let's keep
it in kernelspace.
The behavior change where CLOEXEC is preserved when dup2() is called
with (old_fd == new_fd) was good though, let's keep that.
|
|
We can just implement these in userspace, so yay two less syscalls!
|
|
We need to briefly put Stopped threads back into Running state
so that the kernel stacks can get cleaned up when they're being
killed.
Fixes #3130
|
|
|
|
Cuts time needed for `disasm /bin/id` from 2.5s to 1s -- identical
to the time it needs when not doing the random adjustment at all.
The downside is that it's now very easy to get the random offsets
with out-of-bounds reads, so it does make this mitigation less
effective.
|
|
|
|
|
|
|
|
masked off
|
|
This makes the Kernel build cleanly with -Wmissing-declarations.
|
|
As suggested in #3096.
|
|
With this, if a future module misses the 'extern "C"' or uses a wrong type,
they get a nice compiler error instead of runtime errors or weird behavior.
Also, this works towards getting the Kernel ready for -Wmissing-declarations.
|
|
The compiler can't see that the definitions inside the .h file aren't meant to be
public symbols. So in a hypothetical program which uses the Kernel API, each(\!)
compilation unit that includes FB.h would define those fb_get_size_in_bytes symbols.
If that happens twice or more times, that would cause linker errors.
Since the functions are very short, inlining them seems like a good idea.
Also, using FB.h should be possible even if the containing compilation unit
doesn't already define size_t, so I added that header (stddef), too.
|