1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

Kernel: Actually zero-fill eagerly committed regions.

Previously, calling Region::commit() would make sure to allocate any missing
physical pages, but they would contain uninitialized data. This was very
obvious when allocating GraphicsBitmaps as they would have garbage pixels
rather than being filled with black.

The MM quickmap mechanism didn't work when operating on a non-active page
directory (which happens when we're in the middle of exec, for example.)
This patch changes quickmap to reside in the shared kernel page directory.

Also added some missing clobber lists to inline asm that I stumbled on.
This commit is contained in:
Andreas Kling 2019-01-31 03:57:06 +01:00
parent 6b88025dda
commit 0932efe72e
3 changed files with 47 additions and 28 deletions

View file

@ -83,7 +83,14 @@ void write_gdt_entry(word selector, Descriptor&);
#define sti() asm volatile("sti")
#define memory_barrier() asm volatile ("" ::: "memory")
static inline dword cpu_flags()
inline dword cpu_cr3()
{
dword cr3;
asm volatile("movl %%cr3, %%eax":"=a"(cr3));
return cr3;
}
inline dword cpu_flags()
{
dword flags;
asm volatile(