新增了sys_info的信息

This commit is contained in:
XIAOYI12 2024-09-01 20:21:00 +08:00
parent 55379d0c6d
commit 07e44df26a
3 changed files with 32 additions and 6 deletions

View File

@ -1,6 +1,8 @@
#ifndef CRASHPOWEROS_CPOS_H
#define CRASHPOWEROS_CPOS_H
#include "ctype.h"
struct sysinfo{
char* osname;
char* kenlname;
@ -10,6 +12,12 @@ struct sysinfo{
unsigned int pci_device;
unsigned int frame_width;
unsigned int frame_height;
uint32_t year;
uint32_t mon;
uint32_t day;
uint32_t hour;
uint32_t min;
uint32_t sec;
};
#include "syscall.h"

View File

@ -16,7 +16,7 @@ void print_info(){
" &@@@@@@@@@@@@@&=. #@@@@@@@@@@@@@@@@@#:.= Console: CPOS_USER_SHELL\n"
" *@@@@@@@@@@@@@- #@@@@@@@@@@@@@@@#:.=@@+ PCI Device: %d\n"
":@@@@@@@@@@@@&. #@@@@@@@@@@@@@#: =@@@@@. Resolution: %d x %d\n"
"#@@@@@@@@@@@@. #@@@@@@@@@@@#: =@@@@@@@+\n"
"#@@@@@@@@@@@@. #@@@@@@@@@@@#: =@@@@@@@+ Time: %d/%d/%d %d:%d\n"
"@@@@@@@@@@@@+ *&&&&&&&&&#- =@@@@@@@@@&\n"
"@@@@@@@@@@@@- :@@@@@@@@@@@@\n"
"@@@@@@@@@@@@+ #@@@@@@@@@@@&\n"
@ -38,7 +38,13 @@ void print_info(){
info->phy_mem_size,
info->pci_device,
info->frame_width,
info->frame_height);
info->frame_height,
info->year,
info->mon,
info->day,
info->hour,
info->min,
info->sec);
free_info(info);
}

View File

@ -69,10 +69,16 @@ struct sysinfo{
char* kenlname;
char* cpu_vendor;
char* cpu_name;
unsigned int phy_mem_size;
unsigned int pci_device;
unsigned int frame_width;
unsigned int frame_height;
uint32_t phy_mem_size;
uint32_t pci_device;
uint32_t frame_width;
uint32_t frame_height;
uint32_t year;
uint32_t mon;
uint32_t day;
uint32_t hour;
uint32_t min;
uint32_t sec;
};
static void* syscall_sysinfo(uint32_t ebx,uint32_t ecx,uint32_t edx,uint32_t esi,uint32_t edi){
@ -98,6 +104,12 @@ static void* syscall_sysinfo(uint32_t ebx,uint32_t ecx,uint32_t edx,uint32_t esi
info->pci_device = PCI_NUM;
info->frame_width = width;
info->frame_height = height;
info->year = get_year();
info->mon = get_mon();
info->day = get_day_of_month();
info->hour = get_hour();
info->min = get_min();
info->sec = get_sec();
return info;
}