I switch to graphic mode in real mode (before switch to protected mode) with this code :
Code: Select all
[BITS 16]
VesaInfo db 'VBE2'
times 252 db 0
ModeInfo times 256 db 0
FrameBuffer dd 0
;VesaInfo
VesaInfos :
SinV db "VESA"
VE1 db 0
VE2 db 0
PtrFARAscii dd 0
Perf dd 0
PtrFARLst dd 0
NbrChunks dw 0
Buffer times 236 db 0
Mode_Info:
ModeInfo_ModeAttributes dw 1
ModeInfo_WinAAttributes db 1
ModeInfo_WinBAttributes db 1
ModeInfo_WinGranularity dw 1
ModeInfo_WinSize dw 1
ModeInfo_WinASegment dw 1
ModeInfo_WinBSegment dw 1
ModeInfo_WinFuncPtr dd 1
ModeInfo_BytesPerScanLine dw 1
ModeInfo_XResolution dw 1
ModeInfo_YResolution dw 1
ModeInfo_XCharSize db 1
ModeInfo_YCharSize db 1
ModeInfo_NumberOfPlanes db 1
ModeInfo_BitsPerPixel db 1
ModeInfo_NumberOfBanks db 1
ModeInfo_MemoryModel db 1
ModeInfo_BankSize db 1
ModeInfo_NumberOfImagePages db 1
ModeInfo_Reserved_page db 1
ModeInfo_RedMaskSize db 1
ModeInfo_RedMaskPos db 1
ModeInfo_GreenMaskSize db 1
ModeInfo_GreenMaskPos db 1
ModeInfo_BlueMaskSize db 1
ModeInfo_BlueMaskPos db 1
ModeInfo_ReservedMaskSize db 1
ModeInfo_ReservedMaskPos db 1
ModeInfo_DirectColorModeInfo db 1
; VBE 2.0 extensions
ModeInfo_PhysBasePtr dd 1
ModeInfo_OffScreenMemOffset dd 1
ModeInfo_OffScreenMemSize dw 1
mov di, VesaInfos
mov ax, 4F00h
int 10h
mov ax, 4F01h
mov di, Mode_Info
mov cx, 4112h
int 10h
mov ax, 4F02h
mov bx, 4118h
int 10h
Code: Select all
unsigned long *video;
uDD pix;
long int i = 0;
while (i < 1024*768*4) {
video = (unsigned long *) (0xA0000 + i);
pix = 0x7FDD4C;
*video = pix;
i = i + 3;
}
I would like to know how I can write in all memory (with lfb? how can I activate it?) and hiw can I read the modeInfo block?
Sorry for my English , (I speak french)