flat assembler
Message board for the users of flat assembler.

Index > DOS > Accessing video memory in protected mode

Author
Thread Post new topic Reply to topic
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
Hi, people!

Sorry that I posted twice in a row, but I forgot to ask something.
I've got a problem (that I think must be very common) from long ago when programming games: I want to use SVGA modes with a double-buffer and I find that I lack of enough conventional memory. Because paging makes the whole thing a mess (and very slow), I desperately need to use protected mode for the copying, so I can hold all the screen in one continuous buffer. And now I think:
In real mode, the address of the graphics mode video memory is A000:0000. But in protected mode, no address is fixed and segment registers cannot hold just any number, but must include a PL and a table specification bit (global or local), then... WHAT'S THE ADDRESS of the video RAM in protected mode? How do I access it?
Second problem: once in protected mode, how do I switch video page, if I can no longer call the vesa services through real mode interrupt 10h?

Hope you can help. Thank you in advance.

Cas

_________________
«Earth is my country; science is my religion» - Christian Huygens
Post 26 Feb 2004, 05:35
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian
To get the protected mode address, take the segment, multiply by 16, and add the offset.

I asked a similar about int 10h in protected mode. I was told you just have to temporarily switch back to real mode to do the interrupt.
Post 26 Feb 2004, 06:54
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
There's a couple of ways to do it... first, check if your board is VESA2 and supports linear framebuffer. This can then be accessed directly from protected mode so no banking is necessary.

If your board doesn't support LFB, the VESA BIOS might still support the "protected mode bank switching" call. This allows you to get&copy the bank switching instructions to protected mode, so neither V86 or pm->real->pm switching is needed.

Go grab a copy of the VESA specs Smile
Post 26 Feb 2004, 15:28
View user's profile Send private message Visit poster's website Reply with quote
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
Guys,

Thank you very much for your help. I didn't know that the VESA video interrupt 10h was compatible with protected mode. That is good to know. But anyway, none of you told me which was the address of the video memory. I mean, in protected mode.
Do I have to make DS = selector to segment at start of memory; EDX=A0000h?
As you can see, I really need help with low-level protected mode programming.

Cas

_________________
«Earth is my country; science is my religion» - Christian Huygens
Post 28 Feb 2004, 04:22
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

I didn't know that the VESA video interrupt 10h was compatible with protected mode.

It isn't, you need the workarounds mentioned above Razz

