mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-26 09:02:46 +00:00
feat: Growable heap, GUI-by-default run, live sysmon, SUB/SUB default login
Kernel / memory: - mm/kmalloc.c: fix "Heap: Out of memory" under the GUI. The desktop allocates three full-screen 32-bit buffers (~11MB) which overflowed the fixed 16MB pool. The heap now starts at 32MB and grows on demand from the PMM (16MB regions), with region-safe coalescing (only merges physically adjacent blocks) so growth never corrupts across separate PMM allocations. Adds heap_get_grow_count(). Build / run: - Makefile: merge `run-gui` into `run` so `make run` boots into the graphical desktop; add `run-headless` (serial-only via QEMU_CMD), bump guest RAM to 256M, update .PHONY and help. Configure: - scripts/kconfig/menuconfig.py: gate the curses UI behind isatty() on stdin and stdout so non-interactive `make configure` stops emitting "nocbreak() returned ERR" and falls cleanly through to the non-interactive writer. GUI / userland: - gui/gui_apps.c: rebuild the System Monitor from hardcoded values into live telemetry -- real heap used/total/free with a colour-shifting bar, a scrolling heap-utilisation graph, the grow counter, and real PMM RAM figures. - lazybox `free`: report how many times the heap has grown. Auth: - Default login is now SUB / SUB (Kali-style username==password), seeded first as the primary uid-0 account and set as the logged-in user; root kept for compatibility. Hardcoded "root" defaults (whoami, su, passwd, ssh, sshd session) updated to SUB. Verified: clean build on x86_64/aarch64/armv8i; GUI boots with 0 OOM/0 panic; auth engine initialises cleanly; `make configure` fallback is clean. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Fh5z6V7nGPbHvqVG5p4CXX
This commit is contained in:
1 parent
65fa4dd049
commit
71ad6aca3d
8 files changed
+227
-88
No files matched your search
@@ -709,6 +709,8 @@ static int applet_free(int argc, char** argv) {
|
||||
total_kb, used_kb, free_kb, free_kb);
|
||||
printk("Heap: %8llu %8llu %8llu\n",
|
||||
kmalloc_get_total() / 1024, kmalloc_get_used() / 1024, kmalloc_get_free() / 1024);
|
||||
printk(" (dynamic kernel heap, grown on demand %llu time(s))\n",
|
||||
(unsigned long long)heap_get_grow_count());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1137,7 +1139,7 @@ static int applet_aead(int argc, char** argv) {
|
||||
static int applet_whoami(int argc, char** argv) {
|
||||
(void)argc; (void)argv;
|
||||
const user_account_t* u = auth_get_current_user();
|
||||
printk("%s\n", u ? u->username : "root");
|
||||
printk("%s\n", u ? u->username : "SUB");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1652,7 +1654,7 @@ static int applet_ssh(int argc, char** argv) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char username[32] = "root";
|
||||
char username[32] = "SUB";
|
||||
char host[64] = "localhost";
|
||||
uint16_t port = 22;
|
||||
|
||||
@@ -1774,7 +1776,7 @@ static int applet_logread(int argc, char** argv) {
|
||||
}
|
||||
|
||||
static int applet_su(int argc, char** argv) {
|
||||
const char* target = (argc >= 2) ? argv[1] : "root";
|
||||
const char* target = (argc >= 2) ? argv[1] : "SUB";
|
||||
if (auth_set_current_user(target) == 0) {
|
||||
printk(KERN_INFO "Switched to user '%s'\n", target);
|
||||
return 0;
|
||||
@@ -1784,7 +1786,7 @@ static int applet_su(int argc, char** argv) {
|
||||
}
|
||||
|
||||
static int applet_passwd(int argc, char** argv) {
|
||||
const char* user = (argc >= 2) ? argv[1] : "root";
|
||||
const char* user = (argc >= 2) ? argv[1] : "SUB";
|
||||
const char* new_pass = (argc >= 3) ? argv[2] : "password";
|
||||
if (auth_change_password(user, new_pass) == 0) {
|
||||
printk(KERN_INFO "passwd: password updated successfully for '%s'\n", user);
|
||||
|
||||
Reference in new issue
Block a user