Модуль данных PCI добавлен

This commit is contained in:
Aren Elchinyan 2023-11-07 22:31:24 +03:00
parent 292d1bd560
commit fe64d1ddee
4 changed files with 29 additions and 0 deletions

View File

@ -7,5 +7,6 @@ dos2unix */*.sh
cd simd/ && chmod +x build.sh && ./build.sh && cd ..
cd cpubench/ && chmod +x build.sh && ./build.sh && cd ..
cd pci/ && chmod +x build.sh && ./build.sh && cd ..
cd pci_data/ && chmod +x build.sh && ./build.sh && cd ..
cd ..
python3 pbuild.py

View File

@ -25,5 +25,8 @@ TERM_WALLPAPER=boot:///boot.jpg
MODULE_PATH=boot:///mod/cpubench.ko
MODULE_CMDLINE=[MOD]cpubench.ko
MODULE_PATH=boot:///mod/pci_data.ko
MODULE_CMDLINE=[MOD]pci_data.ko
MODULE_PATH=boot:///mod/pci.ko
MODULE_CMDLINE=[MOD]pci.ko

View File

@ -0,0 +1,7 @@
#/bin/sh
echo "Название: список устройств и производителей для PCI"
echo "Лицензия: Публичное достояние"
gcc -I../../modlib -O0 -finput-charset=UTF-8 -fexec-charset=cp1251 -c -fPIC -nostdlib main.c -o pci_data.o
gcc -Wl,--entry=init -fPIC -shared -nostdlib pci_data.o -o pci_data.ko
cp pci_data.ko ../bin/
echo "Сборка завершена, файл: pci_data.ko"

18
modules/pci_data/main.c Normal file
View File

@ -0,0 +1,18 @@
#include <system.h>
typedef struct {
char *name;
uint16_t id;
} vendor_t;
vendor_t vendor_list[] = { { "Intel", 0x8086 },
{ "AMD", 0x1002 },
{ "AMD", 0x1002 } };
module_info_t init(env_t *env) {
init_env(env);
return (module_info_t){ .name = (char *)"[PCI][DATA]",
.message = (char *)"PCI данные",
.data_size = 3,
.data = &vendor_list };
}