feat: wi-fi - expand support and fix issues, add GUI components

This commit is contained in:
2026-08-07 10:36:53 +02:00
parent bbe1df62fd
commit 9eb21eb3e3
67 changed files with 4573 additions and 245 deletions
+41
View File
@@ -0,0 +1,41 @@
#ifndef _LIBC_SYS_MMAN_H
#define _LIBC_SYS_MMAN_H
#pragma once
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Anonymous-memory mmap over SYS_ALLOC. SYS_ALLOC returns
* page-aligned process memory, which is exactly what callers like
* GCC's page allocator need. File-backed mappings are not
* supported and fail with ENODEV.
*/
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
#define MAP_SHARED 0x01
#define MAP_PRIVATE 0x02
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FAILED ((void *)-1)
void *mmap(void *addr, size_t length, int prot, int flags, int fd,
long offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t length, int prot);
#ifdef __cplusplus
}
#endif
#endif /* _LIBC_SYS_MMAN_H */
+23
View File
@@ -0,0 +1,23 @@
#ifndef _LIBC_SYS_PARAM_H
#define _LIBC_SYS_PARAM_H
#pragma once
#include <limits.h>
#include <sys/types.h>
#ifndef MAXPATHLEN
#define MAXPATHLEN 4096
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#endif /* _LIBC_SYS_PARAM_H */
+44 -8
View File
@@ -12,19 +12,55 @@ extern "C" {
#define S_IFMT 0170000
#define S_IFDIR 0040000
#define S_IFREG 0100000
#define S_IFCHR 0020000
#define S_IFLNK 0120000
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
#define S_ISFIFO(mode) (0)
#define S_ISSOCK(mode) (0)
#define S_ISBLK(mode) (0)
/* stat() reports real permission bits: ext2 stores them natively, the
ramdisk takes them from the USTAR header, and FAT32 synthesizes them from
its read-only attribute. Changing them (chmod) is still not supported. */
#define S_IRWXU 0700
#define S_IRUSR 0400
#define S_IWUSR 0200
#define S_IXUSR 0100
#define S_IRWXG 0070
#define S_IRGRP 0040
#define S_IWGRP 0020
#define S_IXGRP 0010
#define S_IRWXO 0007
#define S_IROTH 0004
#define S_IWOTH 0002
#define S_IXOTH 0001
struct stat {
mode_t st_mode;
unsigned long st_size;
time_t st_mtime;
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
int mkdir(const char *path, unsigned int mode);
int stat(const char *path, struct stat *buf);
int fstat(int fd, struct stat *buf);
int mkdir(const char *path, unsigned int mode);
int stat(const char *path, struct stat *buf);
int fstat(int fd, struct stat *buf);
int lstat(const char *path, struct stat *buf);
int chmod(const char *path, mode_t mode);
int fchmod(int fd, mode_t mode);
mode_t umask(mode_t mask);
#ifdef __cplusplus
}
+13
View File
@@ -3,6 +3,12 @@
#pragma once
/* Fixed-width and pointer-sized integer types. Freestanding builds get
this from the kernel freestanding headers; the cross toolchain from
the GCC-provided stdint.h. Hosted code (e.g. libgcov) expects
intptr_t to be visible via the stdio/stdlib include chain. */
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -15,6 +21,13 @@ typedef unsigned int mode_t;
typedef unsigned int uid_t;
typedef unsigned int gid_t;
typedef long time_t;
typedef unsigned long ino_t;
typedef unsigned long dev_t;
typedef unsigned long nlink_t;
typedef long blkcnt_t;
typedef long blksize_t;
typedef long suseconds_t;
typedef int clockid_t;
#ifdef __cplusplus
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef _LIBC_SYS_WAIT_H
#define _LIBC_SYS_WAIT_H
#pragma once
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* POSIX status decoding. waitpid() encodes a normal exit as code<<8
and a killed/crashed child as the signal number in the low bits. */
#define WIFEXITED(s) (((s) & 0x7F) == 0)
#define WEXITSTATUS(s) (((s) >> 8) & 0xFF)
#define WIFSIGNALED(s) (((s) & 0x7F) != 0)
#define WTERMSIG(s) ((s) & 0x7F)
#define WIFSTOPPED(s) (0)
#define WSTOPSIG(s) (0)
#define WNOHANG 1
#define WUNTRACED 2
pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, int options);
#ifdef __cplusplus
}
#endif
#endif /* _LIBC_SYS_WAIT_H */