delorie.com/archives/browse.cgi | search |
From: | "Brent Ritchie" <britchieb212 AT rogers DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
References: | <lwV29.271637$WJf1 DOT 95757 AT news01 DOT bloor DOT is DOT net DOT cable DOT rogers DOT com> <1028401071 DOT 374940 AT queeg DOT ludd DOT luth DOT se> |
Subject: | Re: Writing text to screen |
Lines: | 59 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 6.00.2600.0000 |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
Message-ID: | <CaW29.271751$WJf1.106172@news01.bloor.is.net.cable.rogers.com> |
Date: | Sat, 03 Aug 2002 19:29:38 GMT |
NNTP-Posting-Host: | 24.100.15.249 |
X-Complaints-To: | abuse AT rogers DOT com |
X-Trace: | news01.bloor.is.net.cable.rogers.com 1028402978 24.100.15.249 (Sat, 03 Aug 2002 15:29:38 EDT) |
NNTP-Posting-Date: | Sat, 03 Aug 2002 15:29:38 EDT |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
"Martin Str|mberg" <ams AT speedy DOT ludd DOT luth DOT se> wrote in message news:1028401071 DOT 374940 AT queeg DOT ludd DOT luth DOT se... > Brent Ritchie <britchieb212 AT rogers DOT com> wrote: > : I just wanted to know how do I write text to the screen without using > : "cout". I am writing a Command line for my new OS and I don't want to > : re-write the C++ standard library just yet. My OS runs in protected mode so > > printf()? Then you just have to rewrite the C library. I could but I'm not that good. I've only been using C++ for about 3 years and I don't exactly understand how the libraries work. I'm used to being protected from all the low level stuff. Actually you > could pick some of the best parts from libc (if you ever intend to > distribute your OS then you must distibute it under the GPL if you do > this). > > : I'll have to use the video memory directly. Any help appreciated. > > Otherwise check out _farpokew()? I came across the following code: /* note this example will always write to the top line of the screen */ void writeString(int colour, char *string) { char *video=(char*)0xB8000; while(*string!=0) { *video=*string; string++; video++; *video=colour; video++; } } But I can't get it to work, It just crashes. Anyone know how? I'm going to start porting parts of the C++ standard library next month hopefully. I want to try and rewrite part of in in assembler so I can get it to run as fast as possible. Thanks. -- BROS http://members.rogers.com/britchieb212/ > > > Right, > > MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |