summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--Source/Applications/Shell/Shell.ns.cpp3
-rw-r--r--Source/Kernel/TaskManager/Process-sc.class.cpp1
-rw-r--r--Source/Library/Interface/Process.iface.h1
-rw-r--r--Source/Library/Userland/Binding/Process.class.h3
5 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 50d8bbd..235da20 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: clean, mrproper, Init.rfs, commit
+.PHONY: clean, mrproper, Init.rfs, floppy, commit
Projects = Kernel Library Tools/MakeRamFS Applications/Shell Applications/PaperWork Applications/Demos
@@ -70,7 +70,7 @@ floppy: $(Files)
bochs:
bochs -f Bochs.cfg
-qemu:
+qemu: floppy
qemu -fda $(Floppy) -m 16
qemu_debug:
diff --git a/Source/Applications/Shell/Shell.ns.cpp b/Source/Applications/Shell/Shell.ns.cpp
index d34c360..56a6b5f 100644
--- a/Source/Applications/Shell/Shell.ns.cpp
+++ b/Source/Applications/Shell/Shell.ns.cpp
@@ -1,5 +1,6 @@
#include "Shell.ns.h"
#include <Binding/Sys.ns.h>
+#include <Binding/Process.class.h>
namespace Shell {
@@ -64,6 +65,8 @@ u32int run() {
outvt << "Uptime : " << (s64int)Sys::uptime() << "s\n";
} else if (cmd[0] == "free") {
outvt << "Free RAM : " << (s64int)Sys::freeRam() << " Kio of " << (s64int)Sys::totalRam() << " Kio\n";
+ } else if (cmd[0] == "uid") {
+ outvt << "User ID : " << (s64int)(Process::get().getUid()) << "\n";
} else if (cmd[0] == "help") {
while (cmd.size() > 1) cmd.pop();
cmd.push("/Applications/Shell/Help.txt");
diff --git a/Source/Kernel/TaskManager/Process-sc.class.cpp b/Source/Kernel/TaskManager/Process-sc.class.cpp
index 8564c22..e5910af 100644
--- a/Source/Kernel/TaskManager/Process-sc.class.cpp
+++ b/Source/Kernel/TaskManager/Process-sc.class.cpp
@@ -13,6 +13,7 @@ call_t Process::m_callTable[] = {
CALL1(PRIF_FREEPAGES, &Process::freePagesSC),
CALL0(PRIF_GETPID, &Process::getPid),
CALL0(PRIF_GETPPID, &Process::getPpid),
+ CALL0(PRIF_GETUID, &Process::getUid),
CALL0(PRIF_ARGC, &Process::argcSC),
CALL1(PRIF_ARGV, &Process::argvSC),
CALL0(PRIF_START, &Process::startSC),
diff --git a/Source/Library/Interface/Process.iface.h b/Source/Library/Interface/Process.iface.h
index 4d3217f..b387801 100644
--- a/Source/Library/Interface/Process.iface.h
+++ b/Source/Library/Interface/Process.iface.h
@@ -15,6 +15,7 @@
#define PRIF_FREEPAGES 0x03 //Free frames for pages (v) | i:position, i:count
#define PRIF_GETPID 0x04 //Get PID of a process (i) | no arguments
#define PRIF_GETPPID 0x05 //Get PPID of a process (i) | no arguments
+#define PRIF_GETUID 0x06 //Get UID of a process (i) | no arguments
#define PRIF_ARGC 0x10 //Get argument count for a process (i) | no arguments
#define PRIF_ARGV 0x11 //Get argument value for a process (S) | i:argument_index
diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h
index 523be79..1a1481f 100644
--- a/Source/Library/Userland/Binding/Process.class.h
+++ b/Source/Library/Userland/Binding/Process.class.h
@@ -33,6 +33,9 @@ class Process : public RessourceCaller {
u32int getPpid() {
return doCall(PRIF_GETPPID);
}
+ u32int getUid() {
+ return doCall(PRIF_GETUID);
+ }
u32int argc() {
return doCall(PRIF_ARGC);
}