Mail Archives: djgpp/2003/07/22/13:12:37
From: | Ben Peddell <killer DOT lightspeed AT bigpond DOT com>
|
User-Agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.1) Gecko/20020826
|
X-Accept-Language: | en-us, en
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: New to djgpp. Questions about protected mode, etc.
|
References: | <3iGdna0c9-Mz-oCiU-KYvA AT giganews DOT com>
|
Lines: | 47
|
Message-ID: | <JZdTa.8844$OM3.1217@news-server.bigpond.net.au>
|
Date: | Tue, 22 Jul 2003 16:52:57 GMT
|
NNTP-Posting-Host: | 144.139.175.69
|
X-Complaints-To: | abuse AT bigpond DOT net DOT au
|
X-Trace: | news-server.bigpond.net.au 1058892777 144.139.175.69 (Wed, 23 Jul 2003 02:52:57 EST)
|
NNTP-Posting-Date: | Wed, 23 Jul 2003 02:52:57 EST
|
Organization: | BigPond Internet Services
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Teece wrote:
> Please bear with me since I am not all that sure about how to ask the
> questions that I have.
>
> I have an application that I want to develop for the PC with special
> hardware that will run on the PCI bus. I will need to send data from the
> program directly to the hardware. It is not necessary that I use a
> sophisticated operating system like XP or even any version of Windows.
> Therefore I can avoid the difficulty of writing Windows device drivers
> for the new hardware, etc.
>
> I suppose that I could go a couple of ways. One way would be to use good
> old DOS, which does not run in protected mode, and use DJGPP (or VC1.52,
> I think) to obtain an executable. Since DOS does not know about
> protected mode I would not cause a segmentation fault when I directly
> access the PCI hardware. Is this correct?
>
Yes.
You can also use the PCI BIOS in real mode or protected mode.
You can read and write PCI Configuration Registers using the PCI BIOS,
then do direct I/O to the memory and ports of the device.
> I was reading in the DJGPP documentation that DJGPP has a DOS extender.
> This was described as a layer of software that "traps the call, switches
> the CPU to real mode, reissues the call, waits for the service to do its
> thing, then switches the CPU back into protected mode, and returns to
> the application code that called the real-mode service".
>
Actually, DJGPP uses DPMI. It only switches to V86 mode when it needs to
issue a real-mode call (such as Disk I/O), or an interrupt which is not
fully handled by the program.
> Does Windows have a DOS extender? Is it not possible to run old DOS
> programs on XP in what passes for a DOS emulator?
>
Windows has DPMI. Alas, Windows NT/2k/XP do not permit direct port I/O
without being severly hampered ("helped").
> Does Linux have a DOS extender? Will an executable made with DJGPP run
> on Linux?
>
A compiled DJGPP executable will not run natively on Linux.
However, a DJGPP program can be easily ported to Linux (provided you
don't use too much DJGPP-specific stuff).
You'd need to make a kernel module to access the ports of the device.
- Raw text -