1
0
Fork 0
forked from koniifer/ableos

get ableOS running proper on limine sans graphics

This commit is contained in:
Able 2022-11-23 05:06:38 -06:00
parent 6e20d33817
commit 1e1d004240
6 changed files with 13 additions and 8 deletions

4
Cargo.lock generated
View file

@ -344,9 +344,9 @@ source = "git+https://git.ablecorp.us/able/libwasm.git#4ffcd290f8bc918ca4adf5e23
[[package]] [[package]]
name = "limine" name = "limine"
version = "0.1.8" version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eac64618e505bab2387986e5b1014f5d344130d609685bbd8b71a10af3ee599d" checksum = "c847ac148a0c53ba3755dfa9830722b1043179584009869e6afc2b413e13f105"
[[package]] [[package]]
name = "linked_list_allocator" name = "linked_list_allocator"

View file

@ -108,7 +108,8 @@ git = "https://git.ablecorp.us:443/able/externc-libm.git"
riscv = "*" riscv = "*"
[target.'cfg(target_arch = "x86_64")'.dependencies] [target.'cfg(target_arch = "x86_64")'.dependencies]
limine = "0.1" limine = "0.1.9"
cpuio = { git = "https://git.ablecorp.us/ondra05/cpuio.git" } cpuio = { git = "https://git.ablecorp.us/ondra05/cpuio.git" }
pic8259 = "0.10.1" pic8259 = "0.10.1"
uart_16550 = "0.2.0" uart_16550 = "0.2.0"

View file

@ -1,8 +1,7 @@
use limine::{LimineMemmapResponse, LimineMemoryMapEntryType}; use limine::{LimineMemmapResponse, LimineMemoryMapEntryType};
use x86_64::{ use x86_64::{
structures::paging::{ structures::paging::{
FrameAllocator, FrameDeallocator, OffsetPageTable, PageTable, PhysFrame, FrameAllocator, FrameDeallocator, OffsetPageTable, PageTable, PhysFrame, Size4KiB,
Size4KiB,
}, },
PhysAddr, VirtAddr, PhysAddr, VirtAddr,
}; };
@ -39,7 +38,9 @@ impl BootInfoFrameAllocator {
} }
fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> { fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> {
self.memory_map.mmap().unwrap().iter() self.memory_map
.memmap()
.iter()
.filter(|r| r.typ == LimineMemoryMapEntryType::Usable) .filter(|r| r.typ == LimineMemoryMapEntryType::Usable)
.map(|r| r.base..r.base + r.len) .map(|r| r.base..r.base + r.len)
.flat_map(|r| r.step_by(4096)) .flat_map(|r| r.step_by(4096))

View file

@ -18,7 +18,7 @@ use crate::serial_println;
use self::drivers::allocator; use self::drivers::allocator;
static HHDM: LimineHhdmRequest = LimineHhdmRequest::new(0); static HHDM: LimineHhdmRequest = LimineHhdmRequest::new(0);
static MMAP: LimineMmapRequest = LimineMmapRequest::new(0); static MMAP: LimineMemmapRequest = LimineMemmapRequest::new(0);
#[no_mangle] #[no_mangle]
pub fn x86_64_start() -> ! { pub fn x86_64_start() -> ! {

View file

@ -5,7 +5,6 @@
*/ */
#![allow(clippy::empty_loop)] #![allow(clippy::empty_loop)]
use core::sync::atomic::AtomicU64; use core::sync::atomic::AtomicU64;
use crate::arch::memory::BootInfoFrameAllocator; use crate::arch::memory::BootInfoFrameAllocator;
@ -16,6 +15,7 @@ use crate::{boot_conf::KernelConfig, scratchpad, systeminfo::RELEASE_TYPE};
// use crate::{boot_conf::KernelConfig, scratchpad, systeminfo::RELEASE_TYPE, TERM}; // use crate::{boot_conf::KernelConfig, scratchpad, systeminfo::RELEASE_TYPE, TERM};
use crate::{filesystem, hardware}; use crate::{filesystem, hardware};
use kernel::KERNEL_VERSION; use kernel::KERNEL_VERSION;
use limine::LimineTerminalRequest;
use spin::Lazy; use spin::Lazy;
// FIXME: platform agnostic paging stuff // FIXME: platform agnostic paging stuff
@ -24,6 +24,7 @@ use x86_64::structures::paging::{Mapper, Size4KiB};
// TODO: Change this structure to allow for multiple cores loaded // TODO: Change this structure to allow for multiple cores loaded
pub static KERNEL_CONF: Lazy<KernelConfig> = Lazy::new(KernelConfig::new); pub static KERNEL_CONF: Lazy<KernelConfig> = Lazy::new(KernelConfig::new);
static TERMINAL_REQUEST: LimineTerminalRequest = LimineTerminalRequest::new(0);
/// The main entry point of the kernel /// The main entry point of the kernel
pub fn kernel_main( pub fn kernel_main(
mut mapper: impl Mapper<Size4KiB>, mut mapper: impl Mapper<Size4KiB>,
@ -31,6 +32,7 @@ pub fn kernel_main(
) -> ! { ) -> ! {
init::init(); init::init();
// panic!();
// /* // /*
if KERNEL_CONF.logging.enabled { if KERNEL_CONF.logging.enabled {
log::set_max_level(KERNEL_CONF.log_level()); log::set_max_level(KERNEL_CONF.log_level());

View file

@ -22,6 +22,7 @@
#![feature(custom_test_frameworks)] #![feature(custom_test_frameworks)]
#![reexport_test_harness_main = "test_main"] #![reexport_test_harness_main = "test_main"]
#![test_runner(crate::test_runner)] #![test_runner(crate::test_runner)]
// #![feature(llvm_asm)]
#[macro_use] #[macro_use]
pub extern crate log; pub extern crate log;