Memory stuff

pull/38/head
E. Almqvist 3 years ago
parent 92d5cea362
commit 0529ecc298
  1. 1
      kernel/kernel.c
  2. 14
      kernel/memory.c
  3. 5
      kernel/memory.h

@ -1,4 +1,5 @@
#include "kernel.h" #include "kernel.h"
#include "memory.h"
#include "paging.h" #include "paging.h"
#include "../drivers/vga.h" #include "../drivers/vga.h"
#include "../lib/str.h" #include "../lib/str.h"

@ -0,0 +1,14 @@
#include "memory.h"
// https://wiki.osdev.org/Page_Frame_Allocation
// page = block
// MAX_BLOCK_SIZE_IN_BITS/8 bytes
// i.e. : bit i of byte n define status of block 8n+i
// block = 8n+i
int* alloc_cursor; // keep track of last location that was allocated (may improve speed)
void init_pmm(unsigned int map_addr, unsigned int bsize) {
}

@ -0,0 +1,5 @@
#define BLOCK_SIZE 4 // 32 bits = 4 bytes
#define MEMSIZE_TO_BLOCKS(n) ((n*1024)/BLOCK_SIZE)
void init_pmm(unsigned int map_addr, unsigned int bsize); // Initialize physical memory manager
Loading…
Cancel
Save