Once I am in main, I try to write a pixel to screen using (pmode --this does not work):
Code: Select all
char *vga = (char *) 0xA0000;
unsigned int i = (320*200);
char *buffer = (char *) kmalloc(320*200);
buffer[(1<<8) + (1<<6) + 1] = 0x00;
memcpy(vga, buffer, i); //draw one pixel
Code: Select all
;Change the video mode to 13h
xor ah, ah ;VIDEO Function 00h: Change screen
mov al, 13h ;Put the desired graphics mode into AL
int 10h ;Call VIDEO
;Prepare for writing to the video buffer
mov di, 0a000h ;Put the video segment into DI
mov es, di ; so it can easily be put into ES
xor di, di ;Start writing at coordinates (0,0)
;draw a vertical line
mov ax, 320 ; Prepare for the multiplication
mov di, ax ; Put it into the pointer of the offset in ES
add di, 320*187 ; x position
mov al, 0x1A ; Put the color to be written to the screen in AL
mov cx, 320*1 ; Prepare for the loop
loopg:
stosb ; Write it to the screen!
loop loopg ; loop till done