Problem with plotting pixels
Problem with plotting pixels
I am making a small 'kernel' in C. I compile the c file as a binary and it loads just fine with my pmode bootloader. When i try to write color data to 0xA0000 (which ppl tell me is the video memory) my computer re-boots! whats up with that?
RE:Problem with plotting pixels
0xA0000 is video memory considering your current data segment descriptor has a base of 0, and a limit above 0xAFFFFF.
What's your code look like?
And are you sure pmode is setup correctly?
Jeff
What's your code look like?
And are you sure pmode is setup correctly?
Jeff
RE:Problem with plotting pixels
typedef unsigned char byte;
byte *VGA = (byte *)0xA0000;
short offset;
offset = 320*10 + 10;
video[offset]=7;
byte *VGA = (byte *)0xA0000;
short offset;
offset = 320*10 + 10;
video[offset]=7;
RE:Problem with plotting pixels
I hope you've switched to a graphicsmode that has A0000 as a base address.
Otherwise if you've plain text then it will be B8000 and no pixels.
this code is wrong though
video[offset]=7 should be VGA[offset]=7
Otherwise if you've plain text then it will be B8000 and no pixels.
this code is wrong though
video[offset]=7 should be VGA[offset]=7
RE:Problem with plotting pixels
The easyest way, is to switch to it while in real mode(mov ax,00xx; int 0x10, where xx is the mode:
bit 7 is set to clear the screen, others 0x12 that is 640x480 4 bit). It is a pain(you'l need to program
the graphical chip set like ega,vga or S3) to do it in pmode.
bit 7 is set to clear the screen, others 0x12 that is 640x480 4 bit). It is a pain(you'l need to program
the graphical chip set like ega,vga or S3) to do it in pmode.