VGA mode: the computer reboots.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mghis
Posts: 17
Joined: Wed Jun 22, 2011 1:52 pm

VGA mode: the computer reboots.

Post 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
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: VGA mode: the computer reboots.

Post 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.
If a trainstation is where trains stop, what is a workstation ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VGA mode: the computer reboots.

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply