From 15123ef5dae4cac0b528bc29084617995c486fa2 Mon Sep 17 00:00:00 2001 From: Aren Elchinyan Date: Thu, 26 Oct 2023 23:11:38 +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=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D1=81=20cdrom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 48 ++++++++++++++++++----------------- include/version.h | 2 +- kernel/arch/cpu.c | 9 ++++--- kernel/fb.c | 3 ++- kernel/mod.c | 14 +++++----- run.sh | 1 + 6 files changed, 43 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3102f1..b81f74d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,9 +2,11 @@ name: Release Build on: workflow_dispatch: + branches-ignore: [ "pages" ] jobs: build: + runs-on: ubuntu-latest steps: @@ -21,28 +23,28 @@ jobs: git config --global user.email "github@github.com" git config --global user.name "Build bot" - - name: install depends - run: sudo apt install clang-format python3 git gdisk gcc g++ xorriso make mtools curl dos2unix - - - name: install limine - run: | - git clone https://github.com/limine-bootloader/limine.git --branch=v5.x-branch-binary --depth=1 + - name: install depends + run: sudo apt install clang-format python3 git gdisk gcc g++ xorriso make mtools curl dos2unix + + - name: install limine + run: | + git clone https://github.com/limine-bootloader/limine.git --branch=v5.x-branch-binary --depth=1 - - name: build - run: | - dos2unix *.sh - chmod +x build.sh - ./build.sh + - name: build + run: | + dos2unix *.sh + chmod +x build.sh + ./build.sh - - name: Add and commit files - uses: EndBug/add-and-commit@v9 - with: - add: 'x86_64-kernel.elf x86_64-mseos.hdd' - author_name: Bot - author_email: bot@example.com - commit: --signoff - message: Update - new_branch: binary - pathspec_error_handling: ignore - push: true - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Add and commit files + uses: EndBug/add-and-commit@v9 + with: + add: 'x86_64-kernel.elf x86_64-mseos.hdd' + author_name: Bot + author_email: bot@example.com + commit: --signoff + message: Update + new_branch: binary + pathspec_error_handling: ignore + push: true + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/include/version.h b/include/version.h index fd6b77f..db03fed 100644 --- a/include/version.h +++ b/include/version.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 1 -#define VERSION_BUILD 297 +#define VERSION_BUILD 299 diff --git a/kernel/arch/cpu.c b/kernel/arch/cpu.c index bda9028..0f61529 100644 --- a/kernel/arch/cpu.c +++ b/kernel/arch/cpu.c @@ -162,7 +162,8 @@ void cpu_init( ) { } cpuid(0x80000000, &eax, &ebx, &ecx, &edx); - fb_printf("Максимально поддерживаемая функция CPUID = 0x%x (%u)\n", eax, eax); + fb_printf("Максимально поддерживаемая функция CPUID = 0x%x (%u)\n", eax, + eax); cpuid(0x80000001, &eax, &ebx, &ecx, &edx); @@ -187,11 +188,13 @@ void cpu_init( ) { } if ((edx >> 11) & 1) { fb_printf("SYSCALL/SYSRET подерживаются!\n"); } - // if ((edx >> 26) & 1) { fb_printf("Гигабайтные страницы подерживаются!\n"); } + // if ((edx >> 26) & 1) { fb_printf("Гигабайтные страницы + // подерживаются!\n"); } if ((edx >> 29) & 1) { fb_printf("AMD64 поддерживается!\n"); } // if ((edx >> 30) & 1) { fb_printf("\"3DNow!\" поддерживается!\n"); } - // if ((edx >> 31) & 1) { fb_printf("\"Extended 3DNow!\" поддерживается!\n"); } + // if ((edx >> 31) & 1) { fb_printf("\"Extended 3DNow!\" + // поддерживается!\n"); } if ((ecx >> 6) & 1) { fb_printf("SSE4a поддерживается!\n"); } if ((ecx >> 7) & 1) { fb_printf("Смещенный режим SSE поддерживается!\n"); } diff --git a/kernel/fb.c b/kernel/fb.c index 862260f..17b62aa 100644 --- a/kernel/fb.c +++ b/kernel/fb.c @@ -64,7 +64,8 @@ void fb_init( ) { } // Отрисовка буффера по координатам (полезно для картинок) -void fb_print_buf(uint64_t x, uint64_t y, uint64_t h, uint64_t w, uint32_t *buf) { +void fb_print_buf(uint64_t x, uint64_t y, uint64_t h, uint64_t w, + uint32_t *buf) { for (uint64_t j = 0; j < h; j++) { for (uint64_t i = 0; i < w; i++) { uint64_t where = (i + x) + (j + y) * width; diff --git a/kernel/mod.c b/kernel/mod.c index 916b723..1f374cf 100644 --- a/kernel/mod.c +++ b/kernel/mod.c @@ -71,10 +71,11 @@ void mod_init( ) { for (uint64_t i = 0; i < module_count; i++) { module_ptr = module_response->modules[i]; - fb_printf("[%d] %s [%s] 0x%x\n", i, module_ptr->path, module_ptr->cmdline, - module_ptr->address); - fb_printf("->Размер: %u, тип носителя: %u, индекс раздела: %u\n", module_ptr->size, - module_ptr->media_type, module_ptr->partition_index); + fb_printf("[%d] %s [%s] 0x%x\n", i, module_ptr->path, + module_ptr->cmdline, module_ptr->address); + fb_printf("->Размер: %u, тип носителя: %u, индекс раздела: %u\n", + module_ptr->size, module_ptr->media_type, + module_ptr->partition_index); #if 0 fb_printf("[%d] %s [%s] 0x%x\n", i, module_ptr->path, module_ptr->cmdline, module_ptr->address); @@ -94,8 +95,9 @@ void mod_init( ) { } if (!tool_starts_with(module_ptr->cmdline, "[MOD]")) { continue; } modules_count++; - uint64_t (*module_init)(env_t *env) = (module_info_t * (*)(env_t * env)) - elf_entry(module_ptr->address, module_ptr->size); + uint64_t (*module_init)(env_t * env) = + (module_info_t * (*)(env_t * env)) + elf_entry(module_ptr->address, module_ptr->size); fb_printf("\t->Точка входа: 0x%x\n", module_init); diff --git a/run.sh b/run.sh index 7f62df0..62e5db5 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,6 @@ #!/bin/sh qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -hda bmosp.hdd --no-reboot +#qemu-system-x86_64 -name "БМПОС" -cpu max -m 1G -smp 1 -cdrom bmosp.iso -boot d --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