MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
Functions
paging.c File Reference

Paging related functions. More...

#include "x86_desc.h"
#include "paging.h"
#include "lib.h"

Functions

pde_desc_t pageDirectory[PAGE_DIRECTORY_SIZE__attribute__ ((aligned(4096)))
 
void initPageDirectory ()
 Initializes all page directory. More...
 
void populatePageDirectory (unsigned int addr, pte_desc_t *pageTable, int select, int userLevel)
 Update a page directory to point to a certain page table. More...
 
void populatePageTable (pte_desc_t *pageTable, unsigned int addr, unsigned int pageAddr, int userLevel)
 Update a page table entry (PTE) to point to a specified page and mark PTE as present. More...
 
void initializeAllPaging ()
 Initializes all paging. More...
 

Detailed Description

Paging related functions.

Author
Group 8
Version
1.0
Date
2023-03-11

Function Documentation

◆ __attribute__()

pde_desc_t pageDirectory[PAGE_DIRECTORY_SIZE] __attribute__ ( (aligned(4096))  )

◆ initializeAllPaging()

void initializeAllPaging ( )

Initializes all paging.

Insert the video page and the kernel page.

◆ initPageDirectory()

void initPageDirectory ( )

Initializes all page directory.

Initializes all of the PDEs in both the kb and mb page directories to 0x2 which allows for writes and reads from entry.

◆ populatePageDirectory()

void populatePageDirectory ( unsigned int  addr,
pte_desc_t pageTable,
int  select,
int  userLevel 
)

Update a page directory to point to a certain page table.

Parameters
addrThe 32 bit address to update page directory of.
pageTablePointer to page table to insert at targeted page directory.
select0 to populate 4kb PD; 1 to populate 4mb PD.
userLevel0 - kernel only; 1 - user and kernel.

◆ populatePageTable()

void populatePageTable ( pte_desc_t pageTable,
unsigned int  addr,
unsigned int  pageAddr,
int  userLevel 
)

Update a page table entry (PTE) to point to a specified page and mark PTE as present.

Parameters
pageTablethe page table to be updated.
addr32-bit virtual address that data should be inserted into.
pageAddrPhysical address that a page resides in to be inserted into PTE.
userLevel0 - kernel only; 1 - user and kernel.