forked from AbleOS/ableos
Proc changes
This commit is contained in:
parent
b3b9cc3c76
commit
2d5e8d24eb
|
@ -1,5 +1,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
target = "./json_targets/x86_64-ableos.json"
|
# target = "./json_targets/x86_64-ableos.json"
|
||||||
|
target = "x86_64-unknown-uefi"
|
||||||
|
|
||||||
[unstable]
|
[unstable]
|
||||||
build-std = ["core", "compiler_builtins", "alloc"]
|
build-std = ["core", "compiler_builtins", "alloc"]
|
||||||
|
@ -7,6 +11,7 @@ build-std-features = ["compiler-builtins-mem"]
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(target_arch = "x86_64")']
|
[target.'cfg(target_arch = "x86_64")']
|
||||||
|
rustflags = ["-C", "target-feature=+rdrnd"]
|
||||||
runner = "bootimage runner"
|
runner = "bootimage runner"
|
||||||
|
|
||||||
[target.riscv64gc-unknown-none-elf]
|
[target.riscv64gc-unknown-none-elf]
|
||||||
|
|
49
ableos/Cargo.lock
generated
49
ableos/Cargo.lock
generated
|
@ -39,6 +39,7 @@ dependencies = [
|
||||||
"pic8259",
|
"pic8259",
|
||||||
"picorand",
|
"picorand",
|
||||||
"pretty-hex",
|
"pretty-hex",
|
||||||
|
"rdrand",
|
||||||
"rkyv",
|
"rkyv",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
@ -46,6 +47,7 @@ dependencies = [
|
||||||
"smoltcp",
|
"smoltcp",
|
||||||
"spin",
|
"spin",
|
||||||
"uart_16550",
|
"uart_16550",
|
||||||
|
"uefi",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"vga",
|
"vga",
|
||||||
"volatile 0.2.7",
|
"volatile 0.2.7",
|
||||||
|
@ -410,6 +412,21 @@ dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_core"
|
||||||
|
version = "0.6.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rdrand"
|
||||||
|
version = "0.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c4e0d5cb05cb40e4e5805399c27b12a064427cf553081ae9b82bc1a88111a576"
|
||||||
|
dependencies = [
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rhai"
|
name = "rhai"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
|
@ -604,6 +621,38 @@ dependencies = [
|
||||||
"x86_64",
|
"x86_64",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ucs2"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bad643914094137d475641b6bab89462505316ec2ce70907ad20102d28a79ab8"
|
||||||
|
dependencies = [
|
||||||
|
"bit_field",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "uefi"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a21398a404f6fa14f6df34756714874eccdf73587eba863cb5bd55d8bada7496"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"log",
|
||||||
|
"ucs2",
|
||||||
|
"uefi-macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "uefi-macros"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7006b85ae8acaf2b448c5f1630a434caaacaedcc0907f12404e4e31c9dafcdb3"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
version = "0.1.9"
|
version = "0.1.9"
|
||||||
|
|
|
@ -10,7 +10,12 @@ panic = "abort"
|
||||||
[package.metadata.bootimage]
|
[package.metadata.bootimage]
|
||||||
run-args = [
|
run-args = [
|
||||||
"-cpu",
|
"-cpu",
|
||||||
"kvm64-v1",
|
# "kvm64-v1",
|
||||||
|
# Support for rdrand
|
||||||
|
# "Broadwell",
|
||||||
|
"EPYC-v1",
|
||||||
|
|
||||||
|
|
||||||
"-serial",
|
"-serial",
|
||||||
"stdio",
|
"stdio",
|
||||||
"-smp",
|
"-smp",
|
||||||
|
@ -18,8 +23,8 @@ run-args = [
|
||||||
|
|
||||||
|
|
||||||
# An example gpu used with ableOS
|
# An example gpu used with ableOS
|
||||||
"-device",
|
# "-device",
|
||||||
"virtio-gpu",
|
# "virtio-gpu",
|
||||||
|
|
||||||
# An example disk used with ableOS
|
# An example disk used with ableOS
|
||||||
"-device",
|
"-device",
|
||||||
|
@ -46,6 +51,14 @@ pretty-hex = "0.2.1"
|
||||||
unicode-width = "0.1.7"
|
unicode-width = "0.1.7"
|
||||||
picorand = "*"
|
picorand = "*"
|
||||||
# watson = "0.4"
|
# watson = "0.4"
|
||||||
|
uefi = { version="*", features = ["exts"] }
|
||||||
|
|
||||||
|
|
||||||
|
[dependencies.rdrand]
|
||||||
|
version = "0.8.1"
|
||||||
|
default-features = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[dependencies.serde]
|
[dependencies.serde]
|
||||||
version = "*"
|
version = "*"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
|
// use rkyv::{Deserialize, Serialize};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize, Debug, Deserialize)]
|
#[derive(Serialize, Debug, Deserialize)]
|
||||||
|
|
|
@ -17,7 +17,7 @@ use proc::{Process, PID};
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
use crate::file::PathRep;
|
use crate::{file::PathRep, kmain::generate_process_pass};
|
||||||
|
|
||||||
use self::capabilities::Capabilities;
|
use self::capabilities::Capabilities;
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ impl Scheduler {
|
||||||
pub fn new_process(&mut self, priority: Priority) -> Process {
|
pub fn new_process(&mut self, priority: Priority) -> Process {
|
||||||
let process = Process {
|
let process = Process {
|
||||||
id: self.free_pid.clone(),
|
id: self.free_pid.clone(),
|
||||||
|
password: generate_process_pass(),
|
||||||
capabilities: Capabilities::empty(),
|
capabilities: Capabilities::empty(),
|
||||||
priority,
|
priority,
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,7 @@ use alloc::vec::Vec;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
capabilities::Capabilities,
|
capabilities::Capabilities,
|
||||||
|
kmain::generate_process_pass,
|
||||||
proc::{Process, PID},
|
proc::{Process, PID},
|
||||||
Priority,
|
Priority,
|
||||||
};
|
};
|
||||||
|
@ -66,6 +67,7 @@ impl Scheduler {
|
||||||
pub fn new_process(&mut self, priority: Priority) -> Process {
|
pub fn new_process(&mut self, priority: Priority) -> Process {
|
||||||
let process = Process {
|
let process = Process {
|
||||||
id: self.free_pid,
|
id: self.free_pid,
|
||||||
|
password: generate_process_pass(),
|
||||||
priority,
|
priority,
|
||||||
capabilities: Capabilities::empty(),
|
capabilities: Capabilities::empty(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,10 @@ pub struct PID(pub usize);
|
||||||
pub struct Process {
|
pub struct Process {
|
||||||
/// Internal PID
|
/// Internal PID
|
||||||
pub id: PID,
|
pub id: PID,
|
||||||
|
|
||||||
|
/// Process password
|
||||||
|
pub password: u128,
|
||||||
|
|
||||||
///
|
///
|
||||||
pub capabilities: Capabilities,
|
pub capabilities: Capabilities,
|
||||||
/// A process's priority
|
/// A process's priority
|
||||||
|
|
Loading…
Reference in a new issue