Memory mapped devices from resl mode (Developers)
> In FPC I also can use the physical memory mapping. I use it for example for
> the LFB access or for ACPI.
> However it is mapped into different segment than the default DS.
>
> For accesing such mapped areas I have to use my own assembler wrappers.
> Like:
> FarPokeB(segm:word;offs:dword;value:byte);assember;
> asm
> push es
> mov ax,segm
> mov es,ax
> mov edi,offs
> mov es:[edi],value
> pop es
> end;
>
> Is possible to map it somehow into "main" address space to be able to use
> normal pascal code like this?
>
> var dev_base:Pchar;
> begin
> dev_base:=Get_dev_base;
> dev_base[offset]:=value;
> ...
>
> I know that it is possible to extend the DS segment limit to reach the 4GB
> but I am not sure about compatibility with Win98, win XP, etc...
If you don't want to change the DS segment limit and DS is limited to your program's space, I think that your only choice is INT 31H/0508H, if the DPMI hosts supports it and if you can get the handle of the memory block which FPC allocates to your program. You can change the DS limit in both Win98 and Win XP (up to 0x7FFFFFFF under Win XP), but I don't know to which compatibility do you refer (for example under Win98 you can access the LFB, but trying to access the sound card's memory mapped registers usually doesn't work, while under Win XP you can not access even the LFB).
---
Glory to God for all things
Complete thread:
- Memory mapped devices from resl mode - Laaca, 26.02.2020, 12:11 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Memory mapped devices from resl mode - Khusraw, 26.02.2020, 12:35
- Memory mapped devices from resl mode - RayeR, 27.02.2020, 05:27
- Memory mapped devices from resl mode - Khusraw, 27.02.2020, 09:07
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 14:01
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 15:02
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 15:08
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 15:23
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 15:36
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 16:55
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 18:54
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 19:33
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 18:54
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 15:08
- Memory mapped devices from resl mode - Khusraw, 04.03.2020, 15:02
- Memory mapped devices from resl mode - Laaca, 04.03.2020, 14:01
- Memory mapped devices from resl mode - Laaca, 27.02.2020, 17:50
- Memory mapped devices from resl mode - Khusraw, 27.02.2020, 20:25
- Memory mapped devices from resl mode - KormaX, 01.03.2020, 22:23
- Memory mapped devices from resl mode - Zyzzle, 02.03.2020, 06:10
- Memory mapped devices from resl mode - KormaX, 12.05.2020, 11:21
- Memory mapped devices from resl mode - Zyzzle, 02.03.2020, 06:10
- Memory mapped devices from resl mode - marcov, 02.03.2020, 15:43
- Memory mapped devices from resl mode - Khusraw, 02.03.2020, 19:39
- Memory mapped devices from resl mode - marcov, 02.03.2020, 23:13
- Memory mapped devices from real mode - Rugxulo, 03.03.2020, 06:11
- Memory mapped devices from real mode - marcov, 03.03.2020, 10:12
- Memory mapped devices from real mode - Rugxulo, 03.03.2020, 22:12
- Memory mapped devices from real mode - marcov, 03.03.2020, 10:12
- Memory mapped devices from resl mode - Khusraw, 03.03.2020, 13:34
- Memory mapped devices from real mode - Rugxulo, 03.03.2020, 06:11
- Memory mapped devices from resl mode - marcov, 02.03.2020, 23:13
- Memory mapped devices from resl mode - Khusraw, 02.03.2020, 19:39
- Memory mapped devices from resl mode - KormaX, 01.03.2020, 22:23
- Memory mapped devices from resl mode - Khusraw, 27.02.2020, 20:25
- Memory mapped devices from resl mode - Khusraw, 27.02.2020, 09:07
Mix view