Модули теперь автоматически копируются из modules/bin

This commit is contained in:
Aren Elchinyan 2023-11-05 19:51:38 +03:00
parent 9e8bc4b343
commit 292d1bd560
10 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ bin/
limine/
ovmf/
iso_root/
output/
*.so
*.o
*.ko

View File

@ -1,8 +1,9 @@
#!/bin/sh
cd modules/
mkdir -p bin
dos2unix */*.sh
cd helloworld/ && chmod +x build.sh && ./build.sh && cd ..
cd music/ && chmod +x build.sh && ./build.sh && cd ..
#cd helloworld/ && chmod +x build.sh && ./build.sh && cd ..
#cd music/ && chmod +x build.sh && ./build.sh && cd ..
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 ..

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_BUILD 430
#define VERSION_BUILD 438

View File

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

View File

@ -3,4 +3,5 @@ echo "Название: Hello world"
echo "Лицензия: Публичное достояние"
gcc -mcmodel=large -I../../modlib -O0 -finput-charset=UTF-8 -fexec-charset=cp1251 -c -fPIC -nostdlib main.c -o hello.o
gcc -mcmodel=large -Wl,--entry=init -fPIC -shared -nostdlib hello.o -o hello.ko
cp hello.ko ../bin/
echo "Сборка завершена, файл: hello.ko"

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ def create_hdd(IMAGE_NAME):
os.system(f"mformat -i {IMAGE_NAME}.hdd@@1M")
os.system(f"mmd -i {IMAGE_NAME}.hdd@@1M ::/mod ::/EFI ::/EFI/BOOT ::/user")
os.system(f"mcopy -i {IMAGE_NAME}.hdd@@1M kernel.elf configs/limine.cfg limine/limine-bios.sys ::/")
os.system(f"mcopy -i {IMAGE_NAME}.hdd@@1M modules/pci/pci.ko modules/simd/simd.ko modules/cpubench/cpubench.ko ::/mod")
os.system(f"mcopy -i {IMAGE_NAME}.hdd@@1M modules/bin/*.ko ::/mod")
os.system(f"mcopy -i {IMAGE_NAME}.hdd@@1M limine/BOOTX64.EFI limine/BOOTIA32.EFI ::/EFI/BOOT")
os.system(f"mcopy -i {IMAGE_NAME}.hdd@@1M boot.jpg boot.tga ::/")
os.system(f"./limine/limine bios-install {IMAGE_NAME}.hdd")
@ -145,10 +145,7 @@ def create_iso(IMAGE_NAME):
os.system(f"mkdir -p iso_root")
os.system(f"cp -v kernel.elf boot.jpg boot.tga configs/limine.cfg limine/limine-bios.sys limine/limine-bios-cd.bin limine/limine-uefi-cd.bin iso_root/")
os.system(f"mkdir -p iso_root/EFI/BOOT")
os.system(f"mkdir -p iso_root/mod")
os.system(f"cp -v modules/pci/pci.ko iso_root/mod/")
os.system(f"cp -v modules/simd/simd.ko iso_root/mod/")
os.system(f"cp -v modules/cpubench/cpubench.ko iso_root/mod/")
shutil.copytree("modules/bin", "iso_root/mod")
os.system(f"cp -v limine/BOOTX64.EFI iso_root/EFI/BOOT/")
os.system(f"cp -v limine/BOOTIA32.EFI iso_root/EFI/BOOT/")
os.system(f"xorriso -as mkisofs -b limine-bios-cd.bin -no-emul-boot -boot-load-size 4 -boot-info-table --efi-boot limine-uefi-cd.bin -efi-boot-part --efi-boot-image --protective-msdos-label iso_root -o {IMAGE_NAME}.iso")