Re: vga programming question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I did a little more playing around, and found out that using this method 
doesn't worked in x86 protected mode. I can't stick code in before I switch 
to protected mode and it works. Any clues on doing vga programming in 
protected mode. I know it uses the 6845 chip for this, but can't seem to find 
any sample code.


On Friday 27 September 2002 9:57 am, John Tyner wrote:
> I can't speak to that what you're doing is actually correct, however
> because you make three separate asm calls, it is possible that the
> compiler is doing something strange in between. You should use:
>
> asm volatile (
> 	"movb $0x00, %ah\n"
> 	"movb $0x13, %al\n"
> 	"int $0x10\n"
> );
>
> Also note that you are destroying the current value in the ax register
> without telling the compiler. Check out http://www.linuxassembly.org/ for
> more information about inline assembly.
>
> On Fri, 27 Sep 2002, Tom Bradley wrote:
> > I am trying to do a simple vga(320x200x256) driver but am having troubles
> > switching the video mode. I am using:
> > 	      asm volatile("movb $0x00, %ah;");
> > 	      asm volatile("movb $0x13, %al;");
> > 	      asm volatile("int $0x10;");
> > which several websites and books are saying is all that is needed to
> > switch modes. However this locks up my machine. What am I doing wrong?
> >
> >
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux