delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/28/13:23:33

From: Damian Yerrick <DONT DOT YOU DOT DAREd_yerrick AT hotmail DOT comSEND DOT SPAM>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Fastest bitblt?
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <tr4lbsgde5b48d0tsdol3vvc90p0g9nsa3@4ax.com>
References: <eojjbs4ondjp9r8k8e48ij0bq64h4t03s3 AT 4ax DOT com> <Pine DOT LNX DOT 4 DOT 10 DOT 10002281742180 DOT 649-100000 AT darkstar DOT grendel DOT net>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 138
X-Trace: /wma7/X5V+F9XIn5195zVQfIEH2btgGKQB03EsqruILlJ0edajZq5mHDt+QURc1VtavCVZ+Ddo5q!y2GC7dqELqV1/d8ZOrUfYF0qQ5DjBB8CSFIt22mm5UXeL2+UkYe6udiLGiuTvbVQRnK+TUqma/6A!/XyEjg==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Mon, 28 Feb 2000 15:38:05 GMT
Distribution: world
Date: Mon, 28 Feb 2000 15:38:05 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 28 Feb 2000 18:20:28 +0600 (LKT), Kalum Somaratna aka Grendel
<kalum AT crosswinds DOT net> wrote:

>On Mon, 28 Feb 2000, Damian Yerrick wrote:
>
>> On Sat, 26 Feb 2000 20:28:15 +0600 (LKT), Kalum Somaratna aka Grendel
>> <kalum AT crosswinds DOT net> wrote:
><snip> 
>
>> >Yes you can acess memory using the farpokeb etc... functions.
>> >Allegro is a library which uses this method.
>> 
>> I guess you misunderstood me.
>
>I'm sorry but I don't get it.

OP wrote "how do I disable protection to access low memory?"
I said "You don't [disable the protection]."
You interpreted it as "You don't [access low memory]."

>> >providing that you are careful when acessing memory using the
>> >pointer as it is very easy to overwrite code or data using
>> >a stray pointer. 
>> 
>> All too easy in a buggy program on a single-HD laptop.
>
>Comeon, nearptr's would be used in the code that needs to acess <1mb
>memory. So if you take a game the code that depends on nearptrs being
>enabled is likely to be very small in relation to the main code
>(calculating player moves, stuff etc). IMHO so it should be reasonably
>possible to root out most of the bugs in the code that would need to acess
>< 1mb of meory (typically blitting routines, sound card, DMA acess etc)..

Disk access, loading stuff into RAM, saving games. A write gone awry
in the DMA or blit code could trash the kernel.

>> >So IMHO nearptrs are a useful feature and makes much more code portable
>> >from Watcom to DJGPP and also that using nearptrs is resonably safe and
>> >nothing to get a panic attack about :-) 
>> 
>> My experiences with a hugeptr library I wrote in real-mode DOS (which
>> I used in a graphics library that I abandoned when I found about DJGPP
>> and Allegro) speak differently.
>
>Well to be honest I didn't come across any problems while writing DOS4GW
>programs or DJGPP programs with nearptrs enabled.
>
>
>> >Although we can't match ID softwares ability root out bugs ;-)
>> 
>> So use the CPU's.  farptr is your friend.
>
>Again, How many people write code of the complexity that ID software
>wrote that dependens on nearptrs. So that means most people wont have need
>to vast resources to root out bugs :-)
>
>> 
>> >> >for(i=0;i<64000;i++) 
>> >> >   _farpokeb(_dos_ds,0xA0000,+i,buffer[i]);
>> >
>> >char *p= (char *)(__djgpp_conventional_base+ 0xa0000);
>> >for (i=0; i<64000;i++)
>> >p=buffer[i];
>> 
>> After getting and storing the selector for video RAM
>> (pointing to 0xa0000 or whatever VBE 2 tells you):
>> #include <sys/movedata.h>
>> movedata(_my_ds, (unsigned)video_buffer, video_ds, 0, 64000);
>
>I think you've missed the bus here Damien :-) Your code doesn't do the
>same as the code I produced above. 

That's because code above has a bug.  Mine might too.
We're human (I hope).
Anyway, I copied the OP's code.

>The point i'm trying to make is that when you use nearptrs gcc can
>optimize your code as it sees fit. Therefore you should  get better
>performance than movedata or even the farptrs.

OK.  So you better be *really* careful.

>Well IMHO the idea of a protected mode DOS is that you *should* be able to
>acesss < 1mb memory as easily as possible. IMHO If you can't or it is too
>difficult to access <1mb this might prove to be a hindarance to
>programmers who use that environment. 

How is movedata() difficult?

>You can also ovewrite dos in real mode programs too but tell me how many
>of the thousnds of real mode programs/games (which have almost no memory
>protection) corrupted your HDD as you accuse nearptr enabled programs of.

Because I (and several thousand other players) paid $40 each to pay
testers and debuggers.

>> >Thank you all the kind people who have set me as there signature.
>> >Please help me fight this evil Yerrickafee virus scanner which also has no
>> >version for linux :-)
>> 
>> What could be more cross-platform than text?  GNU/Linux has ASCII too,
>> just like DOS (except for line endings, which are DOS-style on Usenet
>> IIRC).  
>
>I suppose you have answered your own comment about text portability
>across dos and Linux ;-)

I was saying that line endings come into the newsreader DOS-style.
A *NIX newsreader that didn't translate the line endings properly
would be _severely_ broken.

>BTW Damien, Maybe the reason why your "virus scanner" ;-)  is so
>innefective is that it doesn't take into account the line ending
>problem ;-)

It's on Usenet; DOS line endings are the standard on Usenet.

>>And Linux doesn't need virus scanners, as system EXEs cannot
>> be overwritten by a user program.
>
>I havent come across viruses that have been written for linux but I
>suppose there might be a few. 

Any Solaris viruses?  HP-UX viruses?

>BTW Are there any friends on the list who know of any viruses for
>UNIX/LINUX?

Good luck.

-- 
Damian Yerrick  http://yerricde.tripod.com/
Comment on story ideas: http://home1.gte.net/frodo/quickjot.html
AOL is sucks! Find out why: http://anti-aol.org/faqs/aas/
View full sig: http://www.rose-hulman.edu/~yerricde/sig.html

This is McAfee VirusScan. Add these two lines to your .sig to
prevent the spread of .sig viruses.  http://www.mcafee.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019