As for the values - for standard modes like 0x13, the framebuffer is at A000:0000 realmode, which corresponds to physical address 0xA0000 . So, in a 32bit flat OS (or dos extender), you address from 0xA0000 and forward. However, only a certain amount of the framebuffer is mapped here (and sorry for not remembering the amount, but iirc it's 64k?).

If you want to use any of the extended VESA modes, you'll ned to get the Linear FrameBuffer address and map it. Or, in case of old cards or broken VESA BIOS, you'll need to do the dreaded bank-switching.
Post 28 Feb 2004, 04:43
View user's profile Send private message Visit poster's website Reply with quote
Fenist



Joined: 28 Feb 2004
Posts: 6
Location: Russia - Rostov on Don
Fenist
IMHO best way - use LFB (LienarFrameBuffer) - work only in PM, but WORK!!!
Here is example from Zubkov -asm for Win&Dos&Linux: Sorry all comment on Russian, but code realy work.
==================CUT===========================

; lfbfire.asm
; COMPILE
; WASM:
; wasm lfbfire.asm
; DOS4G/W:
; wlink file lfbfire.obj form os2 le op stub=wstub.exe
; PMODE/W:
; wlink file lfbfire.obj form os2 le op stub=pmodew.exe
; ZRDX:
; wlink file lfbfire.obj form os2 ls op stub=zrdx.exe
; WDOSX:
; wlink file lfbfire.obj form os2 le op stub=wdosxle.exe
;
; TASM:
; tasm /m lfbfire.asm
; WDOSX:
; tlink32 -Tpe lfbfire.obj
; stubit lfbfire.exe
; DOS32:
; dlink lfbfire.obj
;
; MASM:
; ml /c lfbfire.asm
; WDOSX:
; link ...
; stubit lfbfire.exe
; DOS32:
; dlink lfbfire.obj
;

.486p ; ñ½∩ ¬«¼á¡ñδ xadd
.model flat ; «ß¡«ó¡á∩ ¼«ñѽ∞ »á¼∩Γ¿ ó ºáΘ¿ΘÑ¡¡«¼ αѪ¿¼Ñ
.code
assume fs:nothing ; ¡πª¡« Γ«½∞¬« ñ½∩ MASM
_start:
jmp short _main
db 'WATCOM' ; ¡πª¡« Γ«½∞¬« ñ½∩ DOS/4GW

; ¡áτὫ »α«úαá¼¼δ
; ¡á óσ«ñÑ «íδτ¡« CS, DS ¿ SS π¬áºδóáεΓ Â¡Ã¡ «ñ¿¡ ¿ ΓÂ«Γ ÂªÃ‘ ÃŸÃ‘ÃºÂ¼Ã‘Â¡Γ ÃŸ ½¿¼¿Γ«¼ 4 âí
; ES π¬áºδÃ³Ã¡Ã‘Γ Â¡Ã¡ ÃŸÃ‘ÃºÂ¼Ã‘Â¡Γ ÃŸ PSP ¡á 100h íá⌐Γ«ó
; «ßΓá½∞¡δÑ αÑú¿ßΓαδ ¡Ñ «»αÑñѽѡδ

_main:
sti ; ñáªÑ Σ½áú »αÑαδóá¡¿⌐ ¡Ñ «»αÑñѽѡ,
cld ; ¡Ñ ú«ó«α∩ πªÑ « Σ½áúÑ ¡á»αáó½Ñ¡¿∩

mov ax,0100h ; Σπ¡¬µ¿∩ DPMI 0100h
mov bx,100h ; αẼÑα ó 16-íá⌐Γ¡δσ ȇαáúαáΣáσ
int 31h ; óδñѽ¿Γ∞ í½«¬ »á¼∩Γ¿ ¡¿ªÑ 1 îí
jc DPMI_error
mov fs,dx ; FS - ßѽѬΓ«α ñ½∩ óδñѽѡ¡«ú« í½«¬á

; »«½πτ¿Γ∞ í½«¬ «íΘÑ⌐ ¿¡Σ«α¼áµ¿¿ « VBE 2.0 (ß¼. ú½áóπ Error! Reference source not found.)
mov dword ptr fs:[0],'2EBV' ; ß¿ú¡áΓπαá VBE2 ó ¡áτὫ í½«¬á
mov word ptr v86_eax,4F00h ; Σπ¡¬µ¿∩ VBE 00h
mov word ptr v86_es,ax ; ßÑú¼Ñ¡Γ, óδñѽѡ¡δ⌐ DPMI
mov ax,0300h ; Σπ¡¬µ¿∩ DPMI 300h
mov bx,0010h ; φ¼π½∩µ¿∩ »αÑαδóá¡¿∩ 10h
xor ecx,ecx
mov edi,offset v86_regs
push ds
pop es ; ES:EDI - ßΓαπ¬Γπαá v86_regs
int 31h ; »«½πτ¿Γ∞ «íΘπε ¿¡Σ«α¼áµ¿ε VBE2
jc DPMI_error
cmp byte ptr v86_eax,4Fh ; »α«óÑα‡ »«ññÑ᪬¿ VBE
jne VBE_error

movzx ebp,word ptr fs:[18] ; «íΩѼ SVGA-»á¼∩Γ¿ ó EBP
shl ebp,6 ; ó ¬¿½«íá⌐Γáσ

; »«½πτ¿Γ∞ ¿¡Σ«α¼áµ¿ε « ó¿ñÑ«αѪ¿¼Ñ 101h
mov word ptr v86_eax,4F01h ; ¡«¼Ñα Σπ¡¬µ¿¿ INT 10h
mov word ptr v86_ecx,101h ; αѪ¿¼ 101h - 640x480x256
; ES:EDI ΓÑ ªÑ ßá¼δÑ
mov ax,0300h ; Σπ¡¬µ¿∩ DPMI 300h - φ¼π½∩µ¿∩ »αÑαδóá¡¿∩
mov bx,0010h ; INT 10h
xor ecx,ecx
int 31h ; »«½πτ¿Γ∞ ñá¡¡δÑ « αѪ¿¼Ñ
jc DPMI_error
cmp byte ptr v86_eax,4Fh
jne VBE_error
test byte ptr fs:[0],80h ; Ã­Â¿Γ 7 íá⌐Γá áΓα¿íπΓ«ó = 1 - LFB ÑßΓ∞
jz LFB_error

; »«ßΓα«Ñ¡¿Ñ ñÑ߬α¿»Γ«αá ßÑú¼Ñ¡Γá, «»¿ßδóáεΘÑú« LFB
; ½¿¼¿Γ
mov eax,ebp ; ó¿ñÑ«»á¼∩Γ∞ ó ¬¿½«íá⌐Γáσ
shl eax,10 ; ΓÑ»Ñα∞ ó íá⌐Γáσ
dec eax ; Â½Â¿Â¼Â¿Γ = αẼÑα - 1
shr eax,12 ; Â½Â¿Â¼Â¿Γ Ã³ 4-¬¿½«íá⌐Γ¡δσ Ññ¿¡¿µáσ
mov word ptr videodsc+0,ax ; ºá»¿ßáΓ∞ í¿Γδ 15 - 0 ½¿¼¿Γá
shr eax,8
and ah,0Fh
or byte ptr videodsc+6,ah ; ¿ í¿Γδ 19 - 16 ½¿¼¿Γá
; íáºá
mov eax,ebp ; ó¿ñÑ«»á¼∩Γ∞ ó ¬¿½«íá⌐Γáσ
shl eax,10 ; ó íá⌐Γáσ
mov edx,dword ptr fs:[40] ; Σ¿º¿τÑ߬¿⌐ áñαÑß LFB
mov cx,dx
shld ebx,edx,16 ; »«¼ÑßΓ¿Γ∞ Ñú« ó CX:DX,
mov di,ax
shld esi,eax,16 ; á αẼÑα - ó SI:DI
mov ax,800h ; ¿ óδºóáΓ∞ Σπ¡¬µ¿ε DPMI 0800h
int 31h ; «Γ«íαếΓ∞ Σ¿º¿τÑ߬¿⌐ áñαÑß ó ½¿¡Ñ⌐¡δ⌐
jc DPMI_error
shrd edx,ebx,16 ; ȄαÑ¡ÑßΓ¿ »«½πτÑ¡¡δ⌐ ½¿¡Ñ⌐¡δ⌐ áñαÑß
mov dx,cx ; ¿º BS:CX ó EDX
mov word ptr videodsc+2,dx ; ¿ ºá»¿ßáΓ∞ í¿Γδ 15 - 0 íáºδ
shr edx,16
mov byte ptr videodsc+4,dl ; í¿Γδ 23 - 16
mov byte ptr videodsc+7,dh ; ¿ í¿Γδ 31 - 24
; »αáóá
mov bx,cs
lar cx,bx ; »α«τ¿ΓáΓ∞ »αáóá ¡áΦÑú« ßÑú¼Ñ¡Γá
and cx,6000h ; ¿ ȄαÑ¡ÑßΓ¿ í¿Γδ DPL
or byte ptr videodsc+5,ch ; ó ßΓα«∩Θ¿⌐ß∩ ñÑ߬α¿»Γ«α

; »«¼ÑßΓ¿Γ∞ Â¡Ã¡Φ Ã±Ã‘ÃŸÂ¬α¿»Γ«α ó LDT ¿ »«½πτ¿Γ∞ ßѽѬΓ«α
mov cx,1 ; »«½πτ¿Γ∞ «ñ¿¡ ¡«óδ⌐ ñÑ߬α¿»Γ«α
mov ax,0 ; π DPMI
int 31h
jc DPMI_error
mov word ptr videosel,ax ; ºá»¿ßáΓ∞ Ñú« ßѽѬΓ«α

push ds
pop es
mov edi,offset videodsc ; ES:EDI - áñαÑß ¡áΦÑú« ñÑ߬α¿»Γ«αá
mov bx,ax ; BX - óδñá¡¡δ⌐ ¡á¼ ßѽѬΓ«α
mov ax,0Ch ; Σπ¡¬µ¿∩ DPMI 0Ch
int 31h ; ºáúαπº¿Γ∞ ñÑ߬α¿»Γ«α ó LDT
jc DPMI_error ; ΓÑ»Ñα∞ ó videosel Â½Ã‘ÂªÂ¿Γ ÃŸÃ‘Â½Ã‘Â¬Γ«α ¡á LFB

; ȄαѬ½ετÑ¡¿Ñ ó αѪ¿¼ 4101h (101h + LFB)
mov word ptr v86_eax,4F02h ; 4F02h - πßΓá¡«ó¿Γ∞ SVGA-αѪ¿¼
mov word ptr v86_ebx,4101h ; αѪ¿¼ 4101h = 101h + LFB
mov edi,offset v86_regs ; ES:EDI - ßΓαπ¬Γπαá v86_regs
mov ax,0300h ; Σπ¡¬µ¿∩ DPMI 300h
mov bx,0010h ; φ¼π½∩µ¿∩ »αÑαδóá¡¿∩ 10h
xor ecx,ecx
int 31h

mov ax,word ptr videosel ; AX - Â¡Ã¡Φ ÃŸÃ‘Â½Ã‘Â¬Γ«α
enter_flame: ; ßεñá »αÂ¿Ã±Ã‘Γ π»αáó½Ñ¡¿Ñ ß ßѽѬΓ«α«¼ ó ax ¡á A000h:0000,
; Ñß½¿ »α«¿º«Φ½á «Φ¿í¬á ó ½εí«⌐ VBE-Σπ¡¬µ¿¿
mov es,ax ; ES - ßѽѬΓ«α ó¿ñÑ«»á¼∩Γ¿ ¿½¿ LFB

; «Γßεñá ¡áτ¿¡áÑΓß∩ »α«µÑñπαá úÑ¡Ñαᵿ¿ »½á¼Ñ¡¿

; úÑ¡Ñαᵿ∩ »á½¿Γαδ ñ½∩ »½á¼Ñ¡¿
xor edi,edi ; ¡áτáΓ∞ »¿ßáΓ∞ »á½¿Γαπ ß áñαÑßá ES:0000
xor ecx,ecx
palette_gen:
xor eax,eax ; µóÑΓá ¡áτ¿¡áεΓß∩ ß 0, 0, 0
mov cl,63 ; τ¿ß½« º¡áτÑ¡¿⌐ ñ½∩ «ñ¡«⌐ ¬«¼»«¡Ñ¡Γδ
palette_l1:
stosb ; ºá»¿ßáΓ∞ íá⌐Γ
inc eax ; πóѽ¿τ¿Γ∞ ¬«¼»«¡Ñ¡Γπ
cmpsw ; »α«»πßΓ¿Γ∞ ñóá íá⌐Γá
loop palette_l1 ; ¿ Γᬠ64 αáºá

push edi
mov cl,192
palette_l2:
stosw ; ºá»¿ßáΓ∞ ñóá íá⌐Γá
inc di ; ¿ »α«»πßΓ¿Γ∞ «ñ¿¡
loop palette_l2 ; ¿ Γᬠ192 αáºá (ñ« ¬«¡µá »á½¿Γαδ)
pop edi ; ó«ßßΓá¡«ó¿Γ∞ EDI
inc di
jns palette_gen

; »á½¿Γαá ßúÑ¡Ñα¿α«óá¡á, ºá»¿ßáΓ∞ ÑÑ ó αÑú¿ßΓαδ VGA DAC (ß¼. ú½áóπ Error! Reference source not found.)
mov al,0 ; ¡áτáΓ∞ ß αÑú¿ßΓαá 0
mov dx,03C8h ; ¿¡ñѬߡδ⌐ αÑú¿ßΓα ¡á ºá»¿ß∞
out dx,al
push es
push ds ; »«¼Ñ¡∩Γ∞ ¼ÑßΓἿ ES ¿ DS
pop es
pop ds
xor esi,esi
mov ecx,256*3 ; »¿ßáΓ∞ óßÑ 256 αÑú¿ßΓα«ó
mov edx,03C9h ; ó »«αΓ Ã±Ã¡Â¡Â¡δσ VGA DAC
rep outsb
push es
push ds ; »«¼Ñ¡∩Γ∞ ¼ÑßΓἿ ES ¿ DS
pop es
pop ds

; «ß¡«ó¡«⌐ µ¿¬½ - á¡¿¼áµ¿∩ »½á¼Ñ¡¿, »«¬á ¡Ñ íπÃ±Ã‘Γ Â¡Ã¡ÂªÃ¡Γá ½εíá∩ ¬½áó¿Φá,
xor edx,edx ; 񫽪ѡ íδΓ∞ αáóÑ¡ ¡π½ε
mov ebp,7777h ; ½εí«Ñ τ¿ß½«
mov ecx,dword ptr scr_width ; Φ¿α¿¡á φ¬αá¡á
main_loop:
push es ; ß«σαá¡¿Γ∞ ES
push ds
pop es ; ES = DS - ¼δ αáí«ΓáѼ Γ«½∞¬« ß íπΣÑα«¼
; á¡¿¼áµ¿∩ »½á¼Ñ¡¿ (¬½áßß¿τÑ߬¿⌐ á½ú«α¿Γ¼)
inc ecx
mov edi,offset buffer
mov ebx,dword ptr scr_height
shr ebx,1
dec ebx
mov esi,scr_width
animate_flame:
mov ax,[edi+esi*2-1] ; óδτ¿ß½¿Γ∞ ßαÑñ¡ÑÑ º¡áτÑ¡¿Ñ µóÑΓá
add al,ah ; ó ñá¡¡«⌐ Γ«τ„ (EDI) ¿º º¡áτÑ¡¿⌐
setc ah ; µóÑΓá ó Γ«τ„ ß½Ñóá ¿ ¡á ñóÑ ßΓ᫬¿
mov dl,[edi+esi*2+1] ; 󡿺, ß»αáóá ¿ ¡á ñóÑ ßΓ᫬¿ 󡿺
add ax,dx
mov dl,[edi+esi*4] ; ¿ ¡á τÑΓδαÑ ßΓ᫬¿ 󡿺,
add ax,dx ; »α¿τѼ Ȅαó«Ñ º¡áτÑ¡¿Ñ
shr ax,2 ; ¼«ñ¿Σ¿µ¿α«óáΓ∞
jz already_zero ; π¼Ñ¡∞Φ¿Γ∞ ∩ᬫßΓ∞ µóÑΓá
dec ax
already_zero:
stosb ; ºá»¿ßáΓ∞ ¡«óδ⌐ ÂµÃ³Ã‘Γ Ã³ íπΣÑα
add eax,edx
shr eax,1
mov byte ptr [edi+esi-1],al
loop animate_flame
mov ecx,esi
add edi,ecx
dec ebx
jnz animate_flame

; »ßÑóñ«ß½πτá⌐¡á∩ »«½«ß¬á 󡿺π φ¬αá¡á, ¬«Γ«αá∩ ß½πÂªÂ¿Γ ÃºÃ‘Â¡Ã‘αáΓ«α«¼ »½á¼Ñ¡¿
generator_bar:
xadd bp,ax
stosw
stosw
loop generator_bar

pop es ; ó«ßßΓá¡«ó¿Γ∞ ES ñ½∩ óδó«ñá ¡á φ¬αá¡
; óδó«ñ »½á¼Ñ¡¿ ¡á φ¬αá¡
xor edi,edi ; ES:EDI - LFB
push esi
add esi,offset buffer ; DS:ESI - íπΣÑα
mov ecx,dword ptr scr_size ; αẼÑα íπΣÑαá ó ñó«⌐¡δσ ß½«óáσ
rep movsd ; ߬«»¿α«óáΓ∞ íπΣÑα ¡á φ¬αá¡
pop esi

mov ah,1 ; Ñß½¿ ¡Ñ íδ½á ¡áªáΓá
int 16h ; ¡¿¬á¬á∩ ¬½áó¿Φá,
jz main_loop ; »α«ñ«½ª¿Γ∞ «ß¡«ó¡«⌐ µ¿¬½,
mov ah,0 ; ¿¡áτÑ -
int 16h ; ßτ¿ΓáΓ∞ φΓ𠬽áó¿Φπ

exit_all:
mov ax,03h ; ó«ßßΓá¡«ó¿Γ∞ ΓѬßΓ«óδ⌐ αѪ¿¼
int 10h
mov ax,4C00h ; AH = 4Ch
int 21h ; óδσ«ñ ¿º »α«úαá¼¼δ »«ñ αáßΦ¿α¿ΓѽѼ DOS

; αẽ¿τ¡δÑ «íαáí«Γτ¿¬¿ «Φ¿í«¬
DPMI_error: ; «Φ¿í¬á »α¿ óδ»«½¡Ñ¡¿¿ «ñ¡«⌐ ¿º Σπ¡¬µ¿⌐ DPMI
mov edx,offset DPMI_error_msg
mov ah,9
int 21h ; óδóÑßΓ¿ ß««íΘÑ¡¿Ñ «í «Φ¿í¬Ñ
jmp short exit_all ; ¿ óδ⌐Γ¿
VBE_error: ; ¡Ñ »«ññÑনóáÑΓß∩ VBE
mov edx,offset VBE_error_msg
mov ah,9
int 21h ; óδóÑßΓ¿ ß««íΘÑ¡¿Ñ «í «Φ¿í¬Ñ
jmp short start_with_vga ; ¿ ¿ß»«½∞º«óáΓ∞ VGA
LFB_error: ; ¡Ñ »«ññÑনóáÑΓß∩ LFB
mov edx,offset LFB_error_msg
mov ah,9 ; óδóÑßΓ¿ ß««íΘÑ¡¿Ñ «í «Φ¿í¬Ñ
int 21h
start_with_vga:
mov ah,0 ; »«ñ«ªñáΓ∞ ¡áªáΓ¿∩ ½εí«⌐ ¬½áó¿Φ¿
int 16h
mov ax,13h ; ȄαѬ½ετ¿Γ∞ß∩ ó ó¿ñÑ«αѪ¿¼ 13h
int 10h ; 320x200x256
mov ax,2 ; Σπ¡¬µ¿∩ DPMI 0002h
mov bx,0A000h ; »«ßΓα«¿Γ∞ ñÑ߬α¿»Γ«α ñ½∩ αÑá½∞¡«ú«
int 31h ; ßÑú¼Ñ¡Γá
mov dword ptr scr_width,320 ; πßΓá¡«ó¿Γ∞ ȇαá¼ÑΓαδ
mov dword ptr scr_height,200 ; αѪ¿¼á
mov dword ptr scr_size,320*200/4
jmp enter_flame ; ¿ ȄαÑ⌐Γ¿ ¬ »½á¼Ñ¡¿

.data
; αẽ¿τ¡δÑ ß««íΘÑ¡¿∩ «í «Φ¿í¬áσ
VBE_error_msg db 'VBE 2.0 error',0Dh,0Ah
db 'Will use VGA 320x200 mode'
db 0Dh,0Ah,'$'
DPMI_error_msg db 'DPMI error$'
LFB_error_msg db 'Linear Framebuffer not '
db 'availiable',0Dh,0Ah
db 'Will use VGA 320x200 mode'
db 0Dh,0Ah,'$'
; ȇαá¼ÑΓαδ ó¿ñÑ«αѪ¿¼á
scr_width dd 640
scr_height dd 480
scr_size dd 640*480/4
; ßΓαπ¬Γπαá, ¿ß»«½∞ºπѼá∩ Σπ¡¬µ¿Ñ⌐ DPMI 0300h
v86_regs label byte
v86_edi dd 0
v86_esi dd 0
v86_ebp dd 0
v86_res dd 0
v86_ebx dd 0
v86_edx dd 0
v86_ecx dd 0
v86_eax dd 0
v86_flags dw 0
v86_es dw 0
v86_ds dw 0
v86_fs dw 0
v86_gs dw 0
v86_ip dw 0
v86_cs dw 0
v86_sp dw 0
v86_ss dw 0
; ñÑ߬α¿»Γ«α ßÑú¼Ñ¡Γá, ß««ΓóÑΓßΓóπεΘÑú« LFB
videodsc dw 0 ; í¿Γδ 15 - 0 ½¿¼¿Γá
dw 0 ; í¿Γδ 15 - 0 íáºδ
db 0 ; í¿Γδ 16 - 23 íáºδ
db 10010010b ; ñ«ßΓπ»
db 10000000b ; í¿Γδ 16 - 19 ½¿¼¿Γá ¿ ñαπú¿Ñ í¿Γδ
db 0 ; í¿Γδ 24 - 31 íáºδ
; ßѽѬΓ«α ßÑú¼Ñ¡Γá, «»¿ßδóáεΘÑú« LFB
videosel dw 0
.data?
; íπΣÑα ñ½∩ φ¬αá¡á
buffer db 640*483 dup(?)
; ßΓѬ
.stack 1000h
end _start
==================CUT===========================
if U want, i can mail U *.asm and *.com
Fenist kolia_85@rambler.ru
Post 01 Mar 2004, 07:43
View user's profile Send private message Reply with quote
Cas



Joined: 26 Feb 2004
Posts: 82
Location: Argentina
Cas
Guys,

Thank you a LOT!!! You're genius! But now I think I urgently need classes on low level protected mode programming. Confused
Where can I find detailed information (very slowly and patiently written information) about programming in assembly for protected mode? Not only with a DPMI. I would like to understand the structure of PM memory, registers and interrupts in a way that a guy used to real mode low level can understand. I don't want to get stuck!!!!
In real mode, I've always been the guy that never wanted to use other people's libraries. I like programming everything by myself and feel proud Razz But PM is way too hard! I want to feel strong again! Twisted Evil

Cas

_________________
«Earth is my country; science is my religion» - Christian Huygens
Post 02 Mar 2004, 04:31
View user's profile Send private message Yahoo Messenger MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Get the intel programming manuals, especially volume 3, the systems programming guide. It's not a "hold your hands and guide you through stuff" kind of thing, though, it's dry technical information.
Post 02 Mar 2004, 09:15
View user's profile Send private message Visit poster's website Reply with quote
Fenist



Joined: 28 Feb 2004
Posts: 6
Location: Russia - Rostov on Don
Fenist
Best CPU manuals - from intel. For p4 - 3-d vol System programming 5,5 MB
P1 (3-d vol) 4 MB So if you have dial... you will have enough time to think about ZEN Smile
But structure of PM was not changed from 386 Exclamation IA32 - forever!
Best 386 manual i have (on eng, but not rus!) in CHM about 930 KB. mail me on kolia_85@rambler.ru and i'll send it.

In NET good sites:
www.embedded.com/ 98/9804fe4.htm
www.x86.org - not official intel cpu site
and NexusSystem on geosities (i dont mem direct link)

Very useful to get VESA 3.0(300 kb) structure, and Ralf Brown's interrupt llist. (about 3 mb).
I have MASS information about PM, but half of it on russian. If U plane to code in PM, good way will use DosExtenders,(program/driver provides DPMI services). Such program will work both in Win and Dos. Example - Duke 3d,Warcraft II, DOOM... etc. Good practics to get PMODE by Tran and try to understand each string. Once upon the time i tryed to rewrite it on fasm style:))
kolia_85@rambler.ru
Post 02 Mar 2004, 11:41
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
about linear frambuffer - some cards doesn't support it, does VESA emulate it, or it is just unsupported on such cards?
Post 02 Mar 2004, 19:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
at least on my card (with VESA 1.2) linear frame buffer isn't simulated at all.
Post 02 Mar 2004, 19:19
View user's profile Send private message Visit poster's website Reply with quote
Fenist



Joined: 28 Feb 2004
Posts: 6
Location: Russia - Rostov on Don
Fenist
Use SciTech Display Doctor - Univbe - it gives VESA 2.0 & 3.0 for old cards
Work only under dos, all windows version i have - works terrible.
Pur univbe in autoexec, (if youuse win9x!!!) and U will have VBE 2.0 in ALL your dos programs. May be some problems with V card - install DirectX 8.0 or later.
I Did so on Win98&directX 80 p133/32ram/ Video Card - S3 Trio64v+ 2MB
Windows 2000/XP sometimes lock LFB, and it is most problem, becouse they didn't give you 0 Ring in PM. (Prevelegies levels - Ring zero - best, 3 - only user programs,with minimum rights)
Post 03 Mar 2004, 09:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.