mirror of https://github.com/tailix/kernel.git
Display process list
This commit is contained in:
parent
32ea70c6c4
commit
814e045094
|
@ -46,6 +46,8 @@ void init(const struct KernelMQ_Info *const kinfo_ptr)
|
||||||
|
|
||||||
logger_debug_from("init", "Process list initialized.");
|
logger_debug_from("init", "Process list initialized.");
|
||||||
|
|
||||||
|
KernelMQ_Process_List_print(&process_list);
|
||||||
|
|
||||||
if (kinfo.modules_count > 0) {
|
if (kinfo.modules_count > 0) {
|
||||||
const struct KernelMQ_ELF_Header *const elf_header =
|
const struct KernelMQ_ELF_Header *const elf_header =
|
||||||
(void*)kinfo.modules[0].base;
|
(void*)kinfo.modules[0].base;
|
||||||
|
|
|
@ -1,7 +1,52 @@
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
|
#include "logger.h"
|
||||||
#include "stdlib.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(
|
enum KernelMQ_Process_Error KernelMQ_Process_List_init(
|
||||||
KernelMQ_Process_List *const process_list,
|
KernelMQ_Process_List *const process_list,
|
||||||
const struct KernelMQ_Info *const kinfo
|
const struct KernelMQ_Info *const kinfo
|
||||||
|
|
|
@ -48,6 +48,9 @@ struct KernelMQ_Process {
|
||||||
typedef struct KernelMQ_Process
|
typedef struct KernelMQ_Process
|
||||||
KernelMQ_Process_List[KERNELMQ_PROCESS_LIST_LENGTH];
|
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(
|
enum KernelMQ_Process_Error KernelMQ_Process_List_init(
|
||||||
KernelMQ_Process_List *process_list,
|
KernelMQ_Process_List *process_list,
|
||||||
const struct KernelMQ_Info *kinfo
|
const struct KernelMQ_Info *kinfo
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
set timeout=0
|
set timeout=0
|
||||||
|
|
||||||
menuentry "KernelMQ" {
|
menuentry "KernelMQ" {
|
||||||
multiboot2 /boot/kernelmq.multiboot2
|
multiboot2 /boot/kernelmq.multiboot2 hello kernel
|
||||||
module2 /boot/procman
|
module2 /boot/procman hello module
|
||||||
module2 /boot/memgr
|
module2 /boot/memgr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue