Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgian committed Jun 24, 2023
1 parent e0d425e commit 1e44ea2
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion kernel/src/drivers/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions kernel/src/interrupts/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 8 additions & 6 deletions kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
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;
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;

Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions kernel/src/memory/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod paging;
File renamed without changes.
1 change: 1 addition & 0 deletions kernel/src/multitasking/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod task;
File renamed without changes.
1 change: 1 addition & 0 deletions kernel/src/shell/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod shell;
4 changes: 2 additions & 2 deletions kernel/src/shell.rs → kernel/src/shell/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/syscalls/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1e44ea2

Please sign in to comment.