From 2316ec9d1d578a4207bc626754cb4c99a14fc298 Mon Sep 17 00:00:00 2001 From: Aren Date: Tue, 17 Oct 2023 13:10:01 +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=20assert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/version.h | 2 +- kernel/main.c | 10 ---------- kernel/main.cpp | 18 ++++++++++++++++++ kernel/start.cpp | 2 +- pbuild.py | 4 ++-- 5 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 kernel/main.c create mode 100644 kernel/main.cpp diff --git a/include/version.h b/include/version.h index a014a58..417060a 100644 --- a/include/version.h +++ b/include/version.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 1 -#define VERSION_BUILD 98 +#define VERSION_BUILD 100 diff --git a/kernel/main.c b/kernel/main.c deleted file mode 100644 index c470634..0000000 --- a/kernel/main.c +++ /dev/null @@ -1,10 +0,0 @@ - -void assert(int x) {} - -void *malloc(int size) {} - -void *realloc(void *pointer, int new_size) {} - -void free(void *pointer) {} - -void main( ) {} \ No newline at end of file diff --git a/kernel/main.cpp b/kernel/main.cpp new file mode 100644 index 0000000..01dd77b --- /dev/null +++ b/kernel/main.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +void assert(int x) { + if (!x) { + fb::printf("assert(%d)\n", x); + while (1) { asm volatile("hlt"); } + } +} + +void *malloc(int size) {} + +void *realloc(void *pointer, int new_size) {} + +void free(void *pointer) {} + +void main( ) {} \ No newline at end of file diff --git a/kernel/start.cpp b/kernel/start.cpp index 3ae8b5b..2670bd9 100644 --- a/kernel/start.cpp +++ b/kernel/start.cpp @@ -26,7 +26,7 @@ extern "C" void _start( ) { cpu::init( ); mem::init( ); fb::printf("\t\t\t\t *** Базовая Модульная Платформа Операционных Систем " - "версии %u.%u, %u ***\n", + "версии %u.%u.%u ***\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); fb::printf("\t\t\t\t *** Дата сборки: %s %s ***\n", __DATE__, __TIME__); mod::init( ); diff --git a/pbuild.py b/pbuild.py index 720ac9b..8378728 100644 --- a/pbuild.py +++ b/pbuild.py @@ -25,7 +25,7 @@ def version_build(): if line.startswith("#define VERSION_BUILD"): parts = line.split() build = int(parts[2]) + 1 - if build > 255: + if build > 999: build = 0 minor += 1 file.write(f"#define VERSION_MINOR {minor}\n") @@ -164,4 +164,4 @@ if __name__ == "__main__": create_iso("bmosp") create_hdd("bmosp") - print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}, {build}") \ No newline at end of file + print(f"Не забудьте сохранить изменения! Номер сборки: {major}.{minor}.{build}") \ No newline at end of file