summaryrefslogtreecommitdiff
path: root/src/user/meminfo/meminfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/meminfo/meminfo.c')
-rw-r--r--src/user/meminfo/meminfo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/user/meminfo/meminfo.c b/src/user/meminfo/meminfo.c
new file mode 100644
index 0000000..dd1d371
--- /dev/null
+++ b/src/user/meminfo/meminfo.c
@@ -0,0 +1,19 @@
+#include <pland/syscall.h>
+#include <knob/user.h>
+#include <knob/format.h>
+
+void main() {
+ char nbuf[11];
+
+ tell_user_sz("Kernel dynamic memory remaining: ");
+
+ itosz(_kernel_dynamic_area_left() * 4, nbuf);
+ tell_user_sz(nbuf);
+ tell_user_sz("k\n");
+
+ tell_user_sz("Userspace memory remaining: ");
+
+ itosz(_total_userspace_left() * 4, nbuf);
+ tell_user_sz(nbuf);
+ tell_user_sz("k\n");
+} \ No newline at end of file