Compare commits
5 Commits
36cb118933
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 72fe78cbc6 | |||
| f9bc75c4f3 | |||
| 494d00c53b | |||
| 114c70ffe9 | |||
| 361c67764d |
@@ -1,4 +1,8 @@
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull-request:
|
||||
branches: [ main ]
|
||||
|
||||
name: Continuous integration
|
||||
|
||||
|
||||
Generated
+22
@@ -57,6 +57,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "lib_alloc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"linked_list_allocator",
|
||||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lib_application"
|
||||
@@ -101,6 +105,15 @@ dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linked_list_allocator"
|
||||
version = "0.10.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286"
|
||||
dependencies = [
|
||||
"spinning_top",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.12"
|
||||
@@ -153,6 +166,15 @@ dependencies = [
|
||||
"lock_api",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spinning_top"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "volatile"
|
||||
version = "0.4.6"
|
||||
|
||||
@@ -9,9 +9,6 @@ use x86_64::{
|
||||
PhysAddr, VirtAddr,
|
||||
};
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOCATOR: FoundryAllocator = FoundryAllocator;
|
||||
|
||||
/// Returns a mutable reference to the current level 4 page table.
|
||||
///
|
||||
/// # Safety
|
||||
|
||||
+25
-3
@@ -4,6 +4,7 @@
|
||||
extern crate alloc;
|
||||
|
||||
use core::arch::asm;
|
||||
use lib_alloc::allocator::init_heap;
|
||||
use limine::request::{RequestsEndMarker, RequestsStartMarker};
|
||||
use limine::BaseRevision;
|
||||
|
||||
@@ -58,16 +59,37 @@ pub fn boot() -> Result<(), &'static str> {
|
||||
use arch::x86_64::{gdt, interrupts, memmap, memory};
|
||||
|
||||
let memory_map = memmap::get_memory_map();
|
||||
|
||||
print_log!(" Initialising Serial... ");
|
||||
lib_serial::init()?;
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Setting Up Global Descriptor Table... ");
|
||||
gdt::init();
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Setting Up Interrupt Descriptor Table... ");
|
||||
interrupts::init_idt();
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Setting Up Page Table... ");
|
||||
let mut frame_allocator = unsafe { memory::FoundryOSFrameAllocator::init(memory_map) };
|
||||
println_log!("[Success]");
|
||||
|
||||
x86_64::instructions::interrupts::enable();
|
||||
|
||||
print_log!(" Initialising Memory Subsystem... ");
|
||||
let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET);
|
||||
let l4_table = unsafe { memory::init(physical_memory_offset) };
|
||||
let mut l4_table = unsafe { memory::init(physical_memory_offset) };
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Initialising Heap... ");
|
||||
if let Err(e) = init_heap(&mut l4_table, &mut frame_allocator) {
|
||||
return Err("Failed to initialise heap");
|
||||
}
|
||||
println_log!("[Success]");
|
||||
|
||||
print_log!(" Enabling Interrupts... ");
|
||||
x86_64::instructions::interrupts::enable();
|
||||
println_log!("[Success]");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
+7
-1
@@ -1,6 +1,10 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use foundry_os::{println, println_log};
|
||||
|
||||
#[no_mangle]
|
||||
@@ -8,11 +12,13 @@ unsafe extern "C" fn kmain() -> ! {
|
||||
// All limine requests must also be referenced in a called function, otherwise they may be
|
||||
// removed by the linker.
|
||||
|
||||
println_log!(" [ Initialising ] ");
|
||||
println_log!(" [ Initialising Kernel Systems ] ");
|
||||
if let Err(err) = foundry_os::boot() {
|
||||
panic!("{}", err);
|
||||
}
|
||||
|
||||
println_log!("[ Kernel Initialised Successfully ] ");
|
||||
|
||||
let dimensions = lib_ascii::screensize_chars();
|
||||
let dimensions2 = lib_framebuffer::screensize_px();
|
||||
|
||||
|
||||
+1
-1
Submodule lib/lib_alloc updated: 3aeb5d66c8...af814bf2ab
Reference in New Issue
Block a user