Bootable kernel skeleton
This commit is contained in:
parent
8f4aff05d5
commit
d5902c5a20
4 changed files with 1702 additions and 3 deletions
4
src/arch/mod.rs
Normal file
4
src/arch/mod.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
//! Architecture specific items
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub mod x86_64;
|
||||
8
src/arch/x86_64/irq.rs
Normal file
8
src/arch/x86_64/irq.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
//! # IRQ handling
|
||||
//! This module defines IRQ handling functions. These functions should all be #[naked],
|
||||
//! unsafe, extern, and end in `iretq`
|
||||
|
||||
#[naked]
|
||||
pub unsafe extern fn irq() {
|
||||
|
||||
}
|
||||
11
src/arch/x86_64/main.rs
Normal file
11
src/arch/x86_64/main.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/// This function is where the kernel sets up IRQ handlers
|
||||
/// It is increcibly unsafe, and should be minimal in nature
|
||||
/// It must create the IDT with the correct entries, those entries are
|
||||
/// defined in other files inside of the `arch` module
|
||||
#[naked]
|
||||
#[no_mangle]
|
||||
pub unsafe extern fn kmain() {
|
||||
asm!("xchg bx, bx" : : : : "intel", "volatile");
|
||||
|
||||
loop{}
|
||||
}
|
||||
5
src/arch/x86_64/mod.rs
Normal file
5
src/arch/x86_64/mod.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
/// IRQ Handling
|
||||
pub mod irq;
|
||||
|
||||
/// Initialization and main function
|
||||
pub mod main;
|
||||
Loading…
Reference in a new issue