Skip to contentSkip to conversation

PCI MMIO under DOSEMU

DISCUSSION jean-francois simon 2 participants 4 messages Jun 24, 2009 – Jun 26, 2009

lore
Share & tools
lore
#0 lore raw

hi
i have a dos program using DPMI and making PCI accesses. it runs fine as a DOS stand alone. Under dosemu it can make PCI configuration access no problem. but when it tries to make PCI memory access then it fails. i am trying to access the following PCI MMIO resource at address 0xDFFFF000:

0a:0a.0 Bridge: Device 1895:0001 (rev 01)

        Subsystem: Device 1895:0001
        Flags: bus master, medium devsel, latency 64, IRQ 10
        Memory at dffff000 (32-bit, non-prefetchable) [size=4K]
        Memory at 80000000 (32-bit, non-prefetchable) [size=1024M]
        Memory at de000000 (32-bit, non-prefetchable) [size=16M]
        Memory at dd000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 7e000000 (64-bit, prefetchable) [size=16M]

is it possible to access PCI MMIO under dosemu?
thx a lot
-jf

#1 lore raw

2009/6/24 jean-francois simon <[email protected]>:

Quoted 15 lines

i have a dos program using DPMI and making PCI accesses. it runs fine as a DOS stand alone. Under dosemu  it can make PCI configuration access no problem. but when it tries to make PCI memory access then it fails. i am trying to access the following PCI MMIO resource at address 0xDFFFF000:

0a:0a.0 Bridge: Device 1895:0001 (rev 01)
       Subsystem: Device 1895:0001
       Flags: bus master, medium devsel, latency 64, IRQ 10 Memory at dffff000 (32-bit, non-prefetchable) [size=4K] Memory at 80000000 (32-bit, non-prefetchable) [size=1024M] Memory at de000000 (32-bit, non-prefetchable) [size=16M] Memory at dd000000 (32-bit, non-prefetchable) [size=16M] Memory at 7e000000 (64-bit, prefetchable) [size=16M]

Quoted 1 line

is it possible to access PCI MMIO under dosemu?

This should be possible using $_hardware_ram:
$_hardware_ram = "range 0xdffff000,0xdfffffff range 0x80000000,0x80100000" etc.

Bart
--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 16 lines · Bart Oldeman

2009/6/24 jean-francois simon <[email protected]>:

Quoted 15 lines

i have a dos program using DPMI and making PCI accesses. it runs fine as a DOS stand alone. Under dosemu it can make PCI configuration access no problem. but when it tries to make PCI memory access then it fails. i am trying to access the following PCI MMIO resource at address 0xDFFFF000:

0a:0a.0 Bridge: Device 1895:0001 (rev 01)

       Subsystem: Device 1895:0001
       Flags: bus master, medium devsel, latency 64, IRQ 10
       Memory at dffff000 (32-bit, non-prefetchable) [size=4K]
       Memory at 80000000 (32-bit, non-prefetchable) [size=1024M]
       Memory at de000000 (32-bit, non-prefetchable) [size=16M]
       Memory at dd000000 (32-bit, non-prefetchable) [size=16M]
       Memory at 7e000000 (64-bit, prefetchable) [size=16M]
Quoted 7 lines
Quoted 1 line

is it possible to access PCI MMIO under dosemu?

This should be possible using $_hardware_ram:
$_hardware_ram = "range 0xdffff000,0xdfffffff range 0x80000000,0x80100000" etc.

Bart

thx for the info.
i have tried it and it fails with:

Page fault: write instruction to linear address: 0xdffff3fc CPU was in user mode
Exception was caused by non-available page
VFLAGS(b): 010000001010000110
EAX: 01000000 EBX: 00cc8600 ECX: 00cc8600 EDX: 00000615 VFLAGS(h):
00010286
ESI: 00000212 EDI: dffff3fc EBP: 00000000
CS: 0033 DS: 0000 ES: 0000 FS: 0000 GS: 0000

the address is valid since it is that which is reported by lspci. but it seems like a permission issue (CPU was in user mode). i did a "dosemu -s" though.
-jfs

#3 lore raw

2009/6/26 jean-francois simon <[email protected]>:

Quoted 11 lines

i have tried it and it fails with:

Page fault: write instruction to linear address: 0xdffff3fc CPU was in user mode
Exception was caused by non-available page
 VFLAGS(b): 010000001010000110
EAX: 01000000  EBX: 00cc8600  ECX: 00cc8600  EDX: 00000615  VFLAGS(h):
00010286
ESI: 00000212  EDI: dffff3fc  EBP: 00000000
CS: 0033  DS: 0000  ES: 0000  FS: 0000  GS: 0000

Quoted 3 lines

the address is valid since it is that which is reported by lspci. but it seems like a permission issue (CPU was in user mode). i did a "dosemu -s" though.

The DOS DPMI program cannot access the memory directly (on i386 Linux kernels it would actually be a kernel address) but would need to create a mapping using the DPMI function for physical address mapping (int31/AX=0x0800). If you run "dosemu -s -D+M" you should see what the DPMI program does in ~/.dosemu/boot.log and also where DOSEMU actually maps that memory.

hope that helps,
Bart
--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html