graphics mode?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gtsphere

graphics mode?

Post by gtsphere »

i'm trying to initalize graphics mode in my kernel, but it resets my machine. any ideas why? this is what i'm using:

; Set graphics mode 13h
   mov ax, 13h
   int 10h

but, i would also prefer C but i can't figure out how to port it to GCC

void graphicsmode()
{
asm("mov 0x13, %%ax "::);
asm("int 0x10 "::);
}

?? is that correct i get an error saying:
c:/djgpp/tmp/ccOK7Jyt.s: Assembler messages:
c:/djgpp/tmp/ccOK7Jyt.s:375: Error: suffix or operands invalid for `int'
c:/djgpp/tmp/ccOK7Jyt.s:545: Error: suffix or operands invalid for `int'


any ideas?
Tom

Re:graphics mode?

Post by Tom »

GCC is 32-bit PMode...so no ints ;)

set graphics mode 13h before you enter PMode
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:graphics mode?

Post by Pype.Clicker »

by the by, i think that
movw 0x13, %ax
is the AT&T syntax for
mov ax,[0x13]

you should try
movw $0x13, %ax

...
or write Intel syntax and use nasm/objdump to see the equivalent AT&T code.
Post Reply