Mail Archives: djgpp/1998/05/17/16:02:57
From: | The Hodsdons <meh AT cyberrealm DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | New to djgpp, desperate for help...
|
Date: | Sun, 17 May 1998 15:29:45 -0500
|
Organization: | CyberRealm
|
Lines: | 65
|
Message-ID: | <355F48B9.8DB27C57@cyberrealm.net>
|
NNTP-Posting-Host: | ip150.new-haven.ct.pub-ip.psi.net
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Okay, let me stress up front my limited experience with programming. I
have only
really written a couple of dozen straightforward programs to help my
with my
thesis research. I wrote these programs on Unix workstations (SGI,
Sparc, DEC)
because that was what was available at my University using their canned
C compilers.
Now that I am no longer affiliated with a University, but I want to
continue learning about C programming and continue working on these
programs I wrote, I need to
port them over to my Win95/DOS PC.
I almost bought a commercial compiler but then I bumped into DJGPP. I
am very
impressed. I've got the whole thing downoaded and working (at least it
seems to
be working). I brought my old programs over from the University and
they compiled just fine...
BUT. The problem is that they don't run. They all give segmentation
faults. So,
I started playing around with simple "Hello World" programs. I have
concluded
that I don't understand something about memory allocation in Win95/DOS.
I
read through the faq and have a hint that what I need to understand
better how to
configure Windows use of memory, i.e. the DPMI stuff.
Okay, after all that, my simple question is: Why didn't this simple
program work?
(I am running it in a Win95 DOS prompt window. I set DPMI to 65535 as
it
suggested in the FAQ.)
main() {
int test[90000];
printf("This is a test.\n");
return(0);
}
According to the faq I should have access to a bunch of memory (I have
32 MB RAM, a lot of disk space, on a 200MHZ AMD-K6 machine). If I
declare the test
array to be much smaller, like 10,000 elements, there is no problem.
I know that there is a bunch of stuff here that I need to read more
about. I just need
direction. All of the nice faq pages, info pages, web pages are good,
but too
advanced for my simple problem. I need basic help.
Well, thanks for getting through this long explanation. If you want to
respond, I
would appreciate a cc to my e-mail address in case I miss your reply on
usenet.
I don't read news very often anymore.
Mike Hodsdon
meh AT cyberrealm DOT net
- Raw text -