ld: implement an actual program loader

This commit is contained in:
2026-03-21 10:54:50 +00:00
parent ed138d581e
commit cc15bb54f3
14 changed files with 3123 additions and 60 deletions

16
sys/ld/hash.c Normal file
View File

@@ -0,0 +1,16 @@
#include <stdint.h>
#define BASIS 0xcbf29ce484222325
#define PRIME 0x100000001b3
uint64_t hash_string(const char *s)
{
uint64_t result = BASIS;
for (unsigned int i = 0; s[i]; i++) {
result ^= s[i];
result *= PRIME;
}
return result;
}