From 94dca214ca1fa3582f856af800bb0ac30c4288a8 Mon Sep 17 00:00:00 2001 From: Aren Date: Sat, 21 Oct 2023 18:59:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B9=20=D0=BF=D0=BE=20=D1=81=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=BA=D0=B5=20=D0=B8=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 29 +++++++++++++++++++++++++++++ include/lock.h | 4 +++- include/version.h | 2 +- kernel/mod.cpp | 8 ++++---- run.sh | 7 ++++--- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f835da7..d8062f6 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,35 @@ - ООО "НПО ТЕ-ОН" +## Сборка из исходного кода + +### Ubuntu 18+ + +```bash +sudo apt install clang-format python3 git qemu-system-x86 +git clone https://git.synapseos.ru/Aren/BMOSP.git +cd BMOSP/ +chmod +x build.sh +./build.sh +``` + +## Запук + +### Qemu + +Стандартная конфигурация + +```bash +qemu-system-x86_64 -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -name "БМПОС" +``` + +Или + +```bash +chmod +x run.sh +./run.sh +``` + ## Предупреждение Использовать на свой страх и риск. Система расчитана на работу в эмулируемой среде Qemu под процессоры x86_64. diff --git a/include/lock.h b/include/lock.h index 9407502..bc79e9b 100644 --- a/include/lock.h +++ b/include/lock.h @@ -6,7 +6,9 @@ typedef struct { } lock_t; #define LOCK_INIT \ - (lock_t) { 0, __FILE__ } + (lock_t) { \ + 0, __FILE__ \ + } namespace lock { int swap(lock_t* lock); diff --git a/include/version.h b/include/version.h index 33d25a0..bd33d1b 100644 --- a/include/version.h +++ b/include/version.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 1 -#define VERSION_BUILD 227 +#define VERSION_BUILD 231 diff --git a/kernel/mod.cpp b/kernel/mod.cpp index e1133c4..277a78b 100644 --- a/kernel/mod.cpp +++ b/kernel/mod.cpp @@ -70,12 +70,12 @@ static volatile struct limine_module_request module_request = { }; struct limine_module_response *module_response; -static uint64_t module_count = 0; +static uint64_t modules_count = 0; void init( ) { main_env.fb_printf = &fb::printf; module_response = module_request.response; - module_count = module_response->module_count; + uint64_t module_count = module_response->module_count; struct limine_file *module_ptr = (struct limine_file *)0; for (uint64_t i = 0; i < module_count; i++) { @@ -94,11 +94,10 @@ void init( ) { fb::printf("\t\t[BOOTIMG]\n"); bootpng_ptr = module_ptr->address; bootpng_size = module_ptr->size; - main( ); continue; } if (!tool::starts_with(module_ptr->cmdline, "[MOD]")) { continue; } - + modules_count++; module_info_t *(*module_init)(env_t * env) = (module_info_t * (*)(env_t * env)) elf_entry(module_ptr->address, module_ptr->size); @@ -110,5 +109,6 @@ void init( ) { // fb::printf("Инициализированно с кодом: %u\n", ret->err_code); // fb::printf("Сообщение из модуля: %s\n\n", ret->message); } + fb::printf("Модулей обработано: %u\n", modules_count); } } // namespace mod \ No newline at end of file diff --git a/run.sh b/run.sh index 1196158..7c773a4 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,5 @@ #!/bin/sh -#qemu-system-x86_64 -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot -#qemu-system-x86_64 -cpu host -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -qemu-system-x86_64 -enable-kvm -cpu host -m 6G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot \ No newline at end of file +qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd --no-reboot +#qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot +#qemu-system-x86_64 -name "БМПОС" -cpu host -m 1G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd +#qemu-system-x86_64 -name "БМПОС" -enable-kvm -cpu host -m 6G -smp 1 -bios ovmf/OVMF.fd -hda bmosp.hdd -d int --no-reboot \ No newline at end of file