From a2d6d7245ac83c51cff74a81f5663019c8c9d28b Mon Sep 17 00:00:00 2001 From: Able Date: Wed, 23 Nov 2022 06:00:38 -0600 Subject: [PATCH] Revert "get ableOS running proper on limine sans graphics" This reverts commit 1e1d004240af6d2698a9a8628581f3ceb87bf478. --- Cargo.lock | 4 ++-- ableos/Cargo.toml | 3 +-- ableos/src/arch/x86_64/memory.rs | 7 +++---- ableos/src/arch/x86_64/mod.rs | 2 +- ableos/src/kmain.rs | 4 +--- ableos/src/lib.rs | 1 - 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0df11a..6a23161 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -344,9 +344,9 @@ source = "git+https://git.ablecorp.us/able/libwasm.git#4ffcd290f8bc918ca4adf5e23 [[package]] name = "limine" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c847ac148a0c53ba3755dfa9830722b1043179584009869e6afc2b413e13f105" +checksum = "eac64618e505bab2387986e5b1014f5d344130d609685bbd8b71a10af3ee599d" [[package]] name = "linked_list_allocator" diff --git a/ableos/Cargo.toml b/ableos/Cargo.toml index 70209a9..48ffc68 100644 --- a/ableos/Cargo.toml +++ b/ableos/Cargo.toml @@ -108,8 +108,7 @@ git = "https://git.ablecorp.us:443/able/externc-libm.git" riscv = "*" [target.'cfg(target_arch = "x86_64")'.dependencies] -limine = "0.1.9" - +limine = "0.1" cpuio = { git = "https://git.ablecorp.us/ondra05/cpuio.git" } pic8259 = "0.10.1" uart_16550 = "0.2.0" diff --git a/ableos/src/arch/x86_64/memory.rs b/ableos/src/arch/x86_64/memory.rs index d7d726e..c349404 100644 --- a/ableos/src/arch/x86_64/memory.rs +++ b/ableos/src/arch/x86_64/memory.rs @@ -1,7 +1,8 @@ use limine::{LimineMemmapResponse, LimineMemoryMapEntryType}; use x86_64::{ structures::paging::{ - FrameAllocator, FrameDeallocator, OffsetPageTable, PageTable, PhysFrame, Size4KiB, + FrameAllocator, FrameDeallocator, OffsetPageTable, PageTable, PhysFrame, + Size4KiB, }, PhysAddr, VirtAddr, }; @@ -38,9 +39,7 @@ impl BootInfoFrameAllocator { } fn usable_frames(&self) -> impl Iterator { - self.memory_map - .memmap() - .iter() + self.memory_map.mmap().unwrap().iter() .filter(|r| r.typ == LimineMemoryMapEntryType::Usable) .map(|r| r.base..r.base + r.len) .flat_map(|r| r.step_by(4096)) diff --git a/ableos/src/arch/x86_64/mod.rs b/ableos/src/arch/x86_64/mod.rs index bd4c427..b88e0e3 100644 --- a/ableos/src/arch/x86_64/mod.rs +++ b/ableos/src/arch/x86_64/mod.rs @@ -18,7 +18,7 @@ use crate::serial_println; use self::drivers::allocator; static HHDM: LimineHhdmRequest = LimineHhdmRequest::new(0); -static MMAP: LimineMemmapRequest = LimineMemmapRequest::new(0); +static MMAP: LimineMmapRequest = LimineMmapRequest::new(0); #[no_mangle] pub fn x86_64_start() -> ! { diff --git a/ableos/src/kmain.rs b/ableos/src/kmain.rs index 6c0012f..d88f59f 100644 --- a/ableos/src/kmain.rs +++ b/ableos/src/kmain.rs @@ -5,6 +5,7 @@ */ #![allow(clippy::empty_loop)] + use core::sync::atomic::AtomicU64; use crate::arch::memory::BootInfoFrameAllocator; @@ -15,7 +16,6 @@ use crate::{boot_conf::KernelConfig, scratchpad, systeminfo::RELEASE_TYPE}; // use crate::{boot_conf::KernelConfig, scratchpad, systeminfo::RELEASE_TYPE, TERM}; use crate::{filesystem, hardware}; use kernel::KERNEL_VERSION; -use limine::LimineTerminalRequest; use spin::Lazy; // FIXME: platform agnostic paging stuff @@ -24,7 +24,6 @@ use x86_64::structures::paging::{Mapper, Size4KiB}; // TODO: Change this structure to allow for multiple cores loaded pub static KERNEL_CONF: Lazy = Lazy::new(KernelConfig::new); -static TERMINAL_REQUEST: LimineTerminalRequest = LimineTerminalRequest::new(0); /// The main entry point of the kernel pub fn kernel_main( mut mapper: impl Mapper, @@ -32,7 +31,6 @@ pub fn kernel_main( ) -> ! { init::init(); - // panic!(); // /* if KERNEL_CONF.logging.enabled { log::set_max_level(KERNEL_CONF.log_level()); diff --git a/ableos/src/lib.rs b/ableos/src/lib.rs index 6e7b5ba..201ece8 100644 --- a/ableos/src/lib.rs +++ b/ableos/src/lib.rs @@ -22,7 +22,6 @@ #![feature(custom_test_frameworks)] #![reexport_test_harness_main = "test_main"] #![test_runner(crate::test_runner)] -// #![feature(llvm_asm)] #[macro_use] pub extern crate log;