diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2025-07-24 15:31:31 +0000 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2025-07-24 15:31:31 +0000 |
| commit | 4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd (patch) | |
| tree | 6738e5ab071075c15beccc59b3f79f53477f477d /src | |
| parent | 2b8fafa2bddc48ddec047de517115c8e65ee61e8 (diff) | |
| download | teachos-4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd.tar.xz teachos-4edbe94ce1266c9acc6a695fedf1d2edd4ce11cd.zip | |
build: factor out kernel API
Diffstat (limited to 'src')
| -rw-r--r-- | src/abort.cpp | 3 | ||||
| -rw-r--r-- | src/kstd.cpp | 13 | ||||
| -rw-r--r-- | src/main.cpp | 13 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/abort.cpp b/src/abort.cpp new file mode 100644 index 0000000..6b0070e --- /dev/null +++ b/src/abort.cpp @@ -0,0 +1,3 @@ +#include "kapi/system.hpp" + +extern "C" [[noreturn]] auto abort() -> void { teachos::system::panic("Abort called"); } diff --git a/src/kstd.cpp b/src/kstd.cpp new file mode 100644 index 0000000..2149c12 --- /dev/null +++ b/src/kstd.cpp @@ -0,0 +1,13 @@ +#include "kapi/system.hpp" + +#include <kstd/bits/os.hpp> + +namespace kstd::os +{ + + auto panic(std::string_view message, std::source_location location) -> void + { + teachos::system::panic(message, location); + } + +} // namespace kstd::os
\ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d6199d0 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,13 @@ +#include "kapi/io.hpp" +#include "kapi/memory.hpp" +#include "kapi/system.hpp" + +auto main() -> int +{ + teachos::io::init(); + teachos::io::println("[OS] IO subsystem initialized."); + + teachos::memory::init(); + + teachos::system::panic("Architecture specific main returned!"); +} |
