I've been trying to build the Malloy examples up to chapter 10 with modern gcc and to get GitHub actions working for it. I have a repo here, which uses the Malloy code without any changes, and compiles on both linux and OS x if I use the gcc11 standard.
However, when I start it, somewhere in "initialise_paging();" it seem to crash with:
"unhandled interrupt: 0x6", which I think is a QEMU message.
0x6, I think, is an "invalid opcode" and there is inline assembler called initialise_paging(). For example in paging.c
https://github.com/teverett/JamesMolloy ... c/paging.c
Code: Select all
void switch_page_directory(page_directory_t *dir)
{
current_directory = dir;
asm volatile("mov %0, %%cr3":: "r"(dir->physicalAddr));
u32int cr0;
asm volatile("mov %%cr0, %0": "=r"(cr0));
cr0 |= 0x80000000; // Enable paging!
asm volatile("mov %0, %%cr0":: "r"(cr0));
}
Code: Select all
void page_fault(registers_t *regs)
{
// A page fault has occurred.
// The faulting address is stored in the CR2 register.
u32int faulting_address;
asm volatile("mov %%cr2, %0" : "=r" (faulting_address));
https://wiki.osdev.org/James_Molloy%27s ... th_GCC_4.8
Has anyone else run into this issue with "invalid opcode"?