mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Kernel: Clone Process::m_gids on fork() and hook up any framebuffer region.
This commit is contained in:
@@ -232,13 +232,18 @@ Process* Process::fork(RegisterDump& regs)
|
||||
|
||||
for (auto& region : m_regions) {
|
||||
#ifdef FORK_DEBUG
|
||||
dbgprintf("fork: cloning Region{%p}\n", region.ptr());
|
||||
dbgprintf("fork: cloning Region{%p} \"%s\" L%x\n", region.ptr(), region->name.characters(), region->linearAddress.get());
|
||||
#endif
|
||||
auto cloned_region = region->clone();
|
||||
child->m_regions.append(move(cloned_region));
|
||||
MM.map_region(*child, *child->m_regions.last());
|
||||
if (region.ptr() == m_display_framebuffer_region.ptr())
|
||||
child->m_display_framebuffer_region = child->m_regions.last().copyRef();
|
||||
}
|
||||
|
||||
for (auto gid : m_gids)
|
||||
child->m_gids.set(gid);
|
||||
|
||||
child->m_tss.eax = 0; // fork() returns 0 in the child :^)
|
||||
child->m_tss.ebx = regs.ebx;
|
||||
child->m_tss.ecx = regs.ecx;
|
||||
|
||||
Reference in New Issue
Block a user