Code: Select all
mov ax, 0x4f05
mov bx,0x0
mov dx,0x1 ;Number of bank
int 10h
Code: Select all
mov ax, 0x4f05
mov bx,0x0
mov dx,0x1 ;Number of bank
int 10h
Don't bother. It's just a long discussion about the fact that you can't run BIOS code in protected mode.dak91 wrote:watch here http://forum.osdev.org/viewtopic.php?f=1&t=20638
Code: Select all
struct vbeControllerInfo {
char signature[4]; // == "VESA"
short version; // == 0x0300 for VBE 3.0
short oemString[2]; // isa vbeFarPtr
unsigned char capabilities[4];
short videomodes[2]; // isa vbeFarPtr
short totalMemory; // as # of 64KB blocks
};
Code: Select all
struct vbeControllerInfo {
char signature[3]; // == "VESA"
short version; // == 0x0300 for VBE 3.0
short oemString[1]; // isa vbeFarPtr
unsigned char capabilities[3];
short videomodes[1]; // isa vbeFarPtr
short totalMemory; // as # of 64KB blocks
};
The signature is not 5 bytes long. char signature[4] means there are four bytes. The null isn't needed in this case.Karlosoft wrote: Why signature is 5 bytes long if there are only 4 charachter? The \0 isn't needed, It isn't so?
Yes (sort of).Karlosoft wrote:It's possible make something similar (perhaps with a VESA function) without INT 0x10, and so without switch back to real mode?
Code: Select all
if(VBE version 2 or later) {
if(LFB supported for this video mode) return USE_LFB;
if(VBE2 protected mode interface is supported) return USE_VBE2_INTERFACE;
if(VBE version 3 or later) {
if(VBE3 protected mode interface is supported) return USE_VBE3_INTERFACE;
}
} else {
if(size of pixel data is less than the size of one window) {
if(windowA is writable) return USE_WINDOW_A;
if(windowB is writable) return USE_WINDOW_B;
} else {
return UNUSABLE_MODE;
}
}
Code: Select all
;The struct in .bbs section
struc VESA_REG
.VESA_REG_LABEL resd 1
.VESA_ES resw 1
.VESA_DI resw 1
endstruc
;code code code code....
;The object
VESADATA:
istruc VESA_REG
at VESA_REG.VESA_REG_LABEL, dd 'ESDI'
at VESA_REG.VESA_ES, dw 0 ;If i set a value it work
at VESA_REG.VESA_DI, dw 0
iend
mov [VESADATA+VESA_REG.VESA_ES], es ;With mov i the value doesn't change
mov [VESADATA+VESA_REG.VESA_DI], di
Code: Select all
;The struct in .bbs section
struc VESA_REG
.VESA_REG_LABEL resd 1
.VESA_ES resw 1
.VESA_DI resw 1
endstruc
Code: Select all
%define VESA_REG.VESA_REG_LABEL 0
%define VESA_REG.VESA_ES 4
%define VESA_REG.VESA_DI 6
%define VESA_REG_size 8
Code: Select all
;The object
VESADATA:
istruc VESA_REG
at VESA_REG.VESA_REG_LABEL, dd 'ESDI'
at VESA_REG.VESA_ES, dw 0 ;If i set a value it work
at VESA_REG.VESA_DI, dw 0
iend
Code: Select all
VESADATA:
dd 'ESDI' ;Crash when this is executed by the CPU
dw 0
dw 0
mov [VESADATA+4], es
mov [VESADATA+6], di
Code: Select all
;The object
section .data
VESADATA:
istruc VESA_REG
at VESA_REG.VESA_REG_LABEL, dd 'ESDI'
at VESA_REG.VESA_ES, dw 0 ;If i set a value it work
at VESA_REG.VESA_DI, dw 0
iend
section .text
Be careful with these if you're using BOCHS, they weren't working properly last time I tested them.Brendan wrote:<snip>...For VBE 2.0 there's "Function 0Ah - Return VBE Protected Mode Interface"...<snip>
Code: Select all
xor ebx,ebx
mov bx,ds
shl ebx,4
mov eax,ebx
mov [sys_code_1 + 2],ax
mov [sys_data_1 + 2],ax
mov [Real_code_1 + 2],ax
mov [Real_data_1 + 2],ax
shr eax,16
mov [sys_code_1 + 4],al
mov [sys_data_1 + 4],al
mov [Real_code_1 + 4],al
mov [Real_data_1 + 4],al
mov [sys_code_1 + 7],ah
mov [sys_data_1 + 7],ah
mov [Real_code_1 + 7],ah
mov [Real_data_1 + 7],ah
add ebx,gdt
mov [gdtr + 2],ebx