Page 1 of 1
bootsector help
Posted: Sun Aug 04, 2002 6:32 pm
by beyondsociety
[attachment deleted by admin]
Re:bootsector help
Posted: Sun Aug 04, 2002 7:21 pm
by crazybuddha
Where does it cease to work right???
Re:bootsector help
Posted: Mon Aug 05, 2002 10:36 am
by beyondsociety
I took your advice crazybuddha and decided to start over and figure out where I was having problems and where I had questions. I need who-ever to look over my code and see if its correct. Also in the code I have added questions that I need answering. The bootsector is heavily commented but you can still tell if its a question or a comment.
ex: comment = ; this does this
question = ;---------------------------
What does this do?
Got it!
I have tried it and it displays the message but I havent tested it by jumping to another program. I wanted to make sure the code was corerect before I did that.
Re:bootsector help
Posted: Mon Aug 05, 2002 10:38 am
by beyondsociety
[attachment deleted by admin]
Re:bootsector help
Posted: Mon Aug 05, 2002 10:39 am
by crazybuddha
; ---------------------------------------------------------
; What does this mean?
; Why do I have to do this?
mov ax,0x9000 ; typical place for a stack
mov ss,ax
mov sp,0xFFFF ; use whole segment
; ---------------------------------------------------------
whenever you push/pop values you will decrement/increment the value of SP, which is an offset from SS. You set these values explicitly so you know what they are.
; Does the location have to be equal to the
; selector = 0x10 ?
; or can it be the location of the segment = 0x2000 ?
jmp 0x2000:0x000 ; jump to the bootstrap
You are in real mode at this point. "Selector" doesn't have any meaning in real mode. In pmode, it means the value in the segment register is "selecting" an entry in the GDT. In this example, you would be jumping to where you loaded the sectors from disk.
Regarding your comments. This is MUCH, MUCH better. Try to avoid restating the obvious (or what should be obvious to anyone who is reasonably familiar with assembly).
Re:bootsector help
Posted: Mon Aug 05, 2002 11:27 am
by beyondsociety
Thanks for the help crazybuddha! I found one more thing wrong in my code that made it not work.
boot drv
should be changed to:
bootdrv db 0
After I corrected this, It works!.
The reason it doesn't work is because in my code I save in the drive I booted from. Without the "db 0" it won't work because it doesn't know what drive it is and its set for the floppy drive.