Hola! Gracias por responder _Enko!
No funciono de esa forma (aunque es probable que no lo haya implementado bien), voy a poner el codigo como va quedando, a ver si alguien mas despierto que yo ve como arreglarlo
; ***************************
; Mapa de memoria
[map all MEMMAP.map]
; ***************************
[ORG 0]
[BITS 16]
jmp 07C0h:start
novesamsg db "No vesa found", 13, 10, 0
vervesa db "Version of Vesa: Vesa x.x", 13, 10, 0
print:
lodsb ; AL = memory contents at DS:SI
or al, al ; Comprobar fin de cadena
jz end ; ...
mov ah, 0Eh ; Funcion 14 (Imprimir caracter Monotype)
mov bl, 0Ah ; Color de fuente verde
int 10h ; Interrupt
jmp print ; Loop
end:
ret
; ****************************
; Realmode startup code.
; ****************************
start:
; STACK
mov ax, cs ; Update the segment registers
mov ds, ax ; ''
mov es, ax ; ''
; VGA
mov ax, 0012h ; Funcion 00 (Modo de video) - Modo Grafico (16 Colores, 640 * 480)
int 10h
; **********************************************************************
; VESA
; INT 10 - VESA SuperVGA BIOS - GET SuperVGA INFORMATION
; Nota: Field "Signature" must be set to "VBE2" before the call to fill
; **********************************************************************
mov dword [VbeInfoBlock.Signature], 'VBE2'
mov ax, 4F00h
mov di, VbeInfoBlock
int 10h
cmp ax, 004Fh ; Si todo sale bien, la estructura VbeInfoBlock deberia tener info
jne novesa ; Nop..
mov ax, [VbeInfoBlock+4] ; AH = major, AL = minor version
add ax, 48*256+48 ; convert to ASCII
mov [vervesa+22], ah ; replace x.x in string with numbers
mov [vervesa+24], al ; update offsets if string is modified
mov si, vervesa
call print
jmp $ ; FOR DEBUG ONLY
mov bx, 4112h ; 112h - 640x480 16.8M (8:8:8)
mov di, Mode_Info
mov cx, bx
mov ax, 4F01h ; INT 10 - VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION
int 10h
mov ax, 4F02h ; INT 10 - VESA SuperVGA BIOS - SET SuperVGA VIDEO MODE
int 10h
jmp fine
novesa:
mov si, novesamsg
call print
jmp $ ; PAUSA ACA! Abort!
; *****************************
; Setting up, to enter pmode.
; *****************************
fine:
cli
lgdt [gdtr]
mov eax, cr0
or al, 0x1
mov cr0, eax
jmp 0x10:Protected
%include "VESA.inc"
; *******************************
; Protected (Bits 32)
; *******************************
[BITS 32]
Protected:
; etc,, etc..
Una cosa curiosa que pasa en el codigo ahora es que en la linea 53 si la dejo como esta funciona,, pero si pongo:
mov ax, [VbeInfoBlock.Version]
ya no funciona, cuando a mi entender deberia ser lo mismo..
Eso me dice que probablemente la estructura no tenga los datos que deberia tener, pero sin embargo cuando comparo en la linea 50:
cmp ax, 004Fh
es como que todo salio bien.. no se..
Gracias por el tiempo!
Saludos!
PD: Alguien sabe si existe una buena, buena forma de depurar esto? Algo asi como ir viendo los cambios en hexa, en tiempo real? Un debuger attacheado,, o algo asi? Pero que sea bueno de verdad y grafico.. no una consola..
PD2: Ha,, en VESA.inc estan las estructuras necesarias, y la GDT en otro .inc, pero de momento eso va bien,, entra en Modo protegido y funciona..