diff --git a/kernel/src/drivers/keyboard.rs b/kernel/src/drivers/keyboard.rs index 618934e..e6ef571 100644 --- a/kernel/src/drivers/keyboard.rs +++ b/kernel/src/drivers/keyboard.rs @@ -2,7 +2,7 @@ //Interrupt handler for keyboard, reads scancode from keyboard controller then interprets it use crate::drivers::pic::PICS; -use crate::shell::SHELL; +use crate::shell::shell::SHELL; use core::arch::asm; //Warning! Mutable static here diff --git a/kernel/src/interrupts/timer.rs b/kernel/src/interrupts/timer.rs index 2e204da..4914772 100644 --- a/kernel/src/interrupts/timer.rs +++ b/kernel/src/interrupts/timer.rs @@ -2,8 +2,8 @@ //Used to trigger the cpu scheduler and to context switch use crate::drivers::pic::PICS; -use crate::task::CPUState; -use crate::task::TASK_MANAGER; +use crate::multitasking::task::CPUState; +use crate::multitasking::task::TASK_MANAGER; use core::arch::asm; pub const TIMER_INT: u8 = 32; diff --git a/kernel/src/main.rs b/kernel/src/main.rs index fc652ef..1244de2 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -6,10 +6,10 @@ mod drivers; mod filesystem; mod interrupts; +mod memory; +mod multitasking; mod shell; mod syscalls; -mod task; -mod paging; use core::arch::asm; use core::panic::PanicInfo; @@ -17,10 +17,10 @@ use drivers::disk::DISK; use drivers::pic::PICS; use filesystem::fat::FAT; use interrupts::idt::IDT; -use shell::SHELL; +use shell::shell::SHELL; use syscalls::print::PRINTER; -use paging::PAGING; -use paging::PageTable; +use memory::paging::PAGING; +use memory::paging::PageTable; use libfelix; @@ -56,7 +56,9 @@ pub extern "C" fn _start() -> ! { PAGING.set_table(1, &table1); PAGING.set_table(2, &table2); PAGING.set_table(3, &table3); - //PAGING.set_table(15, &table2); + + let table = PageTable::new(0x00C0_0000); + PAGING.set_table(4, &table); PAGING.enable(); } diff --git a/kernel/src/memory/mod.rs b/kernel/src/memory/mod.rs new file mode 100644 index 0000000..4deaa92 --- /dev/null +++ b/kernel/src/memory/mod.rs @@ -0,0 +1 @@ +pub mod paging; \ No newline at end of file diff --git a/kernel/src/paging.rs b/kernel/src/memory/paging.rs similarity index 100% rename from kernel/src/paging.rs rename to kernel/src/memory/paging.rs diff --git a/kernel/src/multitasking/mod.rs b/kernel/src/multitasking/mod.rs new file mode 100644 index 0000000..2f2b628 --- /dev/null +++ b/kernel/src/multitasking/mod.rs @@ -0,0 +1 @@ +pub mod task; \ No newline at end of file diff --git a/kernel/src/task.rs b/kernel/src/multitasking/task.rs similarity index 100% rename from kernel/src/task.rs rename to kernel/src/multitasking/task.rs diff --git a/kernel/src/shell/mod.rs b/kernel/src/shell/mod.rs new file mode 100644 index 0000000..6e52c7b --- /dev/null +++ b/kernel/src/shell/mod.rs @@ -0,0 +1 @@ +pub mod shell; \ No newline at end of file diff --git a/kernel/src/shell.rs b/kernel/src/shell/shell.rs similarity index 98% rename from kernel/src/shell.rs rename to kernel/src/shell/shell.rs index d2d027e..472cd2f 100644 --- a/kernel/src/shell.rs +++ b/kernel/src/shell/shell.rs @@ -2,8 +2,8 @@ use crate::filesystem::fat::FAT; use crate::syscalls::print::PRINTER; -use crate::task::Task; -use crate::task::TASK_MANAGER; +use crate::multitasking::task::Task; +use crate::multitasking::task::TASK_MANAGER; const APP_TARGET: u32 = 0x0050_0000; const APP_SIGNATURE: u32 = 0xB16B00B5; diff --git a/kernel/src/syscalls/handler.rs b/kernel/src/syscalls/handler.rs index f8a5c52..45d9eab 100644 --- a/kernel/src/syscalls/handler.rs +++ b/kernel/src/syscalls/handler.rs @@ -2,7 +2,7 @@ use crate::drivers::pic::PICS; use crate::syscalls::print; -use crate::task::TASK_MANAGER; +use crate::multitasking::task::TASK_MANAGER; use core::arch::asm; use core::slice;