# fork.c File Reference

`#include <ubixos/fork.h>`
`#include <ubixos/types.h>`
`#include <ubixos/sched.h>`
`#include <ubixos/tty.h>`
`#include <ubixos/vitals.h>`
`#include <vmm/vmm.h>`
`#include <string.h>`
`#include <assert.h>`

Include dependency graph for fork.c:

Go to the source code of this file.

## Functions

| asm (".globl sysFork \n""sysFork: \n"" xor %eax,%eax \n"" call schedNewTask \n"" testl %eax,%eax \n"" je fork_ret \n"" pushl %esi \n"" pushl %edi \n"" pushl %ebp \n"" pushl %eax \n"" call fork_copyProcess \n"" movl %eax,(%ebx) \n"" addl $16,%esp \n""fork_ret: \n"" ret \n")
int | fork_copyProcess (struct taskStruct *newProcess, long ebp, long edi, long esi, long none, long ebx, long ecx, long edx, long eip, long cs, long eflags, long esp, long ss)

## Function Documentation

asm | ( | ".globl sysFork \n""sysFork: \n"" xor % | eax,
|  | %eax\n""call schedNewTask\n""testl% | eax,
|  | %eax\n""je fork_ret\n""pushl%esi\n""pushl%edi\n""pushl%ebp\n""pushl%eax\n""call fork_copyProcess\n""movl% | eax,
|  | (%ebx)\n""addl $ | 16,
|  | %esp\n""fork_ret:\n""ret\n" |  |
| ) |  |  |

int fork_copyProcess | ( | struct taskStruct * | newProcess,
|  | long | ebp,
|  | long | edi,
|  | long | esi,
|  | long | none,
|  | long | ebx,
|  | long | ecx,
|  | long | edx,
|  | long | eip,
|  | long | cs,
|  | long | eflags,
|  | long | esp,
|  | long | ss |
| ) |  |  |

Definition at line 50 of file fork.c.

References _current, assert, tssStruct::back_link, tssStruct::cr3, tssStruct::cs, osInfo::cwd, tssStruct::ds, tssStruct::eax, tssStruct::ebp, tssStruct::ebx, tssStruct::ecx, tssStruct::edi, tssStruct::edx, tssStruct::eflags, tssStruct::eip, tssStruct::es, tssStruct::esi, tssStruct::esp, tssStruct::esp0, tssStruct::esp1, tssStruct::esp2, FORK, tssStruct::fs, taskStruct::gid, tssStruct::gs, taskStruct::id, tssStruct::io_map, tssStruct::ldt, memcpy(), taskStruct::oInfo, tty_termNode::owner, sched_yield(), tssStruct::ss, tssStruct::ss0, tssStruct::ss1, tssStruct::ss2, taskStruct::state, taskStruct::term, tssStruct::trace_bitmap, taskStruct::tss, taskStruct::uid, vmmCopyVirtualSpace(), and osInfo::vmStart.

Here is the call graph for this function: