Age | Commit message (Collapse) | Author |
|
These types can be picked up by including <AK/Types.h>:
* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
|
|
This makes it possible to run Serenity with more than 64 MB of RAM.
Because each physical page is represented by a PhysicalPage object, and such
objects are allocated using kmalloc_eternal(), more RAM means more pressure
on kmalloc_eternal(), so we're gonna need a better strategy for this.
But for now, let's just celebrate that we can use the 128 MB of RAM we've
been telling QEMU to run with. :^)
|
|
There's a ton of work that would need to be done before we could spin up on
another architecture, but let's at least try to separate things out a bit.
|
|
|
|
It makes no sense that clients had to worry about whether or not KSyms
were loaded.
|
|
This was causing the kmalloc/kfree call delta to accumulate errors.
|
|
|
|
This can be enabled at any time using a sysctl:
sysctl kmalloc_stacks=1
The stacks will go to the debugger output only.
|
|
This will be very helpful in tracking down unwanted kmalloc traffic. :^)
|
|
|
|
|
|
The scheduler now operates on threads, rather than on processes.
Each process has a main thread, and can have any number of additional
threads. The process exits when the main thread exits.
This patch doesn't actually spawn any additional threads, it merely
does all the plumbing needed to make it possible. :^)
|
|
|
|
|
|
This sacrifices some speed for more space. I don't want to work on a new
allocator right this moment, so this buys me some time.
|
|
I had to change PhysicalPage around a bit for this. Physical pages can now
be instantiated for any arbitrary physical address without worrying that
such pages end up in the kernel page allocator when released.
Most of the pieces were already in place, I just glued everything together.
|
|
This is quite nice, although I wish [[gnu::always_inline]] implied inline.
Also "gnu::" is kind of a wart, but whatcha gonna do.
|
|
|
|
There was a bug that given enough supervisor page allocation, we would
eventually start dipping into the kmalloc range.
|
|
I'm still somewhat okay throwing InterruptDisabler at races as they screw me.
Eventually I'm gonna have to devise a different strategy though.
|
|
|
|
Process page directories can now actually be freed. This could definitely
be implemented in a nicer, less wasteful way, but this works for now.
The spawn stress test can now run for a lot longer but eventually dies
due to kmalloc running out of memory.
|
|
It still requires an ELF compiler and linker, but at least it builds.
I need to get rid of the "Unix" namespace. This does a lot of that.
|
|
This is really neat. :^)
|
|
Skip over entirely full buckets when scanning for a big-enough memory slot.
This means I can postpone writing a better kmalloc() for a while longer! :^)
|
|
|
|
|
|
- Process::exec() needs to restore the original paging scope when called
on a non-current process.
- Add missing InterruptDisabler guards around g_processes access.
- Only flush the TLB when modifying the active page tables.
|
|
This was the fix:
-process.m_page_directory[0] = m_kernel_page_directory[0];
-process.m_page_directory[1] = m_kernel_page_directory[1];
+process.m_page_directory->entries[0] = m_kernel_page_directory->entries[0];
+process.m_page_directory->entries[1] = m_kernel_page_directory->entries[1];
I spent a good two hours scratching my head, not being able to figure out why
user process page directories felt they had ownership of page tables in the
kernel page directory.
It was because I was copying the entire damn kernel page directory into
the process instead of only sharing the two first PDE's. Dang!
|
|
This is quite cool! The syscall entry point plumbs the register dump
down to sys$fork(), which uses it to set up the child process's TSS
in order to resume execution right after the int 0x80 fork() call. :^)
This works pretty well, although there is some problem with the kernel
alias mappings used to clone the parent process's regions. If I disable
the MM::release_page_directory() code, there's no problem. Probably there's
a premature freeing of a physical page somehow.
|
|
Tweak the kmalloc space layout a bit. Get the spawn stress test up
and running again.
|
|
This is way better than walking the region lists. I suppose we could
even let the hardware trigger a page fault and handle that. That'll
be the next step in the evolution here I guess.
|
|
This isn't finished but I'll commit as I go. We need to get to where context
switching only needs to change CR3 and everything's ready to go.
My basic idea is:
- The first 4 kB is off-limits. This catches null dereferences.
- Up to the 4 MB mark is identity-mapped and kernel-only.
- The rest is available to everyone!
While the first 4 MB is only available to the kernel, it's still mapped in
every process, for convenience when entering the kernel.
|
|
|
|
The SpinLock was all backwards and didn't actually work. Fixing it exposed
how wrong most of the locking here is.
I need to come up with a better granularity here.
|
|
I also added a generator cache to FileHandle. This way, multiple
reads to a generated file (i.e in a synthfs) can transparently
handle multiple calls to read() without the contents changing
between calls.
The cache is discarded at EOF (or when the FileHandle is destroyed.)
|
|
It walks the stack and identifies anything that looks like a kernel symbol.
This could be a lot more sophisticated.
|
|
The naive spinlock was not nearly enough to protect kmalloc from
reentrancy problems.
I don't want to deal with coming up with a fancy lock for kmalloc
right now, so I made an InterruptDisabler thingy instead.
It does CLI and then STI iff interrupts were previously enabled.
|
|
I know I'm praying for cargo here, but this does fix a weird issue
where logging the sum_alloc and sum_free globals wouldn't display
symmetric values all the time.
|
|
|
|
It's a lot crappier than I remembered it. It's gonna need a lot of work.
|