summaryrefslogtreecommitdiff
path: root/src/user/meminfo/meminfo.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-06 15:47:06 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-06 15:47:06 -0400
commitb8284137d4e0eec11c78bc14047243fce6a51373 (patch)
tree5969602dc3d090b536edccbf34d33d46a300c192 /src/user/meminfo/meminfo.c
parent73bb0e48640b842824a0b45fe4854df8ff7faf7b (diff)
downloadportland-os-b8284137d4e0eec11c78bc14047243fce6a51373.tar.gz
minor changes, redoing makefile, meminfo program
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