// Copyright (c) 2025 shibedrill // SPDX-License-Identifier: GPL-3.0-or-later #![allow(unused_imports)] use enumflags2::*; use core::alloc::{Allocator, Layout}; use talc::*; pub extern crate alloc; static mut ARENA: [u8; 10000] = [0; 10000]; #[global_allocator] static ALLOCATOR: Talck, ClaimOnOom> = Talc::new(unsafe { // if we're in a hosted environment, the Rust runtime may allocate before // main() is called, so we need to initialize the arena automatically ClaimOnOom::new(Span::from_array(core::ptr::addr_of!(ARENA).cast_mut())) }) .lock(); #[allow(dead_code)] pub struct MemoryRegion { start_address: usize, end_address: usize, flags: BitFlags, } impl MemoryRegion { // TODO: Memory allocation and virtual addressing #[allow(unused_variables)] pub fn new(flags: BitFlags) -> Self { todo!() } } #[bitflags] #[repr(u8)] #[derive(Clone, Copy)] pub enum MemoryRegionFlags { Readable, Writable, Executable, }