Page 1 of 1

graphics mode?

Posted: Mon Sep 30, 2002 4:57 pm
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?

Re:graphics mode?

Posted: Mon Sep 30, 2002 5:28 pm
by Tom
GCC is 32-bit PMode...so no ints ;)

set graphics mode 13h before you enter PMode

Re:graphics mode?

Posted: Tue Oct 01, 2002 1:52 am
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.