Skip to content

Commit

Permalink
Rename: Change YaOS to SentientOS
Browse files Browse the repository at this point in the history
I found out that YaOS was already taken by a couple of other projects
on Github. Therefore, choose a unique name.
  • Loading branch information
sysheap committed Jan 6, 2025
1 parent c42af05 commit ae18430
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 49 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ default-members = ["kernel"]
resolver = "2"

[workspace.package]
description = "Yet another Operating System (YaOS)"
authors = ["Maurice Hieronymus <[email protected]>"]
description = "SentientOS"
authors = ["Maurice Hieronymus <[email protected]>"]
version = "0.1.0"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion kernel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "yaos"
name = "sentient_os"
edition = "2021"
version.workspace = true
authors.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions qemu_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ 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"
echo " --wait Wait cpu until gdb is attached"
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)
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 3 additions & 1 deletion system-tests/src/infra/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ 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
Expand Down
22 changes: 11 additions & 11 deletions system-tests/src/tests/basics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -40,27 +40,27 @@ 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(())
}

#[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(())
Expand Down
12 changes: 6 additions & 6 deletions system-tests/src/tests/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ 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");

let socket = tokio::net::UdpSocket::bind("127.0.0.1:0").await?;
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(())
}
4 changes: 2 additions & 2 deletions system-tests/src/tests/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down
16 changes: 8 additions & 8 deletions system-tests/src/tests/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ 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?;
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(())
Expand Down
2 changes: 1 addition & 1 deletion userspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ test = false
bench = false

[[bin]]
name = "yash"
name = "sesh"
test = false
bench = false
2 changes: 1 addition & 1 deletion userspace/src/bin/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down
2 changes: 1 addition & 1 deletion userspace/src/bin/yash.rs → userspace/src/bin/sesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!("$ ");
Expand Down

0 comments on commit ae18430

Please sign in to comment.