From 892ecce78dec37a1b2701611dd72986442cd094d Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 4 Jul 2025 00:55:59 +0200 Subject: Import project skeleton from rts https://gitea.privatedns.org/xavi/rts --- src/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main.c | 25 +++++++++++++++++++++++++ src/system.cnf | 4 ++++ 3 files changed, 72 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/main.c create mode 100644 src/system.cnf (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..51806be --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,43 @@ +# wanix, a Unix-like operating system for WebAssembly +# Copyright (C) 2025 Xavier Del Campo Romero +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Avoid C11 since it is not supported by the i386-mingw32 toolchain. +set(cflags ${cflags} -Wall -ffunction-sections -fdata-sections -pedantic) + +set(components +) + +set(interfaces +) + +target_compile_options(${PROJECT_NAME} PUBLIC ${cflags}) +# Dependencies for main.c +# target_link_libraries(${PROJECT_NAME} PRIVATE) + +foreach(c ${components}) + add_subdirectory("${c}") + target_compile_options(${c} PUBLIC ${cflags}) + target_compile_features(${c} PUBLIC c_std_99) + set_target_properties(${c} PROPERTIES C_STANDARD 99 C_EXTENSIONS OFF) +endforeach() + +foreach(i ${interfaces}) + add_subdirectory("${i}") + target_compile_options(${i} INTERFACE ${cflags}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${c}) +endforeach() + +target_link_options(${PROJECT_NAME} PRIVATE -Wl,--gc-sections) diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..09c1f21 --- /dev/null +++ b/src/main.c @@ -0,0 +1,25 @@ +/* + * wanix, a Unix-like operating system for WebAssembly + * Copyright (C) 2025 Xavier Del Campo Romero + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +int main(void) +{ + int ret = EXIT_SUCCESS; + return ret; +} diff --git a/src/system.cnf b/src/system.cnf new file mode 100644 index 0000000..716bb6c --- /dev/null +++ b/src/system.cnf @@ -0,0 +1,4 @@ +BOOT = cdrom:\wanix.exe;1 +TCB = 4 +EVENT = 8 +STACK = 801FF800 -- cgit v1.2.3