Tests: Added hello (prints a message to the debug board)

Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
This commit is contained in:
2025-03-23 18:10:56 +03:00
parent 9449b64b05
commit 4c92c11668
5 changed files with 26 additions and 1 deletions

View File

@@ -26,3 +26,4 @@ message(STATUS "SDK_SYSROOT_DIR=${SDK_SYSROOT_DIR}")
add_subdirectory(toolchain)
add_subdirectory(libraries)
add_subdirectory(tests)

View File

@@ -17,5 +17,4 @@ ExternalProject_Add(
-DCMAKE_C_COMPILER=i586-kolibrios-gcc
-DCMAKE_C_COMPILER_WORKS=1
-DCMAKE_INSTALL_PREFIX=${SDK_SYSROOT_DIR}
DEPENDS copy-kos-app-lds
)

12
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
# Rules for building tests
# Pseudo libc (kos-crt-stub)
ExternalProject_Add(
test-hello
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hello
CMAKE_ARGS
-DCMAKE_C_COMPILER=i586-kolibrios-gcc
-DCMAKE_C_COMPILER_WORKS=1
-DCMAKE_INSTALL_PREFIX=${SDK_SYSROOT_DIR}
BUILD_ALWAYS TRUE
)

13
tests/hello/hello.c Normal file
View File

@@ -0,0 +1,13 @@
/*
* SPDX-License-Identifier: GPL-2.0
* Copyright (C) 2025 KolibriOS team
*/
int main()
{
char *hello = "I: Hello KolibriOS from GCC!\n";
while(*hello) {
__asm__ __inline__("int $0x40" ::"a"(63), "b"(1), "c"(*hello));
hello++;
}
}