MushOS
0.1
A UNIX-like OS prototype, written from scratch
Loading...
Searching...
No Matches
pages.h
1
#ifndef MUSHOS_PAGES_H
2
#define MUSHOS_PAGES_H
3
4
#include "../../lib/base/generic.h"
5
6
#include "interruption_tables.h"
7
8
9
#define pages_in_table 1024
10
11
#define page_size 0x1000
12
#define full_byte 0xff
13
14
15
typedef
struct
{
16
u_dword present : 1;
// Page present in memory
17
u_dword rw : 1;
// Read-only if clear, readwrite if set
18
u_dword user : 1;
// Supervisor level only if clear
19
u_dword write : 1;
// Write through?
20
u_dword cache : 1;
// Cache disabled?
21
u_dword accessed : 1;
// Has the page been accessed since last refresh?
22
u_dword dirty : 1;
// Has the page been written to since last refresh?
23
u_dword zero : 1;
// Always zero
24
u_dword global : 1;
// Global?
25
u_dword unused : 3;
// Amalgamation of unused and reserved bits
26
u_dword frame : 20;
// Frame address (shifted right 12 bits)
27
}
page_pointer
;
28
29
30
typedef
struct
{
31
page_pointer
contents[pages_in_table];
32
}
page_folder
;
33
34
35
/**
36
Sets up the environment, page directories etc and
37
enables paging.
38
**/
39
void
initialise_paging();
40
41
/**
42
Handler for page faults.
43
**/
44
void
page_fault(
registers
* regs);
45
46
#endif
//MUSHOS_PAGES_H
page_folder
Definition:
pages.h:30
page_pointer
Definition:
pages.h:15
registers
Definition:
interruption_tables.h:28
core
kernel
pages.h
Generated on Sun Jan 29 2023 13:48:02 for MushOS by
1.9.5