From feac63c1004883de2f9187c13f3c0b7318814fc1 Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 16 Sep 2024 12:29:52 -0500 Subject: [PATCH] Initial commit --- .cargo/config.toml | 5 +++++ .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 6 ++++++ rust-toolchain.toml | 2 ++ src/main.rs | 12 ++++++++++++ 6 files changed, 33 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 rust-toolchain.toml create mode 100644 src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..bec4b7a --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,5 @@ +[build] +target = "x86_64-unknown-mikros" + +[install] +root = "../os_build/sysroot" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..560dcee --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "pts_tester" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..4ea5e5f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "pts_tester" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..a5535e3 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "dev-x86_64-unknown-mikros" diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..a5d16f5 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,12 @@ +use std::{fs::File, io::{BufRead, BufReader}}; +use std::io::Write; + +fn main() { + let pts_read = File::open("/dev/pts0").unwrap(); + let mut pts_write = File::open("/dev/pts0").unwrap(); + + for line in BufReader::new(pts_read).lines() { + let line = line.unwrap(); + writeln!(pts_write, "Got line on PTS: {:?}", line).unwrap(); + } +}