Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdint.h>
- typedef struct page {
- uint32_t present : 1;
- uint32_t rw : 1;
- uint32_t user : 1;
- uint32_t accessed : 1;
- uint32_t dirty : 1;
- uint32_t unused : 7;
- uint32_t frame : 20;
- } page_t;
- typedef struct pageTable {
- page_t pages[1024];
- } pageTable_t;
- typedef struct pageDirectory {
- pageTable_t *tables[1024];
- uint32_t tablesPhysical[1024];
- } pageDirectory_t;
- pagingEnable(pageDirectory_t *a);
- void start(void) {
- pageDirectory_t *good = 0x001E8480;
- good->tables[0] = 0x001E9420;
- pagingEnable(good);
- *((char*)0xB8000)=0x4f;
- *((char*)0xB8000+1)=0x2a;
- *((char*)0xB8000+2)=0x4b;
- *((char*)0xB8000+3)=0x2a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement