Mail Archives: djgpp/2000/02/28/13:23:33
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 -