IBNOS
Classes | Macros | Functions | Variables
paging.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <process/thread.h>
#include <process/process.h>
Include dependency graph for paging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pagingEntry
 
struct  userMemory
 

Macros

#define PAGETABLE_SIZE   0x1000
 
#define PAGETABLE_MASK   0x3FF
 
#define PAGETABLE_BITS   10
 
#define PAGETABLE_COUNT   0x400
 

Functions

struct pagingEntry __attribute__ ((packed))
 
uint32_t interrupt_0x0E (uint32_t interrupt, uint32_t error, struct thread *t)
 
void pagingInsertBootMap (uint32_t startIndex, uint32_t stopIndex)
 Appends a specific range of physical pages to the bootmap. More...
 
void pagingDumpBootMap ()
 Dumps a list of all entries in the boot map. More...
 
void pagingInit ()
 Initializes paging. More...
 
void pagingDumpPageTable (struct process *p)
 Dumps information about the page table of a specific process. More...
 
void pagingReserveArea (struct process *p, void *addr, uint32_t length, bool user)
 Marks the memory in a specific memory area as reserved. More...
 
void * pagingSearchArea (struct process *p, uint32_t length)
 Searches for a consecutive area of length free pages in a process. More...
 
void * pagingTrySearchArea (struct process *p, uint32_t length)
 Searches for a consecutive area of length free pages in a process. More...
 
void * pagingAllocatePhysMem (struct process *p, uint32_t length, bool rw, bool user)
 Allocates several pages of physical memory in a process. More...
 
void * pagingAllocatePhysMemUnpageable (struct process *p, uint32_t length, bool rw, bool user)
 Allocates several pages of unpageable physical memory in a process. More...
 
void * pagingTryAllocatePhysMem (struct process *p, uint32_t length, bool rw, bool user)
 Tries to allocates several pages of physical memory in a process. More...
 
void * pagingAllocatePhysMemFixed (struct process *p, void *addr, uint32_t length, bool rw, bool user)
 Allocates several pages of physical memory at a fixed virtual address in a process. More...
 
void * pagingAllocatePhysMemFixedUnpageable (struct process *p, void *addr, uint32_t length, bool rw, bool user)
 Allocates several pages of unpageable physical memory at a fixed virtual address in a process. More...
 
void * pagingTryAllocatePhysMemFixed (struct process *p, void *addr, uint32_t length, bool rw, bool user)
 Allocates several pages of unpageable physical memory at a fixed virtual address in a process. More...
 
void * pagingReAllocatePhysMem (struct process *p, void *addr, uint32_t old_length, uint32_t new_length, bool rw, bool user)
 Reallocates a specific range of virtual memory in a process. More...
 
void pagingReleasePhysMem (struct process *p, void *addr, uint32_t length)
 Releases several pages of physical memory in a process. More...
 
bool pagingTryReleasePhysMem (struct process *p, void *addr, uint32_t length)
 Releases several pages of physical memory of a process. More...
 
bool pagingTryReleaseUserMem (struct process *p, void *addr, uint32_t length)
 Releases several pages of physical memory of a process. More...
 
uint32_t pagingGetPhysMem (struct process *p, void *addr)
 Returns the physical page index for a virtual address. More...
 
void * pagingMapRemoteMemory (struct process *dst_p, struct process *src_p, void *dst_addr, void *src_addr, uint32_t length, bool rw, bool user)
 Maps some virtual memory from one process to another one. More...
 
void * pagingTryMapUserMem (struct process *src_p, void *src_addr, uint32_t length, bool rw)
 Maps some virtual memory of a usermode process into the kernel. More...
 
void pagingAllocProcessPageTable (struct process *p)
 Allocates the page directory and page table for a specific process. More...
 
void pagingForkProcessPageTable (struct process *destination, struct process *source)
 Duplicate a page table and assigns it to a destination process. More...
 
void pagingReleaseProcessPageTable (struct process *p)
 Releases the page directory and page table of a specific process. More...
 
void pagingFillProcessInfo (struct process *p, struct processInfo *info)
 Fills out all memory related fields in the processInfo structure. More...
 

Variables

union {
   struct {
      uint32_t   present: 1
 
      uint32_t   rw: 1
 
      uint32_t   user: 1
 
      uint32_t   __res1: 2
 
      uint32_t   dirty: 1
 
      uint32_t   accessed: 1
 
      uint32_t   __res2: 2
 
      uint32_t   avail: 3
 
      uint32_t   frame: 20
 
   } 
 
   uint32_t   value
 
}; 
 
struct userMemory __attribute__
 

Variable Documentation

◆ @21

union { ... }

◆ __res1

uint32_t __res1

Definition at line 48 of file paging.h.

◆ __res2

uint32_t __res2

Definition at line 51 of file paging.h.

◆ accessed

uint32_t accessed

Definition at line 50 of file paging.h.

◆ avail

uint32_t avail

Definition at line 52 of file paging.h.

◆ dirty

uint32_t dirty

Definition at line 49 of file paging.h.

◆ frame

uint32_t frame

Definition at line 53 of file paging.h.

◆ present

uint32_t present

Definition at line 45 of file paging.h.

◆ rw

uint32_t rw

Definition at line 46 of file paging.h.

◆ user

uint32_t user

Definition at line 47 of file paging.h.

◆ value

uint32_t value

Definition at line 55 of file paging.h.