build system refresh

This commit is contained in:
2026-07-16 16:09:12 -05:00
parent b588634253
commit 3246dbbd19
49 changed files with 185 additions and 203 deletions

10
rlibc/include/stdio.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef RLIBC_STDIO_H
#define RLIBC_STDIO_H
#include <stdarg.h>
int printf(const char *format, ...);
char getchar(void);
#endif

8
rlibc/include/stdlib.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef RLIBC_STDLIB_H
#define RLIBC_STDLIB_H
#include <stddef.h>
void* malloc(size_t size);
#endif

15
rlibc/include/string.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef RLIBC_STRING_H
#define RLIBC_STRING_H
#include <stddef.h>
void *memcpy(void *restrict dest, const void *restrict src, size_t n);
void *memmove(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
size_t strlen(const char *s);
int strcmp(const char *s1, const char *s2);
char *strcpy(char *dest, const char *src);
char* strcat(char *dest, const char* src);
#endif

View File

@@ -0,0 +1,8 @@
#ifndef RLIBC_SYS_TYPES_H
#define RLIBC_SYS_TYPES_H
typedef long off_t;
typedef int ssize_t;
#endif

17
rlibc/include/sys/video.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef USER_VIDEO_H
#define USER_VIDEO_H
#include <stdint.h>
#define FBIOGET_INFO 0x1
typedef struct {
uint32_t width;
uint32_t height;
uint32_t pitch;
uint32_t bpp;
uint32_t fb_size;
} fb_info_t;
#endif

46
rlibc/include/syscall.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef RLIBC_SYSCALL_H
#define RLIBC_SYSCALL_H
#include <stdint.h>
#include <stddef.h>
#define SYS_EXIT 1
#define SYS_READ 3
#define SYS_WRITE 4
#define SYS_OPEN 5
#define SYS_CLOSE 6
#define SYS_BRK 12
#define SYS_SBRK 13
#define SYS_PTY 20
#define SYS_FORK 21
#define SYS_EXEC 22
#define SYS_DUP2 23
#define SYS_LSEEK 24
#define SYS_WAIT 25
#define SYS_MMAP 26
#define SYS_IOCTL 27
int open(const char* path);
int write(int fd, const void *buf, size_t count);
int read(int fd, void *buf, size_t count);
int close(int fd);
int lseek(int fd, size_t offset, int whence);
void* mmap(int fd);
void exit(int status) __attribute__((noreturn));
void* sbrk(int32_t increment);
int brk(void *addr);
int pty(int* slave);
int fork();
int exec(const char* path);
int dup2(int src, int dst);
int waitpid(int pid, int* status);
int ioctl(int fd, uint32_t request, void* arg);
#endif

15
rlibc/include/unistd.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef RLIBC_UNISTD_H
#define RLIBC_UNISTD_H
#include <syscall.h>
#include <sys/types.h>
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif