Mail Archives: djgpp/1996/04/05/06:26:24
Xref: | news2.mv.net comp.os.msdos.djgpp:2453
|
From: | mchyzer AT red DOT seas DOT upenn DOT edu (Michael C Hyzer)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Accessing a Memory Location
|
Date: | 4 Apr 1996 08:24:18 GMT
|
Organization: | University of Pennsylvania
|
Lines: | 35
|
Message-ID: | <4k00vi$dqb@netnews.upenn.edu>
|
NNTP-Posting-Host: | red.seas.upenn.edu
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hello,
I am running the same gcc for DOS on my pentium desktop and 386 laptop.
I am trying to write to the address of the parallel port (0x0378 on both
machines). When i do it on the desktop, with a command such as:
int *para = (char *)0x0378;
This line causes a segmentation violation on the laptop. When I use this
line on the desktop, it will complete the assignment, and I can read and
write to the address. When I boot the desktop without drivers (hitting
F5 during startup), the C program will not run, and the segmentation
violation is identical to the laptop. Another piece of information that
might help, is that the memory addresses for normal assignments on the
laptop consists of addresses such as: 0x7FFFFE58. This is the same
magnitude of address that the desktop uses when it does not run
properly. When the desktop does run properly, it uses addresses such as
0x51E54. It seems that when C uses this block of memory, it can access
the memory address 0x0378. But when C is using the high memory, it
cannot access the low memory, even to read it.
My question is: Does anyone know how to load gcc so it uses low memory.
I am using the same memory manager on both machines, and trying to
duplicate the config.sys, but no luck.
Does anyone know how to write to an address that is locked out by C using
usual commands.
Is there another easy way to change the pins of the parallel port without
using C, if using C is unfeasable. I want to change the voltage at
certain pins without start and stop bits, or however it normally
operates.
If you dont have enough information, or you have suggestions, please
email me at:
mchyzer AT seas DOT upenn DOT edu
Thank you very much.
Chris Hyzer
- Raw text -