See here
helpers::setup::get_gop(),
)));
let rsdp = helpers::setup::get_rsdp();
let mut explosion = Box::new(sulphur_dioxide::BootInfo::new(
symbols.leak(),
sulphur_dioxide::boot_attrs::BootSettings {
verbose: cfg!(debug_assertions),
},
Some(fbinfo),
rsdp,
));
let modules = vec![sulphur_dioxide::module::Module::Audio(
sulphur_dioxide::module::ModInnerData {
name: core::str::from_utf8(helpers::phys_to_kern_slice_ref(b"testaudio")).unwrap(),
data: helpers::phys_to_kern_slice_ref(mod_buffer),
},
)];
trace!("{:#X?}", explosion.as_ref() as *const _);
if I uncomment the commented lines in that asm statement, the kernel behaves weirdly
e.g. throws invalid opcode errors or page faults.
The kernel allocates 4KiB of memory for the stack; see here:
alloc_error_handler,
allocator_api,
const_size_of_val,
panic_info_message,
naked_functions,
const_mut_refs,
sync_unsafe_cell
)]
extern crate alloc;
use alloc::{borrow::ToOwned, boxed::Box, vec::Vec};
use core::arch::asm;
use log::{debug, info};
use crate::{
driver::acpi::{apic::LocalAPIC, ACPIPlatform},
sys::{
gdt::{PrivilegeLevel, SegmentSelector},
pmm::BitmapAllocator,
Turns out, the issue was the stack being too small. I guess 4KiB is not enough for rust, set it to 2MiB and now everything works properly.
This thread shall be closed
1 Like
system
Closed
February 14, 2022, 7:29pm
3
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.