[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pci] How to hit a pci device in dos enviroment



If in Real Mode (i.e. not Virtual 86 mode) you can do something special. You
can attain a non-V86 mode by NOT loading EMM386.EXE. While in Real Mode (but
not V86 mode) you can program the selector for any or all of ES, DS, FS, GS
to have Granularity Large and default access to small. Then by using an
address override prefix you can specify a full 32-bit index all while in
Real Mode. You cannot do this in V86 mode because you would get a GPF if the
index exceeds the 1MB address. In Real Mode (non-V86) there is no
restriction on the address. Once the selector registers are set up an
example from Borland C++

    #define    IO_BASE    0xFFFF0000
    #define    GizmoReg    (IO_BASE + 123)
    ...
    edx = GizmoReg;
    DWORD    StackVar32Bits;
    asm {
    mov    eax, dword ptr [edx]
    mov    StackVar32Bits, eax
    }

Borland C++ automaticaly generates the address override prefix as does TASM
In this method you do not need protected mode. In this setup DOS is
perfectly happy. *** Caution, If you load RAMDRIVE then by performing
RAMDRIVE I/O you will inadvertantly reset the selector registers to
granularity small.

Some of the older issues of Dr. Dobb's covered this.

Jim Dempsey


----- Original Message -----
From: "Charles Krinke" <ckrinke@pulselink.net>
To: <pci@opencores.org>
Sent: Wednesday, August 14, 2002 9:49 AM
Subject: RE: [pci] How to hit a pci device in dos enviroment


> Dear Darrent:
> Well, you have two problems. The first is that in normal DOS environments,
> you are in the real mode of the 80x86 processor, where indeed it can only
> address 20 lines. DOS itself has an interrupt (INT15) that may be used to
> switch in and out of protected mode, but, ... it takes a lot of knowledge
to
> make it work and a few books including the original IBM-PC technical
> reference manual with the BIOS source code.
>
> Modern BIOS implementations switch the processor into protected mode to do
> the PCI initialization since PCI did not even exist when the IBM-PC was
> first conceived. Windows and Linux operated entirely in protected mode and
> as such have access to the entire 32 address space of the microprocessor.
>
> So the short answer is, you will be very frustrated trying to use DOS for
> PCI stuff without a lot of knowledge and would be best served by either
> using Windows or Linux to get to PCI manipulation. I can tell you that
Linux
> has a series of utilities, including lspci which is a PCI analog of ls
> (that's the unix list command, analogous to dir in DOS) to list the
> registers in configuration space and their is a similar command setpci for
> setting arbitrary PCI configuration space registers. You might look into
> these. There may be Windows equivalents, although I do not use Windows for
> embedded work, just Linux and vxWorks.
>
> Charles
>
>
> -----Original Message-----
> From: owner-pci@opencores.org [mailto:owner-pci@opencores.org]On Behalf Of
> DARRENTJEN@yeah.net
> Sent: Tuesday, August 13, 2002 7:16 PM
> To: pci@opencores.org
> Subject: [pci] How to hit a pci device in dos enviroment
>
>
>      if I configure the base addr as ffff0000,I can drive addr bus as
> ffffXXXX to hit the pci device,but in dos mode,there are only 20 addr
> lines,then what addr can be used in a test assemble program to hit the
> device?
> thx a lot
>
> กกกก
>
>
>                DARRENTJEN@YEAH.NET
> 2002-08-14
> --
> To unsubscribe from pci mailing list please visit
> http://www.opencores.org/mailinglists.shtml
>
>
> --
> To unsubscribe from pci mailing list please visit
http://www.opencores.org/mailinglists.shtml

--
To unsubscribe from pci mailing list please visit http://www.opencores.org/mailinglists.shtml