Page 2 of 2
Re: System resets if i initialize the stack segment in pmode
Posted: Sat Jan 09, 2016 3:54 am
by ggodw000
iansjack wrote:Brendan wrote:You'd want to obtain "SimNow debugger"
The debugger is built in to SimNow and offers very comprehensive facilities for debugging.
still exploring, hopefully i can get more out of this tool.
Re: System resets if i initialize the stack segment in pmode
Posted: Sat Jan 09, 2016 5:40 am
by Combuster
ggodw000 wrote:Secondly, whynot just tell me what i am missing then
ggodw000 wrote:bochs (...) never worked.
Do you honestly believe that allows anybody to give you an exact answer? Not reading the manuals seems to extend to not reading the smart questions forum rule in this context.
And yes, I've seen your other thread. Have you seen the replies?
Re: System resets if i initialize the stack segment in pmode
Posted: Mon Jan 11, 2016 3:58 pm
by ggodw000
Been away for sometime, hopefully will get back on this soon.
but last time, i decided to look at bit diff angle:
one thing i notice is that I did not setup SS during when I launch from DOS, so it must be using whatever stack DOS prepared before launching?
Anyways i did initialize stack segment:
Code: Select all
mov ax, STA
mov ss, ax
mov sp, 100h ( size of stack segment ).
Weird thing is if I did run the binary from DOS, stack segment values are as if it is not initialized at all. (it is not the value of the stack segment)
Now I run with GRDB debugger, than I see STACK segment is initialized with the STACK segment.
That is bizarre, it is as if, one line of code mov ss, ax is completely skipped, but if my memory recalls I think I have encountered this before.
I am working underway to make it directly bootable from disk, so that it wont depend on bios, i am guessing it involves probably at least writing some sort of video driver and some fat32 driver.
Re: System resets if i initialize the stack segment in pmode
Posted: Mon Jan 11, 2016 4:27 pm
by iansjack
So you move ax to the ss register, you then immediately move 100h to the ss register, and you ask why the mov ss, ax seems to be ignored.
Re: System resets if i initialize the stack segment in pmode
Posted: Mon Jan 11, 2016 5:32 pm
by ggodw000
iansjack wrote:So you move ax to the ss register, you then immediately move 100h to the ss register, and you ask why the mov ss, ax seems to be ignored.
my bad, typo. Actual code doesnt have this type. Fixed the post too.
Re: System resets if i initialize the stack segment in pmode
Posted: Tue Jan 12, 2016 12:57 am
by Techel
Dos sets the stack pointer to the end of program's segment, to 0xFFFE. At least when executing com files.