1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00

Move code

This commit is contained in:
Alex Kotov 2020-12-02 00:11:28 +05:00
parent 2545e6b7bf
commit 543938a49a
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 22 additions and 28 deletions

View file

@ -1,27 +0,0 @@
#ifndef KERNELMQ_INCLUDED_PAGE_DIR
#define KERNELMQ_INCLUDED_PAGE_DIR 1
#include "config.h"
#define PAGE_DIR_ALIGN 4096
#define PAGE_DIR_ADDR(base) ((base) >> 12)
struct PageDir_Entry {
unsigned int present : 1;
unsigned int writable : 1;
unsigned int user : 1;
unsigned int write_through : 1;
unsigned int cache_disabled : 1;
unsigned int accessed : 1;
unsigned int always_0 : 1;
unsigned int page_size : 1;
unsigned int ignored : 1;
unsigned int unused : 3;
unsigned int addr : 20;
}
__attribute__((packed));
typedef struct PageDir_Entry PageDir[PAGE_DIR_LENGTH] __attribute__((aligned((PAGE_DIR_ALIGN))));
#endif

View file

@ -1,6 +1,5 @@
#include "paging.h" #include "paging.h"
#include "page_dir.h"
#include "panic.h" #include "panic.h"
#include <kernaux/arch/x86.h> #include <kernaux/arch/x86.h>

View file

@ -1,8 +1,30 @@
#ifndef KERNELMQ_INCLUDED_PAGING #ifndef KERNELMQ_INCLUDED_PAGING
#define KERNELMQ_INCLUDED_PAGING 1 #define KERNELMQ_INCLUDED_PAGING 1
#include "config.h"
#include "info.h" #include "info.h"
#define PAGE_DIR_ALIGN 4096
#define PAGE_DIR_ADDR(base) ((base) >> 12)
struct PageDir_Entry {
unsigned int present : 1;
unsigned int writable : 1;
unsigned int user : 1;
unsigned int write_through : 1;
unsigned int cache_disabled : 1;
unsigned int accessed : 1;
unsigned int always_0 : 1;
unsigned int page_size : 1;
unsigned int ignored : 1;
unsigned int unused : 3;
unsigned int addr : 20;
}
__attribute__((packed));
typedef struct PageDir_Entry PageDir[PAGE_DIR_LENGTH] __attribute__((aligned((PAGE_DIR_ALIGN))));
void paging_enable(); void paging_enable();
void paging_clear(); void paging_clear();