Removed paging crap

pull/38/head
E. Almqvist 3 years ago
parent 6cc1994b3e
commit 92d5cea362
  1. 2
      kernel/kernel.c
  2. 22
      kernel/paging.c
  3. 4
      kernel/paging.h

@ -10,7 +10,7 @@ void init() {
println("Kernel loaded", DEFAULT_COLOR);
enable_paging();
// enable_paging();
println("");
char* title = "eOS Version 0.3 2021";

@ -11,14 +11,14 @@ void enable_paging() {
}
// Page Entry struct
struct page_entry {
unsigned int index;
unsigned int start_addr;
} page_table[PAGE_TABLE_SIZE];
int get_phys_addr(int virt_addr) {
int index = virt_addr / PAGE_SIZE; // page index for the virtual address
int offset = virt_addr % PAGE_SIZE; // actual physical offset for the address
return page_table[index].start_addr + offset;
}
//struct page_entry {
// unsigned int index;
// unsigned int start_addr;
//} page_table[PAGE_TABLE_SIZE];
//
//int get_phys_addr(int virt_addr) {
// int index = virt_addr / PAGE_SIZE; // page index for the virtual address
// int offset = virt_addr % PAGE_SIZE; // actual physical offset for the address
//
// return page_table[index].start_addr + offset;
//}

@ -3,7 +3,7 @@
void enable_paging();
struct page_entry;
// struct page_entry;
// char** heap_alloc(unsigned int size); // Process heap allocation
int get_phys_addr(int virt_addr);
// int get_phys_addr(int virt_addr);

Loading…
Cancel
Save