SayoriOS 0.3.3

env.c
1
10 #include <version.h>
11 #include <io/ports.h>
12 #include "user/env.h"
13 #include "io/screen.h"
14 #include "mem/vmm.h"
15 #include "mem/pmm.h"
16 #include "sys/timer.h"
17
18 struct env system_environment = {0};
19
20 void configure_env(){
21 system_environment.OS_VERSION_MAJOR = VERSION_MAJOR;
22 system_environment.OS_VERSION_MINOR = VERSION_MINOR;
23 system_environment.OS_VERSION_PATCH = VERSION_PATCH;
24 system_environment.DisplayAddress = getDisplayAddr();
25 system_environment.DisplayFrameBuffer_Address = getFrameBufferAddr();
26 system_environment.Display_W = getScreenWidth();
27 system_environment.Display_H = getScreenHeight();
28 system_environment.Display_B = getDisplayBpp();
29 system_environment.Display_P = getDisplayPitch();
30 system_environment.Display_S = getDisplaySize();
31 system_environment.Ticks = getTicks();
32 system_environment.RAM_Install = phys_memory_size;
33 system_environment.RAM_Used = used_phys_memory_size;
34 system_environment.RAM_Free = phys_memory_size - used_phys_memory_size;
35 }
env
Definition: env.h:3
env::Display_S
size_t Display_S
Размер буфера
Definition: env.h:15
env::OS_VERSION_MINOR
int OS_VERSION_MINOR
Пре-Релиз
Definition: env.h:6
env::Display_B
size_t Display_B
Бит / пиксель
Definition: env.h:13
env::Display_P
size_t Display_P
Глубина экрана
Definition: env.h:14
env::OS_VERSION_PATCH
int OS_VERSION_PATCH
Патч
Definition: env.h:7
env::Display_H
size_t Display_H
Высота экрана
Definition: env.h:12
env::RAM_Used
size_t RAM_Used
Использовано ОЗУ
Definition: env.h:18
env::RAM_Free
size_t RAM_Free
Свободно ОЗУ
Definition: env.h:19
env::OS_VERSION_MAJOR
int OS_VERSION_MAJOR
Версия ядра
Definition: env.h:5
env::Display_W
size_t Display_W
Длина экрана
Definition: env.h:11
env::DisplayFrameBuffer_Address
size_t DisplayFrameBuffer_Address
Ссылка на виртуальный экран
Definition: env.h:8
env::Ticks
size_t Ticks
Количество текущих тиков
Definition: env.h:16
env::RAM_Install
size_t RAM_Install
Установлено ОЗУ
Definition: env.h:17
getTicks
size_t getTicks()
Получить количество тиков
Definition: timer.c:26