I'm getting Triple Fault when trying to get Low Memory Map described in this wiki post on OSDev.
The section describe the code in assembler, but I wrote it in GCC asm inline, like this:
Code: Select all
// Top of the file
__asm__(".code16gcc\n");
[...]
uint16_t __noinline SMAP_DetectLowMemory(void)
{
uint16_t mem = 0;
asm volatile
(
"clc\n\t"
"int $0x12"
: "=a"(mem)
);
return mem;
}
When I compile it, linked to my kernel and called it on kernel_main(), my system enter in triple fault. I dump the cpu_reset on qemu, but I'm begginer and I'm not realy sure how to read the dump and get on the root of the problem.
Here is the dump generated by qemu with the "-d cpu_reset" option.
P.D: I boot my system with -kernel option in qemu
How can I handle this? And how can I better read the dump?
ENV:
i686-elf-gcc 8.2.0
i686-elf-as 2.31.1
i686-elf-ld 2.31.1
qemu-system-i386 3.1.0