Files
XunilOS/kernel/src/task/process.rs
T
csd4ni3l 925b2bc8d2 Add a proper vfs driver into the kernel which handles file operations,
fix munmap number, remove the draw calls, make address space an option,
copy only the top 256 bytes of the HHDM and map the ELF code inside
userspace, add safe copying from userspace
2026-05-09 11:36:48 +02:00

42 lines
847 B
Rust

use alloc::vec::Vec;
use crate::{driver::keyboard::KeyboardEvent, mm::address_space::AddressSpace};
pub enum ProcessState {
Ready,
Running,
Blocked,
Zombie,
}
pub struct Process {
pub pid: u64,
pub state: ProcessState,
pub stack_top: u64,
pub heap_base: u64,
pub heap_end: u64,
pub kbd_buffer: Vec<KeyboardEvent>,
pub address_space: Option<AddressSpace>,
pub user_entry: u64,
}
impl Process {
pub fn new(
pid: u64,
user_entry: u64,
stack_top: u64,
heap_base: u64,
heap_end: u64,
) -> Process {
Process {
pid,
stack_top,
state: ProcessState::Ready,
heap_base,
heap_end,
kbd_buffer: Vec::new(),
address_space: None,
user_entry,
}
}
}