I just managed to get the jump to the 64-bit kernel to work, using a separate loader.
When I first managed to do that, I noticed that the prints aren't working anymore. After thinking about it for a bit, I realized that the VGA frame buffer address (0xb8000) which I assigned to a pointer inside the 32-bit loader for printing, is a physical address, however, after I enabled paging, every address is being recognized as a virtual one.
Given that, I thought I was simply missing a mapping entry for the VGA frame buffer, so I did the following:
Code: Select all
#define VGA_TEXT_BUFFER_ADDRESS_X86 0xb8000
#define VGA_TEXT_BUFFER_ADDRESS_X86_64 0xffffffff802b8000
#if defined(__i386__)
#define VGA_TEXT_BUFFER_ADDRESS VGA_TEXT_BUFFER_ADDRESS_X86
#endif
#if defined(__x86_64__)
#define VGA_TEXT_BUFFER_ADDRESS VGA_TEXT_BUFFER_ADDRESS_X86_64
#endif
Code: Select all
memmap(MAP_MODE_PT, VGA_TEXT_BUFFER_ADDRESS_X86_64,
VGA_TEXT_BUFFER_ADDRESS_X86, (X86_64_PTE_FLAG_PRESENT | X86_64_PTE_FLAG_READ_WRITE), 0x1000);
When checking if the mapping was successful, the linear memdump for 0xffffffff802b8000 in Bochs displayed the contents of the frame buffer correctly, so I thought it should definitely work now, but it doesn't.
Am I missing something important here?