mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-06-02 13:44:25 +02:00
Increase kernel stack size to 2mb, move from cooperative to timer
preemption based scheduling, add correct save_lock on aarch64, add simple IPC (read, write, manage), and simple and unsecure SHM, add per-process kernel stacks, add copy_cstr_to_user, always use run_next for aarch64, remove primitives from the kernel
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
use core::sync::atomic::Ordering;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use crate::{
|
||||
driver::io::keyboard::KeyboardEvent, mm::address_space::AddressSpace,
|
||||
task::context::UserContext,
|
||||
arch::arch::GLOBAL_TICK_COUNT, driver::io::keyboard::KeyboardEvent,
|
||||
mm::address_space::AddressSpace, task::context::UserContext,
|
||||
};
|
||||
|
||||
pub enum ProcessState {
|
||||
@@ -22,13 +24,14 @@ pub struct Process {
|
||||
pub pid: u64,
|
||||
pub state: ProcessState,
|
||||
pub stack_top: u64,
|
||||
pub kernel_stack_top: u64,
|
||||
pub heap_base: u64,
|
||||
pub heap_end: u64,
|
||||
pub kbd_buffer: Vec<KeyboardEvent>,
|
||||
pub address_space: Option<AddressSpace>,
|
||||
pub saved_ctx: Option<UserContext>,
|
||||
pub should_reschedule: bool,
|
||||
pub user_entry: u64,
|
||||
pub last_switch_tick: u64,
|
||||
pub info: ProcessInfo,
|
||||
}
|
||||
impl Process {
|
||||
@@ -36,19 +39,21 @@ impl Process {
|
||||
pid: u64,
|
||||
user_entry: u64,
|
||||
stack_top: u64,
|
||||
kernel_stack_top: u64,
|
||||
heap_base: u64,
|
||||
heap_end: u64,
|
||||
) -> Process {
|
||||
Process {
|
||||
pid,
|
||||
stack_top,
|
||||
kernel_stack_top,
|
||||
state: ProcessState::Ready,
|
||||
heap_base,
|
||||
heap_end,
|
||||
last_switch_tick: GLOBAL_TICK_COUNT.load(Ordering::Relaxed),
|
||||
kbd_buffer: Vec::new(),
|
||||
address_space: None,
|
||||
saved_ctx: None,
|
||||
should_reschedule: false,
|
||||
user_entry,
|
||||
info: ProcessInfo {
|
||||
exit_code: 0,
|
||||
|
||||
Reference in New Issue
Block a user