mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat: Add Rust Base64 codec, Process hierarchy (pstree, kill), and VFS visual tree/find applets
- Implement memory-safe RFC-4648 Base64 encoder and decoder in rust/src/crypto/base64.rs - Add process parent hierarchy tracking (ppid, pgid), task_find_by_pid, task_kill, and task_dump_pstree in kernel/task.c - Add list_for_each_entry macro in include/lib/list.h - Add LazyBox applets: 'base64', 'pstree', 'kill', 'tree', 'find', and 'traceroute'
This commit is contained in:
1 parent
a8b0eae694
commit
cda9735b09
8 files changed
+443
-1
No files matched your search
@@ -76,6 +76,8 @@ int rust_chacha20_crypt(const uint8_t* key, const uint8_t* nonce, uint32_t count
|
||||
int rust_csprng_get_random(uint8_t* buffer, size_t len);
|
||||
int rust_sha3_256(const uint8_t* data, size_t len, uint8_t* out);
|
||||
int rust_aes128_ecb_encrypt(const uint8_t* key, uint8_t* block);
|
||||
int rust_base64_encode(const uint8_t* in_buf, size_t in_len, uint8_t* out_buf, size_t max_out);
|
||||
int rust_base64_decode(const uint8_t* in_buf, size_t in_len, uint8_t* out_buf, size_t max_out);
|
||||
int rust_crypto_run_benchmark(rust_crypto_bench_result_t* out_result);
|
||||
|
||||
// Hardware & Drivers
|
||||
|
||||
@@ -15,6 +15,8 @@ typedef enum {
|
||||
|
||||
typedef struct task_struct {
|
||||
pid_t pid;
|
||||
pid_t ppid;
|
||||
pid_t pgid;
|
||||
char name[32];
|
||||
task_state_t state;
|
||||
uint64_t rsp;
|
||||
@@ -23,14 +25,21 @@ typedef struct task_struct {
|
||||
uint64_t sleep_until_ticks;
|
||||
int priority;
|
||||
int time_slice;
|
||||
int exit_code;
|
||||
struct list_head list;
|
||||
struct list_head all_list;
|
||||
} task_t;
|
||||
|
||||
typedef void (*task_entry_fn_t)(void* arg);
|
||||
|
||||
void task_init_idle(void);
|
||||
task_t* task_create(const char* name, task_entry_fn_t entry, void* arg, int priority);
|
||||
void task_exit(int exit_code);
|
||||
task_t* task_current(void);
|
||||
pid_t task_get_pid(void);
|
||||
void task_set_current(task_t* task);
|
||||
task_t* task_find_by_pid(pid_t pid);
|
||||
int task_kill(pid_t pid, int sig);
|
||||
void task_dump_pstree(void);
|
||||
|
||||
#endif // _KERNEL_TASK_H
|
||||
@@ -53,4 +53,9 @@ static inline int list_empty(const struct list_head *head) {
|
||||
for (pos = (head)->next, n = pos->next; pos != (head); \
|
||||
pos = n, n = pos->next)
|
||||
|
||||
#define list_for_each_entry(pos, head, member) \
|
||||
for (pos = list_entry((head)->next, typeof(*pos), member); \
|
||||
&pos->member != (head); \
|
||||
pos = list_entry(pos->member.next, typeof(*pos), member))
|
||||
|
||||
#endif // _LIB_LIST_H
|
||||
Reference in new issue
Block a user