segmentation fault when porting to linux
- From: email7373388@xxxxxxxxxxxxxxx
- Date: Tue, 26 Feb 2008 04:58:20 -0800 (PST)
I want to move to linux from DOS / Win98, and the piece of hardware
communicates this way (see snippet below).
This snippet works just fine in DOS / Win98, but in linux it fails
with a segmentation fault. Any idea how to make it work?
#include <stdio.h>
typedef unsigned long DWORD;
typedef unsigned char BYTE;
typedef unsigned short WORD;
volatile WORD *memory_word_pointer;
DWORD pmem_address = 0xD4000;
void *return_address (DWORD address)
{
return (BYTE *) address;
}
int main()
{
memory_word_pointer = (WORD *)return_address (pmem_address);
*memory_word_pointer = 0x1000;
return 1;
}
.
- Follow-Ups:
- Re: segmentation fault when porting to linux
- From: email7373388
- Re: segmentation fault when porting to linux
- From: Joe Pfeiffer
- Re: segmentation fault when porting to linux
- From: David Schwartz
- Re: segmentation fault when porting to linux
- Prev by Date: Re: Web services via httpd
- Next by Date: Re: Benchmarking an IO library
- Previous by thread: Benchmarking an IO library
- Next by thread: Re: segmentation fault when porting to linux
- Index(es):
Relevant Pages
|