segmentation fault when porting to linux



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;
}


.



Relevant Pages

  • Re: segmentation fault when porting to linux
    ... This snippet works just fine in DOS / Win98, but in linux it fails ... driver to control it; learn the driver. ... Note that the fact code like that works under DOS and 16-bit Windows ...
    (comp.os.linux.development.apps)
  • Re: [SLE] Re:Upgrading MS Windows on a Dual Booting Machine
    ... OK, last shot at explaining that "there really is a PURE DOS" for win98, and ... [lots of back-and-forth about whether "win98 runs 'on top' of DOS or not" ... Now, I promised to make a linux reference that might help explain things, and ...
    (SuSE)
  • how can I install win98 (from scratch-no DOS) on this old laptop?
    ... Then I tried to install Gentoo linux on it and didn't quite succeed, ... I urgently need to put win98 on it again so I can take it on a trip... ... I've only installed windows from DOS or older versions. ...
    (alt.os.linux)
  • Re: Derivative effects.
    ... > windows comes from dos, which was designed for personal desktops. ... Thats distro specific, not linux specific. ... > scrollbar setup screens, and anyone who has ever installed an os knows ...
    (Debian-User)
  • Re: Anyone tried basiclinux?
    ... As a practical matter, since so few are still using dos, I dont worry ... my Linux internet logon. ... As for big drives, I work in text, not graphics. ...
    (alt.linux)