How to do basic thing in pm

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
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

How to do basic thing in pm

Post by codemastersnake »

hi all!

my question is that how can one do some basic things like scrolling the screen up and moving cursor pos in text mode without access to bios interrupts...
Osbios
Member
Member
Posts: 116
Joined: Fri Jun 10, 2005 11:00 pm

Re: How to do basic thing in pm

Post by Osbios »

Very simple: use the mem arrea at 0xB8000 for color- or 0xB0000 for monocrt.
nasm example(PMode; GS is a data segemt @0):

Code: Select all

scroll:
mov  eax,0xB8000

 .loop1
  mov ebx,[gs:eax+0xA0]
  mov [gs:eax],ebx
  add eax,4
 cmp eax,0xB8F00
 jne .loop1
 
 .loop2
  mov dword[gs:eax],0
  add eax,4
 cmp eax,0xB8FA0
 jne .loop2
ret
Last edited by Osbios on Thu Aug 04, 2005 11:00 pm, edited 1 time in total.
dw 0xAA55
Phibred
Member
Member
Posts: 31
Joined: Sun Jun 26, 2005 11:00 pm
Location: Toronto, Ontario, Canada
Contact:

Re: How to do basic thing in pm

Post by Phibred »

Take a look at my Operating System [done in NASM] http://individual.utoronto.ca/Phibred/LunarOS.htm that version is a little old however it is a great resource for some video tricks with no BIOS calls. Video.txt [in my current version it is Video.asm but I haven't gotten around to post that one yet]. I hope that helps.
It will come from the ashes of the old era.
-- James Vaughan
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: How to do basic thing in pm

Post by codemastersnake »

Thanks for that but I know how to output using pointers....

OK Let me make me clear, I have searched net but wasn't able to find out solution to those in C/C++. I found only asm and .pas which I don't want/like.

can any one provide me some code in c or c++ for vesa... or a link
Phibred
Member
Member
Posts: 31
Joined: Sun Jun 26, 2005 11:00 pm
Location: Toronto, Ontario, Canada
Contact:

Re: How to do basic thing in pm

Post by Phibred »

Wow, VESA is like a good year from where you seam to be right now. I recomend focusing on your Keyboard, Floppy, HDD, and CD-Rom drivers before you even think of VESA.

And don't worry about ASM to C translating. Most of the tutorials that I used were based in C and it does take a little more time, but I believe that you leard more that way.

You really could read my code and I think I actually have the C example for moving the text mode cursor.
Last edited by Phibred on Thu Aug 04, 2005 11:00 pm, edited 1 time in total.
It will come from the ashes of the old era.
-- James Vaughan
Post Reply