summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-07-04 00:55:59 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2025-07-06 22:21:50 +0200
commit892ecce78dec37a1b2701611dd72986442cd094d (patch)
treebbd7fb0a0229795bf52d0b8a9ff9b06251363a67 /src
parent99554cc243c4b2ec290639a04ebc2f189890d6dd (diff)
Import project skeleton from rts
https://gitea.privatedns.org/xavi/rts
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt43
-rw-r--r--src/main.c25
-rw-r--r--src/system.cnf4
3 files changed, 72 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>.
+
+# 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+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