Clear Screen

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
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Clear Screen

Post by Nathan »

Hello,
I'm starting on Assembly and i want to know how i can clear the screen in Assembly, because of my OS. When i run it in Bochs, that boot messages are there and i want to clear they, for a better visual of my OS.

Thanks,
Nathan Paulino Campos
User avatar
Coty
Member
Member
Posts: 286
Joined: Thu Feb 12, 2009 5:12 pm

Re: Clear Screen

Post by Coty »

Well actually this question would'nt go here, it would go in General Programming, but you could google it and you would find your self here http://answers.yahoo.com/question/index ... 346AA8GxM4

How to clearing the screen should not be put in OS Development, for it is barely OS related.
My hero, is Mel.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Clear Screen

Post by Nathan »

Thanks, it's not for OS development, but it's a good training.
I don't know if i can post this here, but here is a board that i've created, for Assembly, if you want register there, i need to start.

http://assembly.s2.bizhat.com/
Thanks!
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Clear Screen

Post by Brendan »

Hi,
Nathan wrote: I'm starting on Assembly and i want to know how i can clear the screen in Assembly, because of my OS. When i run it in Bochs, that boot messages are there and i want to clear they, for a better visual of my OS.
For real mode boot code, probably the best way is to use the BIOS function for scrolling text (e.g. scroll everything on the screen off the screen), or simply setting the video mode again using the BIOS function for setting a video mode.

Scrolling everything off the screen is faster. However, if you want to clear the screen during boot (before you display anything) then it's probably a good idea to also make sure you're using the video mode that you think you're using (rather than assuming the BIOS left you in 80*25 text mode, and being wrong in some cases).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Clear Screen

Post by Nathan »

Ok, i'm going to try!
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Clear Screen

Post by Nathan »

With all this resources and i can't do this work!
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Clear Screen

Post by neon »

Hello,

INT 0x10 function 6

This can be used to clear the screen. bh should be 0x07 for black background, white text, cx should be 0 (top left corner) dh/dl is the bottom right corner (79,24). Everything else should be pretty easy.

If you cannot get something to work, don't post that it doesn't work - post information and what you are trying to do.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: Clear Screen

Post by Nathan »

I'm going to read it!
Any problem i post here, ok!
Thanks!
Post Reply