mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat(gui,kernel): 1080p HD desktop, polished chrome, ktime clock + live FPS
GUI polish / HD: - Default display mode raised to 1920x1080 (video=1920x1080); make run/vnc use vgamem_mb=64 and -m 512M. The growable heap absorbs the larger backbuffer, shadow and wallpaper (observed: one 16 MB growth to a 48 MB heap). - Wallpaper: three-stop vertical gradient, a soft concentric-frame edge vignette for depth, a finer faint grid, and a centred brand mark. - Window chrome: brighter/saturated titlebar gradient when focused, an accent underline on the active window, and larger/softer drop shadows. - Default session windows are placed and sized for the HD work area. - Live FPS pill in the taskbar tray (green/amber/red by rate); tray widened so FPS + CPU trace + memory badge + clock no longer overlap. Kernel: - kernel/time/ktime.c + include/kernel/ktime.h (new): a unified monotonic high-resolution clock that prefers the HPET (nanosecond) and falls back to the 100 Hz PIT tick. Wired ktime_init() into boot; drives the compositor's FPS sampling. New `ktime` LazyBox applet reports the source and uptime. Verified live (screenshotted): boots to 1920x1080, KTIME reports "source: HPET, nanosecond resolution", the polished desktop renders with the active-window accent and vignette, and the tray shows a live FPS reading. Clean build on x86_64/aarch64/armv8i; 0 panics / 0 OOM. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Fh5z6V7nGPbHvqVG5p4CXX
This commit is contained in:
1 parent
ef6714a004
commit
4ecf119377
7 files changed
+154
-26
No files matched your search
+3
-1
@@ -76,6 +76,7 @@
|
||||
#include <drivers/hpet.h>
|
||||
#include <drivers/nvram.h>
|
||||
#include <drivers/lpt.h>
|
||||
#include <kernel/ktime.h>
|
||||
#include <drivers/virtio_input.h>
|
||||
#include <gui/gui.h>
|
||||
#include <init/init.h>
|
||||
@@ -135,6 +136,7 @@ static void subos_modular_core_boot(void) {
|
||||
nvram_init();
|
||||
lpt_init();
|
||||
#endif
|
||||
ktime_init();
|
||||
canvas_init();
|
||||
pty_init();
|
||||
virtio_rng_init();
|
||||
@@ -330,7 +332,7 @@ void kernel_main(void* memory_map, uint64_t memory_map_count) {
|
||||
printk(ANSI_BRIGHT_CYAN " SUB-OS 64-Bit [%s] Modular Monolithic Kernel %s\n" ANSI_RESET, arch_get_name(), kernel_get_version());
|
||||
printk(ANSI_BRIGHT_CYAN "=================================================================\n\n" ANSI_RESET);
|
||||
|
||||
init_early("root=/dev/sda console=tty1 init=/bin/lazybox video=1280x720 quiet");
|
||||
init_early("root=/dev/sda console=tty1 init=/bin/lazybox video=1920x1080 quiet");
|
||||
rtc_init();
|
||||
|
||||
printk(KERN_INFO "[1/14] Initializing 64-Bit GDT, IDT, PIC & PIT Timer... ");
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Unified monotonic high-resolution clock for SUB-OS.
|
||||
//
|
||||
// When the HPET is available it provides true nanosecond timing; otherwise the
|
||||
// clock degrades gracefully to the 100 Hz kernel timer tick (10 ms resolution).
|
||||
// Either way the epoch is the moment ktime_init() ran.
|
||||
|
||||
#include <kernel/ktime.h>
|
||||
#include <drivers/hpet.h>
|
||||
#include <arch/arch.h>
|
||||
#include <kernel/printk.h>
|
||||
|
||||
#define TICK_HZ 100ULL
|
||||
#define NS_PER_TICK (1000000000ULL / TICK_HZ) // 10,000,000 ns at 100 Hz
|
||||
|
||||
static bool g_use_hpet = false;
|
||||
static uint64_t g_base_tick = 0;
|
||||
|
||||
void ktime_init(void) {
|
||||
g_use_hpet = hpet_available();
|
||||
g_base_tick = pit_get_ticks();
|
||||
printk(ANSI_BRIGHT_GREEN "KTIME: " ANSI_RESET
|
||||
"Monotonic clock online (source: %s%s)\n",
|
||||
g_use_hpet ? "HPET" : "PIT 100 Hz",
|
||||
g_use_hpet ? ", nanosecond resolution" : "");
|
||||
}
|
||||
|
||||
uint64_t ktime_ns(void) {
|
||||
if (g_use_hpet) {
|
||||
return hpet_get_ns();
|
||||
}
|
||||
uint64_t ticks = pit_get_ticks() - g_base_tick;
|
||||
return ticks * NS_PER_TICK;
|
||||
}
|
||||
|
||||
uint64_t ktime_us(void) { return ktime_ns() / 1000ULL; }
|
||||
uint64_t ktime_ms(void) { return ktime_ns() / 1000000ULL; }
|
||||
|
||||
const char* ktime_source(void) { return g_use_hpet ? "HPET" : "PIT"; }
|
||||
bool ktime_is_highres(void) { return g_use_hpet; }
|
||||
Reference in new issue
Block a user