hi, i've been having fun writing a little OS and bootloader in assembly, and i'm testing it on my laptop, a Lenovo IdeaPad S540-14API (AMD Ryzen 7 3700U). i've just recently been using int 15h/ax=E820h to generate a memory map in my bootloader. i used the code on
this article and it works as expected on QEMU, but i noticed that when i run it on my laptop, it's setting the interrupt flag.
my bootloader has a
Code:
cli
instruction right at the start, so that i can get through the boot process and set up a protected mode IDT, and only then re-enable interrupts. after adding the E820 interrupt, i noticed that my laptop (but not QEMU) was now crashing very soon after i entered protected mode; i eventually tracked it down as the PIT sending an interrupt (which frustratingly looked like a double fault until i remembered IRQs exist) that i wasn't handling as i only set up my IDT's interrupt handlers after i've already entered protected mode. anyway, i confirmed that it was E820 specifically that was setting the interrupt flag by printing FLAGS' value immediately before and after running the interrupt.
as far as i can tell this shouldn't be happening, right? of course an easy solution is to just tack another
Code:
cli
onto the end of my
Code:
generate_memory_map
subroutine, but i'm wondering what the actual cause of this is. i haven't been able to find any info about other people experiencing this issue, nor is it mentioned on the wiki. is it really just specific to my laptop's BIOS? its BIOS version is
Code:
AGCN25WW(V1.08)
in case this means something to anyone.