feat: Massive OS expansion with IPC, Sound & TTS, Block layer, FAT32/ext2/sysfs, Signals, Syscalls, Modules, Drivers & 50+ LazyBox applets

This commit is contained in:
subhobhai943 committed 2026-08-16 23:06:53 +05:30
1 parent 5662be29f5
commit d680335f05
64 files changed
+2370 -166

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#ifndef _IPC_IPC_H
#define _IPC_IPC_H
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#define IPC_CREAT 01000
#define IPC_EXCL 02000
#define IPC_NOWAIT 04000
#define IPC_RMID 0
#define IPC_SET 1
#define IPC_STAT 2
typedef int32_t key_t;
void ipc_init(void);
#endif // _IPC_IPC_H
+38
View File
@@ -0,0 +1,38 @@
#ifndef _IPC_MSG_H
#define _IPC_MSG_H
#include <ipc/ipc.h>
#include <kernel/types.h>
#define MAX_MSG_QUEUES 16
#define MAX_MSG_PAYLOAD 256
#define MAX_MSGS_PER_QUEUE 16
typedef struct msgbuf {
long mtype;
char mtext[MAX_MSG_PAYLOAD];
} msgbuf_t;
typedef struct msg_entry {
long mtype;
size_t size;
uint8_t data[MAX_MSG_PAYLOAD];
struct msg_entry* next;
} msg_entry_t;
typedef struct msqid_ds {
int msqid;
key_t key;
uint32_t msg_qnum;
uint32_t msg_qbytes;
msg_entry_t* head;
msg_entry_t* tail;
bool in_use;
} msqid_ds_t;
int msgget(key_t key, int msgflg);
int msgsnd(int msqid, const void* msgp, size_t msgsz, int msgflg);
ssize_t msgrcv(int msqid, void* msgp, size_t msgsz, long msgtyp, int msgflg);
int msgctl(int msqid, int cmd, struct msqid_ds* buf);
#endif // _IPC_MSG_H
+28
View File
@@ -0,0 +1,28 @@
#ifndef _IPC_PIPE_H
#define _IPC_PIPE_H
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <fs/vfs.h>
#define PIPE_BUF_SIZE 4096
typedef struct pipe {
uint8_t buffer[PIPE_BUF_SIZE];
uint32_t head;
uint32_t tail;
uint32_t count;
bool read_open;
bool write_open;
vfs_node_t* read_node;
vfs_node_t* write_node;
} pipe_t;
int pipe_create(int pipefd[2]);
ssize_t pipe_read(pipe_t* p, void* buf, size_t count);
ssize_t pipe_write(pipe_t* p, const void* buf, size_t count);
void pipe_close_read(pipe_t* p);
void pipe_close_write(pipe_t* p);
#endif // _IPC_PIPE_H
+27
View File
@@ -0,0 +1,27 @@
#ifndef _IPC_SEM_H
#define _IPC_SEM_H
#include <ipc/ipc.h>
#define MAX_SEM_SETS 16
#define MAX_SEMS_PER_SET 16
struct sembuf {
unsigned short sem_num;
short sem_op;
short sem_flg;
};
typedef struct semid_ds {
int semid;
key_t key;
uint32_t nsems;
int values[MAX_SEMS_PER_SET];
bool in_use;
} semid_ds_t;
int semget(key_t key, int nsems, int semflg);
int semop(int semid, struct sembuf* sops, size_t nsops);
int semctl(int semid, int semnum, int cmd, ...);
#endif // _IPC_SEM_H
+23
View File
@@ -0,0 +1,23 @@
#ifndef _IPC_SHM_H
#define _IPC_SHM_H
#include <ipc/ipc.h>
#define MAX_SHM_SEGS 16
#define SHM_MAX_SIZE 65536
typedef struct shmid_ds {
int shmid;
key_t key;
size_t size;
void* addr;
uint32_t nattch;
bool in_use;
} shmid_ds_t;
int shmget(key_t key, size_t size, int shmflg);
void* shmat(int shmid, const void* shmaddr, int shmflg);
int shmdt(const void* shmaddr);
int shmctl(int shmid, int cmd, struct shmid_ds* buf);
#endif // _IPC_SHM_H