Newer
Older
Scratch / ubix3 / src / include / mm / paging.h
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 826 bytes Scratch
/**************************************************************************************
$Id: paging.h,v 1.2 2002/04/20 11:22:44 reddawg Exp $


**************************************************************************************/

#define PAGE_LEN  0x00000400
#define PAGE_SIZE 4096
#define PAGE_PRESENT            0x00000001
#define PAGE_WRITE              0x00000002
#define PAGE_USER               0x00000004
#define PAGE_DEFAULT            (PAGE_PRESENT|PAGE_WRITE|PAGE_USER)
#define PAGE_FREE               0x00000000
#define UNLOCKED    0x0

extern unsigned long mem_end, bse_end;

void countMemory();

void pageFault();
void initPaging();
unsigned int allocMem(unsigned int size);

struct memStruct {
  int available;
  int baseAddr;
  };

extern volatile unsigned int *pageDir;
extern struct memStruct memMap[10240];