forked from koniifer/ableos
Work done on adding board support packages
This commit is contained in:
parent
bcc6a10763
commit
40f55d922d
|
@ -1,7 +1,4 @@
|
|||
use alloc::alloc::{GlobalAlloc, Layout};
|
||||
|
||||
mod aalloc;
|
||||
// use dummy::Dummy;
|
||||
|
||||
pub const HEAP_START: usize = 0x_4444_4444_0000;
|
||||
/// 131072 bytes
|
||||
|
|
64
ableos/src/arch/riscv/boards/virt/virt.lds
Normal file
64
ableos/src/arch/riscv/boards/virt/virt.lds
Normal file
|
@ -0,0 +1,64 @@
|
|||
OUTPUT_ARCH(riscv64gc)
|
||||
|
||||
ENTRY(_boot);
|
||||
|
||||
|
||||
SECTIONS {
|
||||
. = 0x80200000;
|
||||
.text : {
|
||||
PROVIDE(__text_start = .);
|
||||
PROVIDE(KERNEL_START = .);
|
||||
*(.init.boot)
|
||||
*(.init.rust)
|
||||
*(.text .text.*)
|
||||
. = ALIGN(4K);
|
||||
PROVIDE(__text_end = .);
|
||||
}
|
||||
|
||||
.data : {
|
||||
PROVIDE(__data_start = .);
|
||||
*(.data .data.* .rodata .rodata.*)
|
||||
. = ALIGN(8);
|
||||
PROVIDE(__tmp_stack_bottom = .);
|
||||
. += 1024 * 1024 * 4;
|
||||
PROVIDE(__tmp_stack_top = .);
|
||||
. += 4096;
|
||||
PROVIDE(__scratch_stack = .);
|
||||
. = ALIGN(8);
|
||||
}
|
||||
|
||||
. = ALIGN(8);
|
||||
|
||||
.sdata : {
|
||||
PROVIDE(__global_pointer$ = .);
|
||||
*(.sdata .sdata.*)
|
||||
. = ALIGN(4K);
|
||||
PROVIDE(__data_end = .);
|
||||
}
|
||||
|
||||
PROVIDE(__bss_start = .);
|
||||
.sbss : {
|
||||
*(.sbss .sbss.*);
|
||||
}
|
||||
|
||||
.bss : {
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
. = ALIGN(4K);
|
||||
PROVIDE(__bss_end = .);
|
||||
|
||||
.tdata : {
|
||||
. = ALIGN(4K);
|
||||
PROVIDE(__tdata_start = .);
|
||||
|
||||
*(.tdata .tdata.*)
|
||||
|
||||
. = ALIGN(4K);
|
||||
PROVIDE(__tdata_end = .);
|
||||
}
|
||||
|
||||
. = ALIGN(2M);
|
||||
PROVIDE(KERNEL_END = .);
|
||||
|
||||
/DISCARD/ : { *(.eh_frame_hdr .eh_frame) }
|
||||
}
|
|
@ -8,8 +8,6 @@ pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8;
|
|||
pub static PICS: spin::Mutex<ChainedPics> =
|
||||
spin::Mutex::new(unsafe { ChainedPics::new(PIC_1_OFFSET, PIC_2_OFFSET) });
|
||||
|
||||
use crate::arch::sloop;
|
||||
use x86_64::structures::idt::PageFaultErrorCode;
|
||||
/// Interrupt offsets.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[repr(u8)]
|
||||
|
@ -99,6 +97,8 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
|
|||
.notify_end_of_interrupt(InterruptIndex::Keyboard.as_u8());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
extern "x86-interrupt" fn page_fault_handler(
|
||||
stack_frame: InterruptStackFrame,
|
||||
error_code: PageFaultErrorCode,
|
||||
|
@ -110,3 +110,4 @@ extern "x86-interrupt" fn page_fault_handler(
|
|||
println!["{:#?}", stack_frame];
|
||||
sloop();
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
driver_traits::graphics::Graphics,
|
||||
experiments::systeminfo::{KERNEL_VERSION, RELEASE_TYPE},
|
||||
keyboard::DecodedKey,
|
||||
relib::math::rand::{RAND_HANDLE, RNG},
|
||||
relib::math::rand::RAND_HANDLE,
|
||||
};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
|
|
|
@ -36,4 +36,6 @@ pub mod kmain;
|
|||
pub mod log;
|
||||
pub mod panic;
|
||||
pub mod relib;
|
||||
pub mod wasm;
|
||||
|
||||
extern crate alloc;
|
||||
|
|
|
@ -6,23 +6,11 @@ pub trait Log {
|
|||
}
|
||||
|
||||
use crate::serial_print;
|
||||
use lliw::{Bg, Fg, Reset, Style};
|
||||
use lliw::{Fg, Reset};
|
||||
pub struct ANSISerialLogger;
|
||||
impl Log for ANSISerialLogger {
|
||||
fn debug() {
|
||||
// serial_print!("[{}Debug{}]",);
|
||||
|
||||
serial_print!(
|
||||
"{}{}Attention!{}{} You have {}{}1{}{} new message",
|
||||
Style::Underline,
|
||||
Fg::Yellow,
|
||||
Style::NoUnderline,
|
||||
Fg::Reset,
|
||||
Bg::White,
|
||||
Fg::Black,
|
||||
Bg::Reset,
|
||||
Fg::Reset,
|
||||
);
|
||||
serial_print!("[{}Debug{}]", Fg::Blue, Reset);
|
||||
|
||||
todo!();
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
|
Loading…
Reference in a new issue