Tests: Added hello (prints a message to the debug board)
Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
This commit is contained in:
@@ -26,3 +26,4 @@ message(STATUS "SDK_SYSROOT_DIR=${SDK_SYSROOT_DIR}")
|
|||||||
|
|
||||||
add_subdirectory(toolchain)
|
add_subdirectory(toolchain)
|
||||||
add_subdirectory(libraries)
|
add_subdirectory(libraries)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
@@ -17,5 +17,4 @@ ExternalProject_Add(
|
|||||||
-DCMAKE_C_COMPILER=i586-kolibrios-gcc
|
-DCMAKE_C_COMPILER=i586-kolibrios-gcc
|
||||||
-DCMAKE_C_COMPILER_WORKS=1
|
-DCMAKE_C_COMPILER_WORKS=1
|
||||||
-DCMAKE_INSTALL_PREFIX=${SDK_SYSROOT_DIR}
|
-DCMAKE_INSTALL_PREFIX=${SDK_SYSROOT_DIR}
|
||||||
DEPENDS copy-kos-app-lds
|
|
||||||
)
|
)
|
||||||
|
12
tests/CMakeLists.txt
Normal file
12
tests/CMakeLists.txt
Normal 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
13
tests/hello/hello.c
Normal 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++;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user