feat: Add freestanding C++17 OOP kernel subsystem and interactive Snake Game

- Add freestanding C++17 runtime with operator new/delete, pure virtual handlers, and global constructor execution in kernel/cpp/cxx_runtime.cpp
- Implement C++ Object-Oriented telemetry and hardware services with polymorphism in kernel/cpp/cpp_module.cpp and include/kernel/cpp_kernel.h
- Add interactive ANSI Snake Game in userland/lazybox/snake.c with real-time keyboard control and automated simulation mode
- Initialize C++ subsystem during kernel boot step [8/14] in kernel/main.c
- Add LazyBox applets: 'snake', 'cppinfo', and 'cpptest'
This commit is contained in:
subhobhai943 committed 2026-08-18 21:14:16 +05:30
1 parent f3b47f9d22
commit 6eaf9397a2
10 files changed
+636 -6

No files matched your search

+16
View File
@@ -30,6 +30,8 @@
#include <mm/kmalloc.h>
#include <kernel/rust.h>
#include <kernel/sub_lang.h>
#include <kernel/cpp_kernel.h>
#include <userland/snake.h>
#include <arch/arch.h>
#include <kernel/printk.h>
#include <lib/string.h>
@@ -950,6 +952,17 @@ static int applet_subquote(int argc, char** argv) {
return 0;
}
static int applet_cppinfo(int argc, char** argv) {
(void)argc; (void)argv;
cpp_kernel_print_status();
return 0;
}
static int applet_cpptest(int argc, char** argv) {
(void)argc; (void)argv;
return cpp_test_oop_subsystem();
}
static int applet_whoami(int argc, char** argv) {
(void)argc; (void)argv;
const user_account_t* u = auth_get_current_user();
@@ -2008,6 +2021,9 @@ static const lazybox_applet_t applets[] = {
{"tree", applet_tree, "tree [dir]", "Visual directory tree graph", "Filesystem"},
{"find", applet_find, "find [path] [-name query]", "Recursive file search", "Filesystem"},
{"traceroute", applet_traceroute, "traceroute <host/ip>", "Trace network route hops", "Network"},
{"snake", applet_snake, "snake [--demo]", "Interactive ANSI Snake Game", "Games"},
{"cppinfo", applet_cppinfo, "cppinfo", "C++ OOP kernel telemetry", "System"},
{"cpptest", applet_cpptest, "cpptest", "C++ polymorphism & new/del", "System"},
{NULL, NULL, NULL, NULL, NULL}
};