From be691582ee12613278af24cb5a824eeb357f6324 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 29 Jul 2024 11:27:22 -0400 Subject: some work on compositor --- kernel/source/application.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'kernel/source/application.cpp') 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; -- cgit v1.2.3