; CPUINFO - the report: the name, the rows and the features in a text ; file in UTF-8 on the RAM disk of AUTORUN, opened in CEDIT; a notification ; if it could not be saved. ; ==================================================================== report: ; the name, the vendor and the code name mov edi, report_buf mov esi, [brand_ptr] call fmt_str call .new_line mov esi, vendor_line call fmt_str call .new_line call .new_line ; "label: value" of each row, the ways after a cache; the getter ; changes all the registers mov ebp, rows .row: mov esi, [ebp + ROW.text] call fmt_str mov word [edi], ": " add edi, 2 push ebp mov eax, [ebp + ROW.arg] call [ebp + ROW.get] pop ebp cmp [ebp + ROW.get], val_cache jne .row_end mov eax, [ebp + ROW.arg] mov eax, [eax + CACHE.ways] test eax, eax ; 0: unknown, -1: fully associative jle .row_end mov word [edi], ", " add edi, 2 call fmt_uint mov esi, sz_way call fmt_str .row_end: call .new_line add ebp, sizeof.ROW cmp ebp, rows_end jb .row ; the features the CPU has: the ones of the window, then the ones ; only in the report mov ebx, flags call .features mov ebx, flags_report call .features ; saved: open it, else tell it call .new_line sub edi, report_buf mov [report_file.size], edi mcall SF_FILE, report_file mov edx, sz_report_path mov esi, sz_cedit test eax, eax jz run_app mov esi, sz_save_failed jmp notify ; ebx -> a table of flags: a line a group, its label before its ; first feature; ebx, not esi: fmt_str takes it .features: mov esi, ebx call next_feature jc .features_done mov ebx, esi ; the first of its group: its label on a new line test ebp, ebp jz .name call .new_line mov esi, ebp call fmt_str mov byte [edi], ":" inc edi .name: mov byte [edi], " " inc edi mov esi, edx call fmt_str jmp .features .features_done: ret .new_line: mov word [edi], 0x0A0D ; CR, LF add edi, 2 ret ; ==================================================================== report_file: dd SSF_CREATE_FILE dd 0, 0 .size dd 0 dd report_buf db 0 ; the path at the pointer after it dd sz_report_path sz_report_path db "/tmp0/1/cpuinfo.txt", 0 sz_cedit db "/sys/develop/cedit", 0 uglobal report_buf rb 4096 endg