Problems withing printing text (PMODE)

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
ash_wales

Problems withing printing text (PMODE)

Post by ash_wales »

Hi :)

Well basically, if I make a the video memory variable global (0xb8000) It wont print anything to the screen, whereas, If I put the variable inside the function that has to be printed, it works fine. Any idea? or any other info needed?

Heres the Print Function:

Code: Select all


void k_clear() // clear the entire text screen
{
   char *vidmem = (char *)0xb8000;
   unsigned int i=0;
   while(i < (80*25*2))
   {
      vidmem[i]=' ';
      i++;
      vidmem[i]=0x07;
      i++;
   };
};

Used from the barebones tutorial. Thanks.
Warrior

Re:Problems withing printing text (PMODE)

Post by Warrior »

Try using #define
ash_wales

Re:Problems withing printing text (PMODE)

Post by ash_wales »

I think that the problem may lie in that im running gentoo64..., therefor assembling and compiling for the 64bit archtiecture an creating 64bit elf files. Gotta try and sort that out..
omin0us

Re:Problems withing printing text (PMODE)

Post by omin0us »

if you are compiling with gcc, then maybe try using the -m32 switch to compile it as 32bit code.
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:Problems withing printing text (PMODE)

Post by Pype.Clicker »

that looks like a "missing data section" issue, too.
Post Reply