Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/native/kernel/x86/console_log.h # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / native / kernel / x86 / console_log.h` 28 lines ยท 1144 bytes Raw Blame History 1 /* console_log.h -- the console's RAM copy of what was written (console_x86.c), 2 * kept apart so the host can test the exact append the kernel runs. No 3 * device, no clock. The copy keeps the FIRST CK_X86_LOG_BYTES written, so the 4 * boot commit lines stay; anything past that is not stored, but it is 5 * counted, so a full copy is reported (report_x86.c) and never looks complete. 6 * CK_X86_REPORT_MAX (report_x86.h) is the same size: the filtered report is 7 * never larger than the copy it is made from. */ 8 #ifndef AIENOS_CK_X86_CONSOLE_LOG_H 9 #define AIENOS_CK_X86_CONSOLE_LOG_H 10 #include 11 /* memcpy: the includer provides it (ck_internal.h in the kernel, string.h on the host). */ 12 13 #define CK_X86_LOG_BYTES 65536u 14 15 struct ck_x86_log { 16 char buf[CK_X86_LOG_BYTES]; 17 size_t len; /* bytes stored */ 18 size_t dropped; /* bytes that did not fit, after the copy filled */ 19 }; 20 21 static inline void ck_x86_log_append(struct ck_x86_log *l, const char *s, size_t n) 22 { 23 size_t k = n < CK_X86_LOG_BYTES - l->len ? n : CK_X86_LOG_BYTES - l->len; 24 memcpy(l->buf + l->len, s, k); 25 l->len += k; 26 l->dropped += n - k; 27 } 28 #endif