mirror of
https://github.com/tailix/kernel.git
synced 2024-12-04 11:34:42 -05:00
Add file "arch/paging.c"
This commit is contained in:
parent
874bc8498c
commit
ef1012f3b7
2 changed files with 23 additions and 0 deletions
|
@ -10,6 +10,7 @@ OBJS += main.c.o
|
|||
OBJS += logger.c.o console.c.o kprintf.c.o
|
||||
OBJS += multiboot.c.o
|
||||
OBJS += memory.c.o
|
||||
OBJS += paging.c.o
|
||||
|
||||
OBJS += protected.c.o protected.asm.cpp.o
|
||||
OBJS += exception.c.o exception.asm.cpp.o
|
||||
|
|
22
arch/paging.c
Normal file
22
arch/paging.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
#define PAGES_PER_TABLE 1024
|
||||
#define TABLES_PER_DIR 1024
|
||||
|
||||
struct page {
|
||||
unsigned int present : 1;
|
||||
unsigned int rw : 1;
|
||||
unsigned int user : 1;
|
||||
unsigned int accessed : 1;
|
||||
unsigned int dirty : 1;
|
||||
unsigned int unused : 7;
|
||||
unsigned int frame : 20;
|
||||
};
|
||||
|
||||
struct page_table {
|
||||
struct page pages[PAGES_PER_TABLE];
|
||||
};
|
||||
|
||||
struct page_dir {
|
||||
struct page_table *tables[TABLES_PER_DIR];
|
||||
unsigned int tables_phys[TABLES_PER_DIR];
|
||||
unsigned int phys;
|
||||
};
|
Loading…
Reference in a new issue