Initial commit

This commit is contained in:
River 2025-02-07 10:20:46 -05:00
commit 96dbb8afdc
Signed by: shibedrill
GPG Key ID: 5FE0CB25945EFAA2
11 changed files with 144 additions and 0 deletions

2
.cargo/config.toml Normal file
View File

@ -0,0 +1,2 @@
[build]
target = "x86_64-unknown-none"

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"rust-analyzer.cargo.target": "x86_64-unknown-none",
"rust-analyzer.check.allTargets": false
}

48
Cargo.lock generated Normal file
View File

@ -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",
]

16
Cargo.toml Normal file
View File

@ -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

4
src/alloc.rs Normal file
View File

@ -0,0 +1,4 @@
#![allow(unused_imports)]
use talc::*;
use core::alloc::{Allocator, Layout};

7
src/lib.rs Normal file
View File

@ -0,0 +1,7 @@
#![no_std]
#![feature(allocator_api)]
pub mod process;
pub mod memory;
pub mod alloc;
pub mod panic;

13
src/main.rs Normal file
View File

@ -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() {
}

17
src/memory.rs Normal file
View File

@ -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,
}
}

7
src/panic.rs Normal file
View File

@ -0,0 +1,7 @@
use core::panic::*;
#[panic_handler]
pub fn panic(_info: &PanicInfo) -> ! {
loop {}
}

25
src/process.rs Normal file
View File

@ -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<MemoryRegion>,
prio: u16,
}
pub enum ProcessState {
RUNNING,
WAITING,
SLEEPING,
SUSPENDED,
}