add lwIP TCP/IP stack as a runtime driver, native socket syscalls, SysGetMemoryStatus replacing CatchAllDebugBucket, fix timeGetTime to return milliseconds, fix SysSleep to interpret argument as milliseconds, SysGetTick now returns microseconds, harden all syscalls against bad user pointers with CopyFromUser/CopyToUser/MmProbeUser throughout, add networking test apps, port-forward 8080 in runa.bat, split LWIP_DRIVER_CFLAGS, add settings.ini to deploy, remove ethernet.c stub

This commit is contained in:
maksw committed 2026-05-22 18:54:53 +02:00
1 parent 18b4dd0f61
commit df13b8056c
365 files changed
+143263 -1362

No files matched your search

@@ -0,0 +1 @@
#pragma pack(push, 1)
+49
View File
@@ -0,0 +1,49 @@
#pragma once
#ifndef LWIP_ARCH_CC_H
#define LWIP_ARCH_CC_H
#include <stdint.h>
#include <stddef.h>
#include <ke_debug.h>
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
/* MSVC/freestanding kernel-friendly printf format fallbacks. */
#define LWIP_NO_INTTYPES_H 1
#define X8_F "02x"
#define U16_F "hu"
#define S16_F "hd"
#define X16_F "hx"
#define U32_F "lu"
#define S32_F "ld"
#define X32_F "lx"
#define SZT_F "llu"
#define LWIP_NO_CTYPE_H 1
#define LWIP_TIMEVAL_PRIVATE 1
#define LWIP_PROVIDE_ERRNO 1
/* Used by SYS_LIGHTWEIGHT_PROT. Keep it wide enough for saved RFLAGS. */
typedef uintptr_t sys_prot_t;
#define LWIP_PLATFORM_DIAG(x) do { DbgPrint x; } while (0)
#define LWIP_PLATFORM_ASSERT(x) do { KePanic("lwIP assert: %s\n", (x)); } while (0)
unsigned int lwip_port_rand(void);
#define LWIP_RAND() ((uint32_t)lwip_port_rand())
/* Force lwIP's static heap/aligned buffers to be at least 8-byte aligned. */
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) \
__declspec(align(8)) uint8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)]
#define PACK_STRUCT_USE_INCLUDES
#endif /* LWIP_ARCH_CC_H */
@@ -0,0 +1 @@
#pragma pack(pop)
+51
View File
@@ -0,0 +1,51 @@
#pragma once
#ifndef LWIP_ARCH_SYS_ARCH_H
#define LWIP_ARCH_SYS_ARCH_H
#include <stdint.h>
#include <lwip/opt.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sys_sem;
typedef struct sys_sem* sys_sem_t;
#define SYS_SEM_NULL NULL
#define sys_sem_valid(sem) ((sem) && (*(sem) != NULL))
#define sys_sem_valid_val(sem) ((sem) != NULL)
#define sys_sem_set_invalid(sem) do { if ((sem)) { *(sem) = NULL; } } while (0)
#define sys_sem_set_invalid_val(sem) do { (sem) = NULL; } while (0)
struct sys_mutex;
typedef struct sys_mutex* sys_mutex_t;
#define sys_mutex_valid(mutex) ((mutex) && (*(mutex) != NULL))
#define sys_mutex_valid_val(mutex) ((mutex) != NULL)
#define sys_mutex_set_invalid(mutex) do { if ((mutex)) { *(mutex) = NULL; } } while (0)
struct sys_mbox;
typedef struct sys_mbox* sys_mbox_t;
#define SYS_MBOX_NULL NULL
#define sys_mbox_valid(mbox) ((mbox) && (*(mbox) != NULL))
#define sys_mbox_valid_val(mbox) ((mbox) != NULL)
#define sys_mbox_set_invalid(mbox) do { if ((mbox)) { *(mbox) = NULL; } } while (0)
#define sys_mbox_set_invalid_val(mbox) do { (mbox) = NULL; } while (0)
/*
* lwIP only treats sys_thread_t as an opaque handle. Keep it pointer-sized.
*
* Do NOT make this a by-value incomplete struct. MSVC may compile callers
* that see only the incomplete type with a hidden struct-return parameter,
* which shifts sys_thread_new(name, thread, arg, ...) so the callee receives
* thread == name and arg == thread. The first tcpip_thread then jumps into
* the literal string "tcpip" as code.
*/
typedef void* sys_thread_t;
void LwipPortSetTimerQuery(uint64_t (*query_ticks_us)(void));
#ifdef __cplusplus
}
#endif
#endif /* LWIP_ARCH_SYS_ARCH_H */