From 9ad0eafcf7e2f3e0532666c5353b0f5294401b06 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 20 Jul 2021 21:38:09 +0200 Subject: per-process virtual memory VGA is only mapped into the virtual memory because there are no other ways of interacting with the OS. --- src/init/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/init/main.c') diff --git a/src/init/main.c b/src/init/main.c index e6188ac..ce1600c 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -6,5 +6,8 @@ int main() { uint8_t *vga = (void*) 0xB8000; for (int i = 0; i < 80 * 25; i++) vga[(i << 1) + 1] = 0x4e; - for (;;); + + // try to mess with kernel memory + uint8_t *kernel = (void*) 0x100000; + *kernel = 0; // should segfault } -- cgit v1.2.3