init commit

This commit is contained in:
Faynot
2026-07-07 20:35:07 +03:00
commit 38cc34a6e9
33 changed files with 659 additions and 0 deletions

23
src/internal/libc.c Normal file
View File

@@ -0,0 +1,23 @@
#include "libc.h"
/* Initial memory pool — small bump arena for early development.
* When the PM-actor path is wired this will request memory via
* elyz_kcall with ELYZ_OP_ALLOCATE.
*/
#define EARLY_HEAP_SIZE (64UL * 1024 * 1024)
static unsigned char __early_heap[EARLY_HEAP_SIZE];
struct __libc __libc = {
.heap_base = (unsigned long)__early_heap,
.heap_size = EARLY_HEAP_SIZE,
.heap_used = 0,
.threaded = 0,
.progname = 0,
};
int __errno = 0;
void __libc_init(void)
{
/* Future: read startup_info from loader, wire capabilities */
}