Bochs help
Posted: Wed May 28, 2008 1:46 am
I'm using Bochs to debug my bootloader, and I did not find any guide to setup Bochs to debug properly (I'm using Archlinux and the Bochs binary from the repositories is not debugging-enabled I believe ).
Any guide or small example on how to debug with bochs, specially the Realmode bootloader assembly code?
Another question I got is about segments in Real Mode. I've the bootloader stage1/stage2 code in one file, and it's working really well. Tell me if I'm wrong about calling functions in other segments. In the main stage I load the second sector and jump to the code which is working well.
At the beginning of sector 2 my code is:
This dispint label which prints integers is defined at the sector 2 stage which is executed from 1000:0000 (the stage 1 at 0000:7C00 as always). Of course since dispint is using the DIGIT and BASE10 bytes i'm changing basically DS=CS. My message printing function was early in the code, so if I want to display a string my program will malfunction, since CS:1000 now and the dispstring code piece was at CS:0000.
Can I call the old function at CS:0000 or I should redefine the function for
the new bootloader stage?
I hope you understand.
Thank you very much for your help.
[/code]
Any guide or small example on how to debug with bochs, specially the Realmode bootloader assembly code?
Another question I got is about segments in Real Mode. I've the bootloader stage1/stage2 code in one file, and it's working really well. Tell me if I'm wrong about calling functions in other segments. In the main stage I load the second sector and jump to the code which is working well.
At the beginning of sector 2 my code is:
Code: Select all
;; **************************************************************
;;
;; STAGE 2 at sector 2 of FD
;;
;; **************************************************************
org LDADDR_OFFSET ; sector2 loaded at 1000:0000
jmp start2
;; -- definitions for st2 ---
EXECMSG db 'Starting up...',0
BASE10 dw 0010
DIGIT db 5 dup (0)
start2: mov ax, LDADDR_SEGMENT
mov ds, ax
mov ax, 15995
call dispint
jmp $
Can I call the old function at CS:0000 or I should redefine the function for
the new bootloader stage?
I hope you understand.
Thank you very much for your help.
[/code]