aboutsummaryrefslogtreecommitdiff
path: root/PL0_test.c
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2020-01-04 19:37:32 +0100
committervetch <vetch97@gmail.com>2020-01-04 19:37:32 +0100
commit615e3302c9dd358bb64cd56d1f3814ad8d5df84d (patch)
tree07b0469807eb3bff7ff7d3f3576858642bc66675 /PL0_test.c
parent885a097da42317f48cead2d91c0e0240066943a8 (diff)
downloadrpi-MMU-example-615e3302c9dd358bb64cd56d1f3814ad8d5df84d.tar.gz
rpi-MMU-example-615e3302c9dd358bb64cd56d1f3814ad8d5df84d.zip
rearranged files, updated makefile
Diffstat (limited to 'PL0_test.c')
-rw-r--r--PL0_test.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/PL0_test.c b/PL0_test.c
deleted file mode 100644
index 0bfebc7..0000000
--- a/PL0_test.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "PL0_utils.h"
-
-// entry point - must remain the only function in the file!
-void PL0_main(void)
-{
- // If loading program to userspace and handling of svc are
- // implemented correctly, this shall get printed
- puts("Hello userspace! Type 'f' if you want me to try accessing "
- "kernel memory!");
-
- while (1)
- {
- char c = getchar();
-
- if (c == '\r')
- putchar('\n');
-
- putchar(c);
-
- if (c == 'f')
- {
- // if we're indeed in PL0, we should trigger the abort
- // handler now, when trying to access memory we're not
- // allowed to
- puts("Attempting to read kernel memory from userspace :d");
- char first_kernel_byte[2];
-
- first_kernel_byte[0] = *(char*) 0x0;
- first_kernel_byte[1] = '\0';
-
- puts(first_kernel_byte);
- }
- }
-}