1

add very minimal demo menu

This commit is contained in:
2022-07-23 15:17:44 +02:00
parent c73e7d3d40
commit 5c9668ef97
7 changed files with 76 additions and 36 deletions

View File

@ -0,0 +1,21 @@
#include "user/BlueScreenDemo.h"
#include "kernel/Globals.h"
#include "kernel/Paging.h"
void bluescreen_demo() {
// Trigger Bluescreen
kout << "Trigger Bluescreen, if you can read this it didn't work" << endl;
// BlueScreen 1
// asm("int $3");
// BlueScreen 2
unsigned int* page = pg_alloc_page();
*page = 42;
pg_write_protect_page(page);
invalidate_tlb_entry(page); // If we don't invalidate after first access the write protection
// won't work as no lookup is performed (address in tlb)
*page = 42; // We map logical to physical 1:1 so no need to do any lookup
// If tlb is invalidated this access produces a pagefault
}

View File

@ -0,0 +1,6 @@
#ifndef __BluescreenDemo_Include_H_
#define __BluescreenDemo_Include_H_
void bluescreen_demo();
#endif