starting to work on pty drivers, fork(), and scheduler redesign

This commit is contained in:
2026-07-07 00:13:24 -05:00
parent 6d7a23d747
commit 177a0b8fe9
29 changed files with 859 additions and 111 deletions

20
kernel/lib/ringbuf.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef KRINGBUF_H
#define KRINGBUF_H
#include <stddef.h>
#define PTY_BUFFER_SIZE 1024
typedef struct {
char data[PTY_BUFFER_SIZE];
size_t head;
size_t tail;
} ring_buf_t;
void ring_buf_init(ring_buf_t* rb);
int ring_buf_is_empty(ring_buf_t* rb);
int ring_buf_is_full(ring_buf_t* rb);
int ring_buf_write(ring_buf_t *buf, char c);
int ring_buf_read(ring_buf_t *buf, char *c);
#endif