mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 22:18:11 +00:00
Kernel: Clone Process::m_gids on fork() and hook up any framebuffer region.
This commit is contained in:
parent
6d9959e367
commit
e115ae5641
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue