paging.h
ubixos/types.h
sys/sysproto.h
sys/thread.h
src/sys/include/vmm/vmm.h
src/sys/vfs/file.c
sys/thread.h
ubixos/types.h
sys/_types.h
src/sys/include/vmm/paging.h
sys/sysproto.h
sys/signal.h
src/sys/kernel/elf.c
src/sys/kmods/kmod.c
src/sys/lib/kmalloc.c
src/sys/vmm/paging.c
src/sys/kernel/systemtask.c
src/sys/include/vmm/paging.h
src/sys/kernel/ld.c
src/sys/kernel/fork.c
src/sys/vmm/createvirtualspace.c
src/sys/vmm/vmm_init.c
src/sys/kernel/sched.c
src/sys/include/vmm/vmm.h
src/sys/vmm/setpageattributes.c
src/sys/vmm/getphysicaladdr.c
src/sys/init/main.c
src/sys/kernel/bioscall.c
src/sys/kernel/syscall.c
src/sys/vmm/pagefault.c
src/sys/include/ubixos/init.h
src/sys/vmm/unmappage.c
src/sys/vmm/vmm_memory.c
src/sys/kernel/endtask.c
src/sys/vfs/file.c
src/sys/vmm/getfreepage.c
src/sys/sys/idt.c
src/sys/kernel/exec.c
src/sys/vmm/getfreevirtualpage.c
src/sys/vmm/copyvirtualspace.c
btoc
x
(((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)
obreak
vmmGetFreeVirtualPage
ctob
x
((x)<<PAGE_SHIFT)
obreak
vmmGetFreeVirtualPage
KERNEL_PAGE_DEFAULT
(PAGE_PRESENT|PAGE_WRITE)
execFile
vmm_getFreeMallocPage
vmm_pagingInit
vmm_remapPage
vmmGetFreeKernelPage
vmmGetFreePage
vmmMapFromTask
PAGE_COW
0x00000200
vmm_cleanVirtualSpace
vmm_pageFault
vmm_remapPage
vmmCopyVirtualSpace
vmmFreeProcessPages
vmmGetFreeVirtualPage
PAGE_DEFAULT
(PAGE_PRESENT|PAGE_WRITE|PAGE_USER)
elf_loadfile
execFile
kmod_load
ldEnable
obreak
sys_exec
sysExec
vmm_pageFault
vmm_remapPage
vmmCopyVirtualSpace
vmmCreateVirtualSpace
vmmGetFreeVirtualPage
PAGE_MASK
(PAGE_SIZE-1)
PAGE_PRESENT
0x00000001
elf_loadfile
execFile
sys_exec
sysExec
vmm_cleanVirtualSpace
vmm_remapPage
vmmGetFreeVirtualPage
PAGE_SHIFT
12
sys_exec
sysExec
PAGE_SIZE
(1<<PAGE_SHIFT)
sysExec
PAGE_STACK
0x00000400
execFile
vmm_cleanVirtualSpace
vmm_remapPage
vmmCopyVirtualSpace
PAGE_USER
0x00000004
elf_loadfile
execFile
sys_exec
sysExec
PAGE_WIRED
0x00000600
PAGE_WRITE
0x00000002
pageEntries
(pageSize/4)
vmm_pageFault
vmm_pagingInit
vmm_remapPage
vmmClearVirtualPage
vmmCopyVirtualSpace
vmmCreateVirtualSpace
vmmFreeProcessPages
vmmGetFreeVirtualPage
pageLength
0x00000400
pageSize
4096
parentPageDirAddr
0x100000
vmm_cleanVirtualSpace
vmm_pageFault
vmm_remapPage
vmmCopyVirtualSpace
vmmCreateVirtualSpace
vmmFreeProcessPages
vmmGetFreeVirtualPage
round_page
x
(((x) + PAGE_MASK) & ~PAGE_MASK)
obreak
sys_exec
sysExec
tablesBaseAddress
0xBFC00000
vmm_cleanVirtualSpace
vmm_getFreeMallocPage
vmm_getPhysicalAddr
vmm_pageFault
vmm_remapPage
vmm_setPageAttributes
vmmCopyVirtualSpace
vmmCreateVirtualSpace
vmmFreeProcessPages
vmmGetFreeKernelPage
vmmGetFreePage
vmmGetFreeVirtualPage
vmmMapFromTask
vmmUnmapPage
vmmUnmapPages
trunc_page
x
((x) & ~PAGE_MASK)
sys_exec
sysExec
VM_TASK
1
mmap
sysExec
sysGetFreePage
vmmGetFreeVirtualPage
VM_THRD
0
sysGetFreePage
vmmGetFreeVirtualPage
void void _vmm_pageFault () _vmm_pageFault
int int mmap (struct thread *, struct mmap_args *) mmap struct thread * struct mmap_args * _current mmap_args::addr mmap_args::fd mmap_args::flags taskStruct::id kprintf mmap_args::len mmap_args::pad mmap_args::pos mmap_args::prot thread::td_retval VM_TASK vmmGetFreeVirtualPage x1000
int int munmap (struct thread *, struct munmap_args *) munmap struct thread * struct munmap_args * kprintf
int int obreak (struct thread *, struct obreak_args *) obreak struct thread * struct obreak_args * _current btoc ctob taskStruct::id K_PANIC kprintf obreak_args::nsize PAGE_DEFAULT round_page thread::vm_daddr thread::vm_dsize vmm_remapPage vmmFindFreePage
void * void* vmm_getFreeMallocPage (uInt16 count) vmm_getFreeMallocPage uInt16 count fkpSpinLock K_PANIC KERNEL_PAGE_DEFAULT spinLock spinUnlock sysID tablesBaseAddress vmm_remapPage vmmClearVirtualPage vmmFindFreePage x1000 getEmptyDesc
uInt32 uInt32 vmm_getPhysicalAddr (uInt32) vmm_getPhysicalAddr uInt32 pageAddr

Function: void *vmmGetPhysicalAddr(); Description: Returns The Physical Address Of The Virtual Page Notes:

tablesBaseAddress
x1000
vmm_pageFault
vmmCopyVirtualSpace
vmmCreateVirtualSpace
void void vmm_pageFault (uInt32, uInt32, uInt32) vmm_pageFault uInt32 uInt32 uInt32 _current adjustCowCounter endTask taskStruct::id kpanic kprintf PAGE_COW PAGE_DEFAULT pageEntries pageFaultSpinLock parentPageDirAddr spinLock spinUnlock tablesBaseAddress taskStruct::td thread::vm_daddr thread::vm_dsize vmm_getPhysicalAddr vmmFindFreePage vmmGetFreeVirtualPage vmmUnmapPage x1 x1000
int int vmm_pagingInit () vmm_pagingInit _vmm_pageFault K_PANIC KERNEL_PAGE_DEFAULT kernelPageDirectory kprintf memset numPages pageEntries sysID vmm_remapPage vmmFindFreePage vmmMemoryMap vmmMemoryMapAddr x1 x1000 vmm_init
int int vmm_remapPage (uInt32, uInt32, uInt16) vmm_remapPage uInt32 uInt32 uInt16 _current freePage taskStruct::id K_PANIC KERNEL_PAGE_DEFAULT kprintf PAGE_COW PAGE_DEFAULT PAGE_PRESENT PAGE_STACK pageEntries parentPageDirAddr rmpSpinLock spinLock spinUnlock tablesBaseAddress vmmFindFreePage x1000 elf_loadfile execFile kmod_load ldEnable obreak sys_exec sysExec vmm_getFreeMallocPage vmm_pagingInit vmmGetFreeKernelPage vmmGetFreePage vmmGetFreeVirtualPage vmmMapFromTask
int int vmm_setPageAttributes (uInt32, uInt16) vmm_setPageAttributes uInt32 uInt16 kpanic tablesBaseAddress x1000 elf_loadfile execFile sys_exec sysExec
int int vmmClearVirtualPage (uInt32 pageAddr) vmmClearVirtualPage uInt32 pageAddr pageEntries vmm_getFreeMallocPage vmmGetFreeKernelPage vmmGetFreePage vmmGetFreeVirtualPage
void * void* vmmCopyVirtualSpace (pidType) vmmCopyVirtualSpace pidType adjustCowCounter cvsSpinLock kpanic memset PAGE_COW PAGE_DEFAULT PAGE_STACK pageEntries parentPageDirAddr spinLock spinUnlock tablesBaseAddress vmm_getPhysicalAddr vmmGetFreeKernelPage vmmUnmapPage x1 x1000 fork_copyProcess
void * void* vmmCreateVirtualSpace (pidType) vmmCreateVirtualSpace pidType PAGE_DEFAULT pageEntries parentPageDirAddr tablesBaseAddress vmm_getPhysicalAddr vmmGetFreePage vmmUnmapPage execFile
void * void* vmmGetFreeKernelPage (pidType pid, uInt16 count) vmmGetFreeKernelPage pidType pid uInt16 count fkpSpinLock K_PANIC KERNEL_PAGE_DEFAULT spinLock spinUnlock tablesBaseAddress vmm_remapPage vmmClearVirtualPage vmmFindFreePage vmmCopyVirtualSpace
void * void* vmmGetFreePage (pidType) vmmGetFreePage pidType KERNEL_PAGE_DEFAULT kpanic spinLock spinUnlock tablesBaseAddress vmm_remapPage vmmClearVirtualPage vmmFindFreePage vmmGFPlock x1000 vmmCreateVirtualSpace
void * void* vmmGetFreeVirtualPage (pidType, int, int) vmmGetFreeVirtualPage pidType int int _current btoc ctob fvpSpinLock taskStruct::id K_PANIC kpanic kprintf taskStruct::oInfo PAGE_COW PAGE_DEFAULT PAGE_PRESENT pageEntries parentPageDirAddr spinLock spinUnlock tablesBaseAddress taskStruct::td thread::vm_daddr thread::vm_dsize VM_TASK VM_THRD vmm_remapPage vmmClearVirtualPage vmmFindFreePage osInfo::vmStart x1 x1000 mmap sysExec sysGetFreePage vmm_pageFault
void * void* vmmMapFromTask (pidType, void *, uInt32) vmmMapFromTask pidType void * uInt32 _current tssStruct::cr3 K_PANIC KERNEL_PAGE_DEFAULT taskStruct::oInfo schedFindTask tablesBaseAddress taskStruct::tss vmm_remapPage vmmUnmapPage osInfo::vmStart x1000
void void vmmUnmapPage (uInt32, int) vmmUnmapPage uInt32 int tablesBaseAddress x1000 vmm_pageFault vmmCopyVirtualSpace vmmCreateVirtualSpace vmmMapFromTask
void void vmmUnmapPages (void *, uInt32) vmmUnmapPages void * uInt32 tablesBaseAddress
uInt32 * uInt32* kernelPageDirectory kernelPageDirectory _int8 execFile execThread idt_init vmm_pagingInit

    /*****************************************************************************************
    Copyright(c)2002-2004TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: paging_8h.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #ifndef_PAGING_H
    #define_PAGING_H

    #include<ubixos/types.h>
    #include<sys/sysproto.h>
    #include<sys/thread.h>

    #defineVM_THRD0
    #defineVM_TASK1

    #definepageLength0x00000400
    #definepageSize4096
    #definepageEntries(pageSize/4)
    #definetablesBaseAddress0xBFC00000
    #defineparentPageDirAddr0x100000

    #definePAGE_COW0x00000200
    #definePAGE_STACK0x00000400
    #definePAGE_WIRED0x00000600
    #definePAGE_PRESENT0x00000001
    #definePAGE_WRITE0x00000002
    #definePAGE_USER0x00000004
    #definePAGE_DEFAULT(PAGE_PRESENT|PAGE_WRITE|PAGE_USER)
    #defineKERNEL_PAGE_DEFAULT(PAGE_PRESENT|PAGE_WRITE)

    #definePAGE_SHIFT12/*LOG2(PAGE_SIZE)*/
    #definePAGE_SIZE(1<<PAGE_SHIFT)/*bytes/page*/
    #definePAGE_MASK(PAGE_SIZE-1)

    #definetrunc_page(x)((x)&~PAGE_MASK)
    #defineround_page(x)(((x)+PAGE_MASK)&~PAGE_MASK)
    #definectob(x)((x)<<PAGE_SHIFT)
    #definebtoc(x)(((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)

    intvmmClearVirtualPage(uInt32pageAddr);

    voidvmmUnmapPage(uInt32,int);
    voidvmmUnmapPages(void*,uInt32);
    void*vmmMapFromTask(pidType,void*,uInt32);
    void*vmmCopyVirtualSpace(pidType);
    void*vmmGetFreePage(pidType);
    void*vmmGetFreeKernelPage(pidTypepid,uInt16count);
    void*vmmCreateVirtualSpace(pidType);
    void*vmmGetFreeVirtualPage(pidType,int,int);

    uInt32vmm_getPhysicalAddr(uInt32);
    intvmm_setPageAttributes(uInt32,uInt16);
    intvmm_remapPage(uInt32,uInt32,uInt16);
    intvmm_pagingInit();
    void*vmm_getFreeMallocPage(uInt16count);
    voidvmm_pageFault(uInt32,uInt32,uInt32);
    void_vmm_pageFault();
    intmmap(structthread*,structmmap_args*);
    intobreak(structthread*,structobreak_args*);
    intmunmap(structthread*,structmunmap_args*);

    externuInt32*kernelPageDirectory;

    #endif

    /***
    END
    ***/