diff --git a/Cargo.lock b/Cargo.lock index 9c4ae51b..e7617879 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,16 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "sentient_os" +version = "0.1.0" +dependencies = [ + "common", + "elf", + "gimli", + "unwinding", +] + [[package]] name = "unwinding" version = "0.2.5" @@ -33,13 +43,3 @@ version = "0.1.0" dependencies = [ "common", ] - -[[package]] -name = "yaos" -version = "0.1.0" -dependencies = [ - "common", - "elf", - "gimli", - "unwinding", -] diff --git a/Cargo.toml b/Cargo.toml index 1921bfde..5931faf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,8 @@ default-members = ["kernel"] resolver = "2" [workspace.package] -description = "Yet another Operating System (YaOS)" -authors = ["Maurice Hieronymus "] +description = "SentientOS" +authors = ["Maurice Hieronymus "] version = "0.1.0" [profile.release] diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index a53e48ad..02287b84 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "yaos" +name = "sentient_os" edition = "2021" version.workspace = true authors.workspace = true diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 5d6f201f..20d715a0 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -62,7 +62,7 @@ extern "C" fn kernel_init(hart_id: usize, device_tree_pointer: *const ()) -> ! { QEMU_UART.lock().init(); - info!("Hello World from YaOS!\n"); + info!("Hello World from SentientOS!\n"); info!("Device Tree Pointer: {:p}", device_tree_pointer); let version = sbi::extensions::base_extension::sbi_get_spec_version(); diff --git a/kernel/src/processes/scheduler.rs b/kernel/src/processes/scheduler.rs index 56d3e7fb..7818f85d 100644 --- a/kernel/src/processes/scheduler.rs +++ b/kernel/src/processes/scheduler.rs @@ -85,7 +85,7 @@ impl CpuScheduler { self.queue_current_process_back(); process_table::THE.with_lock(|mut pt| { - let highest_pid = pt.get_highest_pid_without(&["yash"]); + let highest_pid = pt.get_highest_pid_without(&["sesh"]); if let Some(pid) = highest_pid { pt.kill(pid); diff --git a/qemu_wrapper.sh b/qemu_wrapper.sh index 30f6b829..db67c813 100755 --- a/qemu_wrapper.sh +++ b/qemu_wrapper.sh @@ -27,7 +27,7 @@ while [[ $# -gt 0 ]]; do echo "" echo "Options:" echo " --gdb Let qemu listen on :1234 for gdb connections" - echo " --log Log qemu events to /tmp/yaos.log" + echo " --log Log qemu events to /tmp/sentientos.log" echo " --capture Capture network traffic into network.pcap" echo " --net Enable network card" echo " -h, --help Show this help message" @@ -35,7 +35,7 @@ while [[ $# -gt 0 ]]; do exit 0 ;; --log) - QEMU_CMD+=" -d guest_errors,cpu_reset,unimp,int -D /tmp/yaos.log" + QEMU_CMD+=" -d guest_errors,cpu_reset,unimp,int -D /tmp/sentientos.log" shift ;; --net) diff --git a/readme.md b/readme.md index a01c7bd0..8b933a07 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ -# YaOS (Yet another Operating System) -[![ci](https://github.com/hieronymusma/yaos/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/hieronymusma/yaos/actions/workflows/ci.yml) +# SentientOS +[![ci](https://github.com/sysheap/sentientos/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sysheap/sentientos/actions/workflows/ci.yml) This projects makes my dream come true - write my own operating system. I'm doing this mostly for fun, so don't expect a fully-fledged operating system on basis of the RISC-V architecture. Exactly like [SerenityOS](https://github.com/SerenityOS/serenity) this project doesn't use third-party runtime dependencies. If third-party dependencies are used, then only for the Build. diff --git a/system-tests/src/infra/qemu.rs b/system-tests/src/infra/qemu.rs index 3f7e696c..61f1de6d 100644 --- a/system-tests/src/infra/qemu.rs +++ b/system-tests/src/infra/qemu.rs @@ -70,11 +70,13 @@ impl QemuInstance { let mut stdout = ReadAsserter::new(stdout); - stdout.assert_read_until("Hello World from YaOS!").await; + stdout + .assert_read_until("Hello World from SentientOS!") + .await; stdout.assert_read_until("kernel_init done!").await; stdout.assert_read_until("init process started").await; stdout - .assert_read_until("### YaSH - Yet another Shell ###") + .assert_read_until("### SeSH - Sentient Shell ###") .await; stdout.assert_read_until(PROMPT).await; diff --git a/system-tests/src/tests/basics.rs b/system-tests/src/tests/basics.rs index f89eae97..2aca621a 100644 --- a/system-tests/src/tests/basics.rs +++ b/system-tests/src/tests/basics.rs @@ -17,21 +17,21 @@ async fn boot_with_network() -> anyhow::Result<()> { #[tokio::test] async fn shutdown() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; + let mut sentientos = QemuInstance::start().await?; - yaos.run_prog_waiting_for("exit", "shutting down system") + sentientos.run_prog_waiting_for("exit", "shutting down system") .await?; - assert!(yaos.wait_for_qemu_to_exit().await?.success()); + assert!(sentientos.wait_for_qemu_to_exit().await?.success()); Ok(()) } #[tokio::test] async fn execute_program() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; + let mut sentientos = QemuInstance::start().await?; - let output = yaos.run_prog("prog1").await?; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, "Hello from Prog1\n"); @@ -40,14 +40,14 @@ async fn execute_program() -> anyhow::Result<()> { #[tokio::test] async fn execute_same_program_twice() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; + let mut sentientos = QemuInstance::start().await?; let expected = "Hello from Prog1\n"; - let output = yaos.run_prog("prog1").await?; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, expected); - let output = yaos.run_prog("prog1").await?; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, expected); Ok(()) @@ -55,12 +55,12 @@ async fn execute_same_program_twice() -> anyhow::Result<()> { #[tokio::test] async fn execute_different_programs() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; + let mut sentientos = QemuInstance::start().await?; - let output = yaos.run_prog("prog1").await?; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, "Hello from Prog1\n"); - let output = yaos.run_prog("prog2").await?; + let output = sentientos.run_prog("prog2").await?; assert_eq!(output, "Hello from Prog2\n"); Ok(()) diff --git a/system-tests/src/tests/net.rs b/system-tests/src/tests/net.rs index 6256b883..d5076223 100644 --- a/system-tests/src/tests/net.rs +++ b/system-tests/src/tests/net.rs @@ -6,9 +6,9 @@ use crate::infra::qemu::{QemuInstance, QemuOptions}; #[file_serial] #[tokio::test] async fn udp() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start_with(QemuOptions::default().add_network_card(true)).await?; + let mut sentientos = QemuInstance::start_with(QemuOptions::default().add_network_card(true)).await?; - yaos.run_prog_waiting_for("udp", "Listening on 1234\n") + sentientos.run_prog_waiting_for("udp", "Listening on 1234\n") .await .expect("udp program must succeed to start"); @@ -16,18 +16,18 @@ async fn udp() -> anyhow::Result<()> { socket.connect("127.0.0.1:1234").await?; socket.send("42\n".as_bytes()).await?; - yaos.stdout().assert_read_until("42\n").await; + sentientos.stdout().assert_read_until("42\n").await; - yaos.stdin().write("Hello from YaOS!\n".as_bytes()).await?; + sentientos.stdin().write("Hello from SentientOS!\n".as_bytes()).await?; let mut buf = [0; 128]; let bytes = socket.recv(&mut buf).await?; let response = String::from_utf8_lossy(&buf[0..bytes]); - assert_eq!(response, "Hello from YaOS!\n"); + assert_eq!(response, "Hello from SentientOS!\n"); socket.send("Finalize test\n".as_bytes()).await?; - yaos.stdout().assert_read_until("Finalize test\n").await; + sentientos.stdout().assert_read_until("Finalize test\n").await; Ok(()) } diff --git a/system-tests/src/tests/panic.rs b/system-tests/src/tests/panic.rs index 7ef8fae9..f56c054e 100644 --- a/system-tests/src/tests/panic.rs +++ b/system-tests/src/tests/panic.rs @@ -2,8 +2,8 @@ use crate::infra::qemu::QemuInstance; #[tokio::test] async fn panic() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; - let output = yaos + let mut sentientos = QemuInstance::start().await?; + let output = sentientos .run_prog_waiting_for("panic", "Time to attach gdb ;) use 'just attach'") .await?; diff --git a/system-tests/src/tests/signals.rs b/system-tests/src/tests/signals.rs index c528fe2b..acfc77fb 100644 --- a/system-tests/src/tests/signals.rs +++ b/system-tests/src/tests/signals.rs @@ -9,27 +9,29 @@ use crate::infra::{ #[file_serial] #[tokio::test] async fn should_exit_program() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start_with(QemuOptions::default().add_network_card(true)).await?; + let mut sentientos = + QemuInstance::start_with(QemuOptions::default().add_network_card(true)).await?; - yaos.run_prog_waiting_for("udp", "Listening on 1234") + sentientos + .run_prog_waiting_for("udp", "Listening on 1234") .await?; - yaos.stdin().write_all(&[0x03]).await?; + sentientos.stdin().write_all(&[0x03]).await?; - yaos.stdout().assert_read_until(PROMPT).await; - let output = yaos.run_prog("prog1").await?; + sentientos.stdout().assert_read_until(PROMPT).await; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, "Hello from Prog1\n"); Ok(()) } #[tokio::test] -async fn should_not_exit_yash() -> anyhow::Result<()> { - let mut yaos = QemuInstance::start().await?; +async fn should_not_exit_sesh() -> anyhow::Result<()> { + let mut sentientos = QemuInstance::start().await?; - yaos.stdin().write_all(&[0x03]).await?; + sentientos.stdin().write_all(&[0x03]).await?; - let output = yaos.run_prog("prog1").await?; + let output = sentientos.run_prog("prog1").await?; assert_eq!(output, "Hello from Prog1\n"); Ok(()) diff --git a/userspace/Cargo.toml b/userspace/Cargo.toml index 76bf7397..66d01924 100644 --- a/userspace/Cargo.toml +++ b/userspace/Cargo.toml @@ -54,6 +54,6 @@ test = false bench = false [[bin]] -name = "yash" +name = "sesh" test = false bench = false diff --git a/userspace/src/bin/init.rs b/userspace/src/bin/init.rs index 7b7853f5..d8ff2a27 100644 --- a/userspace/src/bin/init.rs +++ b/userspace/src/bin/init.rs @@ -10,7 +10,7 @@ extern crate userspace; fn main() { println!("init process started"); println!("starting shell"); - let shell_name = "yash"; + let shell_name = "sesh"; let shell_pid = sys_execute(shell_name).unwrap(); sys_wait(shell_pid as u64).unwrap(); println!("Initial shell has exited..."); diff --git a/userspace/src/bin/yash.rs b/userspace/src/bin/sesh.rs similarity index 97% rename from userspace/src/bin/yash.rs rename to userspace/src/bin/sesh.rs index 40221abf..9f2a797c 100644 --- a/userspace/src/bin/yash.rs +++ b/userspace/src/bin/sesh.rs @@ -11,7 +11,7 @@ extern crate userspace; #[unsafe(no_mangle)] fn main() { println!(); - println!("### YaSH - Yet another Shell ###"); + println!("### SeSH - Sentient Shell ###"); println!("Type 'help' for a list of available commands."); loop { print!("$ ");