aboutsummaryrefslogtreecommitdiff
path: root/examples/create_process/src/main2.zig
diff options
context:
space:
mode:
Diffstat (limited to 'examples/create_process/src/main2.zig')
-rw-r--r--examples/create_process/src/main2.zig22
1 files changed, 5 insertions, 17 deletions
diff --git a/examples/create_process/src/main2.zig b/examples/create_process/src/main2.zig
index 89a0255..0099302 100644
--- a/examples/create_process/src/main2.zig
+++ b/examples/create_process/src/main2.zig
@@ -2,23 +2,11 @@
//
// SPDX-License-Identifier: AGPL-3.0-or-later
-export fn _start() void {
- main();
-}
+const srvre_sys = @import("srvre_sys");
+const os = srvre_sys.os;
-pub fn main() void {
- const msg = "Hello from program 2\r\n";
- asm volatile (
- \\ li a7, 100001
- \\ ecall
- :
- : [ptr] "{a0}" (msg.ptr),
- [len] "{a1}" (msg.len),
- : "a7"
- );
+usingnamespace srvre_sys;
- asm volatile (
- \\ li a7, 100003
- \\ ecall
- ::: "a7");
+pub fn main() void {
+ _ = os.consoleWrite("Hello from program 2\r\n") catch unreachable;
}