summaryrefslogtreecommitdiff
path: root/kernel/source/application.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-07-29 11:27:22 -0400
committerBenji Dial <benji@benjidial.net>2024-07-29 11:27:22 -0400
commitbe691582ee12613278af24cb5a824eeb357f6324 (patch)
tree5982ca3aad5257f515c93f62735ff3d630aa3ab3 /kernel/source/application.cpp
parent3636fd21e079c47bd8d62e773e178f68fe9c2052 (diff)
downloadhilbert-os-be691582ee12613278af24cb5a824eeb357f6324.tar.gz
some work on compositor
Diffstat (limited to 'kernel/source/application.cpp')
-rw-r--r--kernel/source/application.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/kernel/source/application.cpp b/kernel/source/application.cpp
index 8070019..6df49cd 100644
--- a/kernel/source/application.cpp
+++ b/kernel/source/application.cpp
@@ -83,7 +83,8 @@ namespace hilbert::kernel::application {
resume_thread(t->saved_state);
}
- process::process(app_memory *memory) : memory(memory) {}
+ process::process(app_memory *memory, const utility::string &name)
+ : name(name), memory(memory) {}
process::~process() {
delete memory; //:p
@@ -94,6 +95,14 @@ namespace hilbert::kernel::application {
environment_variables.insert_end({.a = name, .b = value});
}
+ utility::string *process::get_environment_variable(
+ const utility::string &name) {
+ for (auto *i = environment_variables.first; i; i = i->next)
+ if (i->value.a == name)
+ return &i->value.b;
+ return 0;
+ }
+
void process::add_thread(thread *t) {
threads.insert_end(t);
}
@@ -197,8 +206,8 @@ namespace hilbert::kernel::application {
thread::thread(process *owner, uint64_t entry)
: stack_top(owner->memory->map_new_stack()), waiting_for_socket_stream(0),
- waiting_to_accept_from(0), waiting_to_connect_to(0),
- waiting_for_input(false), owner(owner) {
+ waiting_to_accept_from(0), waiting_to_connect_to(0), waiting_for_input(false),
+ name(utility::string("main", 4)), owner(owner) {
saved_state.rax = 0;
saved_state.rbx = 0;