; SPDX-License-Identifier: GPL-2.0-only ; ; CPUINFO - processor information ; Copyright (C) 2026 KolibriOS team ; ; Authors: Burer ; ; The CPU, its caches and features from CPUID, its clock and maximum ; temperature; ; the buttons of TASKMAN, of the benchmark and of the report, each also by ; the key of its first letter, underlined, in any layout. ; ==================================================================== include "../../macros.inc" include "../../KOSfuncs.inc" include "../../encoding.inc" format meos 01 entry start SHM_READ = 0 WND_ROLLED_UP = 4 ; process_information.wnd_state BTN_CLOSE = 1 ; the close button of the window ; the CPU, the strings, the window, then the big tables: the strings ; before the window, its layout takes the longest label include "cpu/cpu.inc" include "cpu/cache.inc" include "cpu/temp.inc" include "cpu/clock.inc" include "locale.inc" include "group_box.inc" include "values.inc" include "window.inc" include "report.inc" include "cpu/names.inc" include "cpu/flags.inc" ; ==================================================================== start: ; the CPU icon of ICONS32 from @RESHARE if it runs: copied, the ; shared memory closed mcall SF_SYS_MISC, SSF_HEAP_INIT mcall SF_SYS_MISC, SSF_MEM_OPEN, icons_name, 0, SHM_READ test eax, eax jz .no_icon ; edx = its size: an older ICONS32 may not have the icon cmp edx, (ICON_CPU + 1) * ICON * ICON * 4 jb .close lea esi, [eax + ICON_CPU * ICON * ICON * 4] mov edi, icon_buf mov ecx, ICON * ICON rep movsd .close: mcall SF_SYS_MISC, SSF_MEM_CLOSE, icons_name ; in this order: each takes what the ones before found .no_icon: call cpu_init call name_init call cache_init call clock_init call temp_init call window_init ; ==================================================================== redraw: call draw_window still: mcall SF_WAIT_EVENT cmp al, EV_REDRAW je redraw cmp al, EV_KEY je key cmp al, EV_BUTTON je button jmp still ; ==================================================================== key: ; its scancode, the bits 16..23, so the hotkeys work in any layout ; and case mcall SF_GET_KEY shr eax, 16 jmp press ; ==================================================================== button: mcall SF_GET_BUTTON cmp ah, BTN_CLOSE je exit ; the id of a button is the scancode of its key mov al, ah ; al = the scancode of a key: the procedure of its BUTTON with its argument press: mov edi, buttons .find: cmp al, [edi + BUTTON.key] je .found add edi, sizeof.BUTTON cmp edi, buttons_end jb .find jmp still .found: mov esi, [edi + BUTTON.arg] call [edi + BUTTON.proc] jmp still exit: mcall SF_TERMINATE_PROCESS ; esi -> the path of a program: run_app without parameters run_program: movi edx, 0 ; esi -> the path of a program, edx -> its parameters or 0; @notify tells ; if it does not start run_app: mov [app_run.params], edx mov [app_run.path], esi mcall SF_FILE, app_run test eax, eax jns .done mov edx, esi mov esi, sz_run_failed jmp notify .done: ret ; @notify with the title, the text at esi and the path at edx: all in ; quotes, then its flags notify: mov ebx, esi mov edi, text_buf mov byte [edi], "'" inc edi mov esi, sz_notify_title call fmt_str mov esi, ebx call fmt_str mov esi, edx call fmt_str mov esi, sz_notify_flags call fmt_str mcall SF_FILE, notify_run ret ; ==================================================================== icons_name db "ICONS32", 0 app_run: dd SSF_START_APP dd 0 .params dd 0 dd 0, 0 db 0 ; the path at the pointer after it .path dd 0 notify_run: dd SSF_START_APP dd 0 dd text_buf dd 0, 0 db "/sys/@notify", 0 sz_taskman_path db "/sys/TASKMAN", 0 sz_bench_path db "/sys/BBENCH", 0 ; the end of the quote, then E: the error icon sz_notify_flags db "' -tE", 0 ; ==================================================================== ; zero at the start, the kernel clears it: the code counts on it as 0, ; none, and as the zero after the strings IncludeUGlobals align 4 sc system_colors pinfo process_information icon_buf rd ICON * ICON text_buf rb 256 ; a value, or the text for @notify