Can't access memory using arrayindexing.
Posted: Mon Sep 12, 2016 6:53 pm
Hello dear osdev community,
I just started getting into OS development yesterday.
I managed to do some TextMode stuff and now I want to move on to Graphics programming.
I managed to switch to the 13h VGA draw mode, but now I am facing some problems:
I can't access the Graphicsmemory using arrayindexing(?). I need to use pointerarithmetic, if I want to edit a pixel, which is pretty slow.
Also, if I try to calculate any pixel offset, and cast it to an pointer, it won't work, too. It shows either no colored pixel, or heavily offset pixel locations. Accessing them using pointerarithmetic works fine tho.
Am I missing something basic?
PS:
Sorry for the bad english, I am no native speaker
I attached an image of my code.
I just started getting into OS development yesterday.
I managed to do some TextMode stuff and now I want to move on to Graphics programming.
I managed to switch to the 13h VGA draw mode, but now I am facing some problems:
I can't access the Graphicsmemory using arrayindexing(?). I need to use pointerarithmetic, if I want to edit a pixel, which is pretty slow.
Also, if I try to calculate any pixel offset, and cast it to an pointer, it won't work, too. It shows either no colored pixel, or heavily offset pixel locations. Accessing them using pointerarithmetic works fine tho.
Am I missing something basic?
PS:
Sorry for the bad english, I am no native speaker
I attached an image of my code.