feat: Add Process Manager, Limine Framebuffer GUI, RTL8139 Net stack, and extended UNIX commands

This commit is contained in:
RarDog
2026-09-02 20:10:02 +03:00
parent 521f7ed9ce
commit aa32cffd15
24 changed files with 1446 additions and 72 deletions
+82
View File
@@ -0,0 +1,82 @@
#pragma once
#include "stdint.h"
#include "stddef.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ETHERTYPE_IPv4 0x0800
#define ETHERTYPE_ARP 0x0806
#define IP_PROTO_ICMP 1
#define IP_PROTO_TCP 6
#define IP_PROTO_UDP 17
#define ICMP_ECHO_REPLY 0
#define ICMP_ECHO_REQUEST 8
#pragma pack(push, 1)
typedef struct {
uint8_t dest_mac[6];
uint8_t src_mac[6];
uint16_t ethertype;
} eth_hdr_t;
typedef struct {
uint16_t hw_type;
uint16_t proto_type;
uint8_t hw_len;
uint8_t proto_len;
uint16_t opcode;
uint8_t sender_mac[6];
uint32_t sender_ip;
uint8_t target_mac[6];
uint32_t target_ip;
} arp_hdr_t;
typedef struct {
uint8_t version_ihl;
uint8_t tos;
uint16_t total_length;
uint16_t id;
uint16_t flags_fragment;
uint8_t ttl;
uint8_t protocol;
uint16_t checksum;
uint32_t src_ip;
uint32_t dst_ip;
} ipv4_hdr_t;
typedef struct {
uint8_t type;
uint8_t code;
uint16_t checksum;
uint16_t id;
uint16_t sequence;
} icmp_hdr_t;
#pragma pack(pop)
typedef struct {
uint32_t ip;
uint32_t netmask;
uint32_t gateway;
uint8_t mac[6];
} net_config_t;
extern net_config_t g_net_cfg;
// Net API
void net_init(void);
uint16_t net_checksum(const void *buf, size_t len);
int net_send_arp_request(uint32_t target_ip);
int net_send_icmp_ping(uint32_t target_ip, uint16_t seq);
int net_poll_icmp_reply(uint32_t *from_ip, uint16_t *seq);
uint32_t parse_ip(const char *str);
void format_ip(uint32_t ip, char *buf);
#ifdef __cplusplus
}
#endif
+11
View File
@@ -17,6 +17,9 @@
#define SYS_SHUTDOWN 12 /* Power off QEMU / system */
#define SYS_REBOOT 13 /* Reboot system */
#define SYS_RTC_GET 14 /* Get CMOS real-time clock */
#define SYS_FB_INFO 15 /* Query Limine Linear Framebuffer */
#define SYS_PROC_KILL 16 /* Terminate process/thread by PID */
#define SYS_DMESG 17 /* Retrieve kernel boot log */
#ifndef __ASSEMBLER__
@@ -24,6 +27,14 @@
extern "C" {
#endif
typedef struct fb_info_data {
uint64_t fb_addr;
uint64_t width;
uint64_t height;
uint64_t pitch;
uint32_t bpp;
} fb_info_data_t;
typedef struct sysinfo_data {
uint64_t uptime_ticks;
uint64_t total_memory_bytes;