commit 96dbb8afdce0486dcdb32981e98be607b9771b2e Author: shibedrill Date: Fri Feb 7 10:20:46 2025 -0500 Initial commit diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..622eca8 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +target = "x86_64-unknown-none" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ed892b3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "rust-analyzer.cargo.target": "x86_64-unknown-none", + "rust-analyzer.check.allTargets": false +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..89391c7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,48 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "flagset" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" + +[[package]] +name = "gila" +version = "0.1.0" +dependencies = [ + "flagset", + "talc", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "talc" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fcad3be1cfe36eb7d716a04791eba36a197da9d9b6ea1e28e64ac569da3701d" +dependencies = [ + "lock_api", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..1b0cd09 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "gila" +version = "0.1.0" +edition = "2024" + +[dependencies] +flagset = "0.4.6" +talc = "4.4.2" + +[[bin]] +name = "gila" +path = "src/main.rs" +test = false +doctest = false +bench = false + diff --git a/src/alloc.rs b/src/alloc.rs new file mode 100644 index 0000000..4a04396 --- /dev/null +++ b/src/alloc.rs @@ -0,0 +1,4 @@ +#![allow(unused_imports)] + +use talc::*; +use core::alloc::{Allocator, Layout}; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..9ea2514 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,7 @@ +#![no_std] +#![feature(allocator_api)] + +pub mod process; +pub mod memory; +pub mod alloc; +pub mod panic; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..b72c39c --- /dev/null +++ b/src/main.rs @@ -0,0 +1,13 @@ +#![no_std] +#![feature(allocator_api)] +#![allow(dead_code)] +#![allow(unused_imports)] + +use gila::process; +use gila::memory; +use gila::alloc; +use gila::panic; + +fn main() { + +} diff --git a/src/memory.rs b/src/memory.rs new file mode 100644 index 0000000..6f751d2 --- /dev/null +++ b/src/memory.rs @@ -0,0 +1,17 @@ +#![allow(dead_code)] + +use flagset::flags; + +pub struct MemoryRegion { + start_address: usize, + end_address: usize, + +} + +flags! { + pub enum MemoryRegionFlags: u8 { + READABLE, + WRITABLE, + EXECUTABLE, + } +} \ No newline at end of file diff --git a/src/panic.rs b/src/panic.rs new file mode 100644 index 0000000..8041769 --- /dev/null +++ b/src/panic.rs @@ -0,0 +1,7 @@ + +use core::panic::*; + +#[panic_handler] +pub fn panic(_info: &PanicInfo) -> ! { + loop {} +} \ No newline at end of file diff --git a/src/process.rs b/src/process.rs new file mode 100644 index 0000000..b5eb100 --- /dev/null +++ b/src/process.rs @@ -0,0 +1,25 @@ +#![allow(dead_code)] + +use crate::memory::MemoryRegion; + +extern crate alloc; +use alloc::vec::Vec; +use alloc::string::String; + +pub struct Process { + proc_id: u32, + parent_proc_id: u32, + name: String, + stack_base_addr: usize, + stack_ptr_addr: usize, + mem_regions: Vec, + prio: u16, +} + +pub enum ProcessState { + RUNNING, + WAITING, + SLEEPING, + SUSPENDED, + +} \ No newline at end of file