Clearing the 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
JamesParsons
Posts: 17
Joined: Sat Jan 12, 2013 7:37 am

Clearing the screen

Post by JamesParsons »

I need a simple function to clear the screen of inputs and outputs. something that works like MS-DOS CLS command does anyone know how to implement one. I need to do it in either assembly or C/C++. Also it would be nice to know what it is doing so if you give me code can it be commented?
REAL programmers aren't afraid to use goto's
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Clearing the screen

Post by iansjack »

So you have a screen that is full of characters, which presumes that you can print a character. And you want to fill it with blanks - space characters. And you can't see how to do that?

I think you should try something simpler than OS development.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Clearing the screen

Post by bluemoon »

JamesParsons wrote:I need a simple function to clear the screen of inputs and outputs.
If that screen is also capable of input, is that some kind of multi-touch screen?
JamesParsons wrote:something that works like MS-DOS CLS command does anyone know how to implement one.
Yes, I think many people know how to implement one, but instead of MS-DOS CLS it's probably a terminal emulator instead.
JamesParsons wrote:I need to do it in either assembly or C/C++. Also it would be nice to know what it is doing so if you give me code can it be commented?
No. Your requirement is ambiguous (do you want to clear the VGA, or virtual terminal buffer, or something exotic?) How does your OS deal with the target device (VGA or virtual), Give us a brief description of your OS (real mode, protected mode, design model, etc), Dos you want a clear-screen function used by kernel/driver, or solely for debugging purpose, or you actually want an CLS application that can be called by shell?

Furthermore, the chance that somebody bored enough to spend his own time doing your work is infinitesimally small; but if you show us what effort you have done you can probably get more help - it's just easier for you and the helper.

With none information given, the best you could get maybe:

Code: Select all

memset ( p, 0, 80*25*2 );
JamesParsons
Posts: 17
Joined: Sat Jan 12, 2013 7:37 am

Re: Clearing the screen

Post by JamesParsons »

I think iansjack is right. I've been around this forum asking stupid questions. The problem is this OS-Dev stuff takes a lot of general Computer Knowledge and a basic understanding of how the entire computer works. I've been doing general programming for a while not focusing on other computer topics. I'm going to do something simpler than OS-Dev. I'm going back to writing general software.
:-|

ps. is there some way I can remove these posts
REAL programmers aren't afraid to use goto's
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Clearing the screen

Post by xenos »

JamesParsons wrote:ps. is there some way I can remove these posts
JamesParsons wrote:I need a simple function to clear the screen of inputs and outputs.
Same problem again? :twisted:
iansjack wrote:So you have a screen that is full of characters, which presumes that you can print a character. And you want to fill it with blanks - space characters. And you can't see how to do that?
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
JamesParsons
Posts: 17
Joined: Sat Jan 12, 2013 7:37 am

Re: Clearing the screen

Post by JamesParsons »

all I can find on the programmers hardware database is specification on a bunch of ARM processors. At that I have to click the random page to get to anything with content :?
REAL programmers aren't afraid to use goto's
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Clearing the screen

Post by Brynet-Inc »

JamesParsons wrote:all I can find on the programmers hardware database is specification on a bunch of ARM processors. At that I have to click the random page to get to anything with content :?
It's his forum signature.

EDIT: Removed 2015: Imageshack replaced all links with spam.
Last edited by Brynet-Inc on Fri Aug 28, 2015 8:39 pm, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
JamesParsons
Posts: 17
Joined: Sat Jan 12, 2013 7:37 am

Re: Clearing the screen

Post by JamesParsons »

oh I was being a little slow for a moment #-o
REAL programmers aren't afraid to use goto's
Post Reply