This problem is probably not entirely related to the development of the OS, but it is PROBABLY not a bug in the code.
I think my problem is related to some sort of misunderstanding when working with memory.
I get a pointer to a multiboot structure and pass it to a function that copies that pointer and then uses the address of the graphics buffer to draw on the screen.
In kernel.c is connected header.h, which has a pointer to multiboot information and a function that copies it and paints over the screen
kernel.c
Code: Select all
#include "kernel.h"
int main(unsigned long magic, multiboot_info_t* mbi)
{
(void)magic;
initMultibootInfo(mbi);
}
Code: Select all
multiboot_info_t* MBI;
void initMultibootInfo(multiboot_info_t* mbiTemp)
{
MBI = mbiTemp;
volatile uint32_t *fb = (uint32_t *)((uint32_t) MBI->framebuffer_addr);
uint32_t cell;
for (cell = 0; cell < MBI->framebuffer_width * MBI->framebuffer_height; cell++)
fb[cell] = 0x00FE01AC;
}
And if I use mbiTemp - everything works.
It turns out because of a simple copy of the pointer-nothing works.