Compare commits
3 Commits
9449b64b05
...
f8a4bed8d9
Author | SHA1 | Date | |
---|---|---|---|
f8a4bed8d9 | |||
b16bb3c49e | |||
4c92c11668 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -36,3 +36,7 @@ build
|
||||
|
||||
# SDK dir
|
||||
sdk
|
||||
|
||||
# Downloaded KolibriOS artifacts
|
||||
kolibrios-img.7z
|
||||
kolibri.img
|
@@ -26,3 +26,4 @@ message(STATUS "SDK_SYSROOT_DIR=${SDK_SYSROOT_DIR}")
|
||||
|
||||
add_subdirectory(toolchain)
|
||||
add_subdirectory(libraries)
|
||||
add_subdirectory(tests)
|
||||
|
14
README.md
14
README.md
@@ -1,2 +1,16 @@
|
||||
# kolibrios-sdk
|
||||
This is a C/C++ SDK for porting software to KolibriOS
|
||||
|
||||
## Build
|
||||
At the project root:
|
||||
```sh
|
||||
source activate-env
|
||||
cmake -B build
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
## Testing
|
||||
Launch KolibriOS with the mounted `SDK_TOOLCHAIN_DIR` directory:
|
||||
```sh
|
||||
./run-kos.sh
|
||||
```
|
||||
|
@@ -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
|
||||
)
|
||||
|
15
run-kos.sh
Executable file
15
run-kos.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
download_kolibrios()
|
||||
{
|
||||
wget -O "kolibrios-img.7z" https://builds.kolibrios.org/en_US/latest-img.7z
|
||||
7z e kolibrios-img.7z kolibri.img
|
||||
}
|
||||
|
||||
if [ ! -f "kolibri.img" ]; then
|
||||
download_kolibrios
|
||||
fi
|
||||
|
||||
qemu-system-i386 -boot a -fda kolibri.img -m 512 -drive file=fat:rw:"$SDK_SYSROOT_DIR" -usbdevice tablet
|
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