mirror of
https://github.com/tailix/kernel.git
synced 2025-04-14 17:33:13 -04:00
Display process list
This commit is contained in:
parent
32ea70c6c4
commit
814e045094
4 changed files with 52 additions and 2 deletions
|
@ -46,6 +46,8 @@ void init(const struct KernelMQ_Info *const kinfo_ptr)
|
|||
|
||||
logger_debug_from("init", "Process list initialized.");
|
||||
|
||||
KernelMQ_Process_List_print(&process_list);
|
||||
|
||||
if (kinfo.modules_count > 0) {
|
||||
const struct KernelMQ_ELF_Header *const elf_header =
|
||||
(void*)kinfo.modules[0].base;
|
||||
|
|
|
@ -1,7 +1,52 @@
|
|||
#include "process.h"
|
||||
|
||||
#include "logger.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
void KernelMQ_Process_List_print(
|
||||
const KernelMQ_Process_List *const process_list
|
||||
) {
|
||||
for (
|
||||
unsigned int proc_index = 0;
|
||||
proc_index < KERNELMQ_PROCESS_LIST_LENGTH;
|
||||
++proc_index
|
||||
) {
|
||||
const struct KernelMQ_Process *const process = &(*process_list)[proc_index];
|
||||
|
||||
if (process->is_present) {
|
||||
logger_debug("Process %u", proc_index);
|
||||
|
||||
switch (process->created_from) {
|
||||
case KERNELMQ_PROCESS_CREATED_FROM_KERNEL:
|
||||
logger_debug(" Created from kernel");
|
||||
break;
|
||||
case KERNELMQ_PROCESS_CREATED_FROM_MODULE:
|
||||
logger_debug(" Created from module");
|
||||
break;
|
||||
}
|
||||
|
||||
logger_debug(" Command line: \"%s\"", process->cmdline);
|
||||
|
||||
for (
|
||||
unsigned int area_index = 0;
|
||||
area_index < process->areas_length;
|
||||
++area_index
|
||||
) {
|
||||
const struct KernelMQ_Process_Area *const area =
|
||||
&process->areas[area_index];
|
||||
|
||||
logger_debug(
|
||||
" Area %u (base: %u, size: %u, limit: %u)",
|
||||
area_index,
|
||||
area->base,
|
||||
area->size,
|
||||
area->limit
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum KernelMQ_Process_Error KernelMQ_Process_List_init(
|
||||
KernelMQ_Process_List *const process_list,
|
||||
const struct KernelMQ_Info *const kinfo
|
||||
|
|
|
@ -48,6 +48,9 @@ struct KernelMQ_Process {
|
|||
typedef struct KernelMQ_Process
|
||||
KernelMQ_Process_List[KERNELMQ_PROCESS_LIST_LENGTH];
|
||||
|
||||
void KernelMQ_Process_List_print(const KernelMQ_Process_List *process_list)
|
||||
__attribute__((nonnull));
|
||||
|
||||
enum KernelMQ_Process_Error KernelMQ_Process_List_init(
|
||||
KernelMQ_Process_List *process_list,
|
||||
const struct KernelMQ_Info *kinfo
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
set timeout=0
|
||||
|
||||
menuentry "KernelMQ" {
|
||||
multiboot2 /boot/kernelmq.multiboot2
|
||||
module2 /boot/procman
|
||||
multiboot2 /boot/kernelmq.multiboot2 hello kernel
|
||||
module2 /boot/procman hello module
|
||||
module2 /boot/memgr
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue