Skip to content

The ACPI parser causes the OS to panic and die #26

@see-sharp265

Description

@see-sharp265

The project outputs this when run:
` _____ _ _ _ Developed by:
/ | | | | | () - Vinc
| (
___ | || | _ ___ ___ - Crally
_
\ / _ | / | | |/ / _ \ - Mehodin
) | () | _ \ || | (| / - Alex8675
|
/ _
/||
/_|_|__|

[DEBUG] gdt: loaded
[DEBUG] idt: loaded
[DEBUG] pmm: initialised
[DEBUG] acpi: found tables
[ERROR] panicked at 'not yet implemented', /home/[REDACTED]/.cargo/registry/src/github.com-[REDACTED]/aml_parser-0.3.0/src/name_object.rs:79:28`

The offending bit of code seems to be `
pub fn name_string<'a, 'c>() -> impl Parser<'a, 'c, AmlName>
where
'c: 'a,
{
/*
* NameString := <RootChar('') NamePath> |
* PrefixPath := Nothing | <'^' PrefixPath>
*/
let root_name_string = opcode(ROOT_CHAR).then(name_path()).map(|((), ref name_path)| {
let mut name = alloc::vec![NameComponent::Root];
name.extend_from_slice(name_path);
Ok(AmlName(name))
});

// TODO: combinator to select a parser based on a peeked byte?
comment_scope_verbose("NameString", move |input: &'a [u8], context| {
    let first_char = match input.first() {
        Some(&c) => c,
        None => return Err((input, context, AmlError::UnexpectedEndOfStream)),
    };

    // TODO: parse <PrefixPath NamePath> where there are actually PrefixChars
    match first_char {
        ROOT_CHAR => root_name_string.parse(input, context),
        PREFIX_CHAR => unimplemented!(),
        _ => name_path().map(|path| Ok(AmlName(path))).parse(input, context),
    }
})

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions