Initial git commit of kernel code from latest version in fossil. This only includes the base kernel code and LICENSE, not any makefiles or dependencies from libc etc. (the build environment itself hasn't been moved over to git yet)

This commit is contained in:
2025-06-08 20:13:19 +10:00
parent 18a84697ef
commit c0efdc3b0f
62 changed files with 9395 additions and 0 deletions

40
kprintf.h Normal file
View File

@ -0,0 +1,40 @@
// This is NEW CODE replacing the old printf with one based on my libc
#ifndef _KPRINTF_H
#define _KPRINTF_H
#ifndef NULL
#define NULL ((void*)0ULL)
#endif
#ifdef _ZCC
#include "cc_stdarg.h"
#else
#include <stdarg.h>
#endif
#define EOF ((int)-1)
typedef unsigned long uintptr_t;
#ifdef _ZCC
#define _LIBC_PRINTF_CALLCONV __classic_call
#else
#define _LIBC_PRINTF_CALLCONV
#endif
extern volatile int kprintf_inpanic;
#ifdef _ZCC
void kprintf_panic(const char* reason);
#else
void kprintf_panic(const char* reason) __attribute__((noreturn));
#endif
int _LIBC_PRINTF_CALLCONV kprintf(const char* fmt, ...);
void kprintf_init();
#define printf kprintf
#define panic kprintf_panic
// From ifndef at top of file:
#endif