- updated to-dos
- removed unnecessary debugging code - moved x86_64-kernel.json to the project root
This commit is contained in:
@@ -8,7 +8,6 @@ use x86_64::structures::paging::{FrameAllocator, Mapper, Page, PageTableFlags, S
|
||||
|
||||
use spin::{Lazy, Mutex};
|
||||
|
||||
use super::apic::enable_apic;
|
||||
use super::gdt;
|
||||
|
||||
static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
|
||||
@@ -92,7 +91,7 @@ extern "x86-interrupt" fn double_fault_handler(
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) {
|
||||
use pc_keyboard::{HandleControl, Keyboard, ScancodeSet1, layouts};
|
||||
use pc_keyboard::{layouts, HandleControl, Keyboard, ScancodeSet1};
|
||||
// use pc_keyboard::DecodedKey;
|
||||
use spin::Mutex;
|
||||
use x86_64::instructions::port::Port;
|
||||
@@ -125,13 +124,13 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFr
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn page_fault_handler(
|
||||
stack_frame: InterruptStackFrame,
|
||||
error_code: PageFaultErrorCode,
|
||||
_stack_frame: InterruptStackFrame,
|
||||
_error_code: PageFaultErrorCode,
|
||||
) {
|
||||
// serial_println!("Exception: Page Fault");
|
||||
// serial_println!("Accessed Address: {:?}", Cr2::read());
|
||||
// serial_println!("Error Code: {:?}", error_code);
|
||||
// serial_println!("{:#?}", stack_frame);
|
||||
// serial_println!("{:#?}", _stack_frame);
|
||||
|
||||
if let Some(frame_allocator) = FRAME_ALLOCATOR.get() {
|
||||
let mut f = frame_allocator.lock();
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ pub fn boot() -> Result<(), &'static str> {
|
||||
|
||||
print_log!(" Initialising Memory Subsystem... ");
|
||||
let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET);
|
||||
let mut l4_table = memory::init_page_table(physical_memory_offset);
|
||||
memory::init_page_table(physical_memory_offset);
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Setting Up Page Table... ");
|
||||
|
||||
+2
-16
@@ -28,23 +28,9 @@ extern "C" fn kmain() -> ! {
|
||||
println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1);
|
||||
println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1);
|
||||
|
||||
let vector = vec![0; 100];
|
||||
println!("vec 100 works");
|
||||
let vector2 = vec![0; 1000];
|
||||
println!("vec 1000 works");
|
||||
let vector3 = vec![0; 10000];
|
||||
println!("vec 10000 works");
|
||||
let vector4 = vec![vec![Colour::Black; 1000]; 1000];
|
||||
println!("vec 100000 works");
|
||||
|
||||
let mut executor = Executor::new();
|
||||
|
||||
let mut v = Vec::with_capacity(1000 * 1000);
|
||||
for i in 0..1000 * 1000 {
|
||||
v.push(i);
|
||||
}
|
||||
println!("v.len(): {}", v.len());
|
||||
|
||||
executor.spawn(Task::new(shell()));
|
||||
executor.run();
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"llvm-target": "x86_64-unknown-none",
|
||||
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
|
||||
"arch": "x86_64",
|
||||
"target-endian": "little",
|
||||
"target-pointer-width": "64",
|
||||
"target-c-int-width": "32",
|
||||
"os": "none",
|
||||
"executables": true,
|
||||
"linker-flavor": "ld.lld",
|
||||
"linker": "rust-lld",
|
||||
"panic-strategy": "abort",
|
||||
"disable-redzone": true,
|
||||
"features": "-mmx,-sse,+soft-float",
|
||||
"rustc-abi": "x86-softfloat",
|
||||
"relocation-model": "static",
|
||||
"code-model": "kernel",
|
||||
"pre-link-args": {
|
||||
"ld.lld": [
|
||||
"--script=kernel/linker.ld",
|
||||
"-nostdlib",
|
||||
"--no-dynamic-linker",
|
||||
"-static",
|
||||
"--no-pie",
|
||||
"--gc-sections",
|
||||
"--build-id=none",
|
||||
"-z",
|
||||
"max-page-size=0x1000"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user