Page 1 of 1

VGA mode: the computer reboots.

Posted: Wed Jun 22, 2011 3:42 pm
by mghis
Hi all.
I have a problem: when I try to switch to vga mode, in bootstrap process, the computer being rebooted. I don't know why this happends. This is my code:

Code: Select all

[BITS 32]
global start
start:
    mov esp, _sys_stack
    jmp stublet

ALIGN 4
mboot:
    MULTIBOOT_PAGE_ALIGN   equ 1<<0
    MULTIBOOT_MEMORY_INFO  equ 1<<1
    MULTIBOOT_AOUT_KLUDGE  equ 1<<16
    MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
    MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
    MULTIBOOT_CHECKSUM  equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
    EXTERN code, bss, end

    dd MULTIBOOT_HEADER_MAGIC
    dd MULTIBOOT_HEADER_FLAGS
    dd MULTIBOOT_CHECKSUM

    dd mboot
    dd code
    dd bss
    dd end
    dd start

stublet:
; This should get the VGA mode...
   mov ah, 0x00
   mov al, 0x13
   int 10h

   jmp $

SECTION .bss
    resb 8192
Can anyone help me?
Thanks,
--mghis

Re: VGA mode: the computer reboots.

Posted: Wed Jun 22, 2011 3:45 pm
by gerryg400

Code: Select all

stublet:
; This should get the VGA mode...
   mov ah, 0x00
   mov al, 0x13
   int 10h
You can't do that from 32bit code. Bios interrupts only work in real mode.

Re: VGA mode: the computer reboots.

Posted: Wed Jun 22, 2011 3:46 pm
by Combuster
It is common courtesy to read the FAQ before posting (specifically, How do I set a graphics mode tells you exactly why your method does not work and what you should do instead)