I am into stage2 devel ... i have a string something like below:
stage2string db "loading stage2 ...", 0
the problem is, when I include too much of characters into this string like:
stage2string db "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa loading stage2 ...", 0
the other strings defined below are getting overwritten, or not loading stage3 itself ...
what could be the reason ?
will 'db' overwrite other areas ?
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: will 'db' overwrite other areas ?
well
waht compiler are you using, and what is the other instruction
and how are your "adressing" ( direct, or labels)
because normaly it is supossed to move the code, and not overwrite it.
KMT dk
waht compiler are you using, and what is the other instruction
and how are your "adressing" ( direct, or labels)
because normaly it is supossed to move the code, and not overwrite it.
KMT dk
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: will 'db' overwrite other areas ?
i am using nasm for assembling ...
I use si register for printing ...
mov si, dispstring
call printstring
...
also if I define more strings, just below " string db "stage2 loading ...", ", the same problem happens ... something is overwriting the values...
I use si register for printing ...
mov si, dispstring
call printstring
...
also if I define more strings, just below " string db "stage2 loading ...", ", the same problem happens ... something is overwriting the values...
Re: will 'db' overwrite other areas ?
Hi,
Could it be that you are only loading a set number of sectors and extending the string pushes something over the sector boundary?
Cheers,
Adam
Could it be that you are only loading a set number of sectors and extending the string pushes something over the sector boundary?
Cheers,
Adam
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: will 'db' overwrite other areas ?
these are my specs ...
stage1 - 512 bytes - sector 1
stage2 - 1536 bytes - sector 2,3,4
stage3 - 512 bytes - sector 5
the stage2 size is in between 1024-1536 .. rest i am padding with TIMES ... this is a very peculiar problem I am facing ...
all unexpected outputs I am seeing ... for example expected stage2 should be like this ...
stage2 loaded.
es = 0x10000
ss = 0x10000
ds = 0x10000
loading stage3 ...
stage3 loaded
but then I change the dispstring db in stage2 code to include more characters, it's displaying like this
es = 0x&312
ss = 0x&312
ds = 0x&312
sometimes it loads the stage2 again and prints it !!!
stage1 - 512 bytes - sector 1
stage2 - 1536 bytes - sector 2,3,4
stage3 - 512 bytes - sector 5
the stage2 size is in between 1024-1536 .. rest i am padding with TIMES ... this is a very peculiar problem I am facing ...
all unexpected outputs I am seeing ... for example expected stage2 should be like this ...
stage2 loaded.
es = 0x10000
ss = 0x10000
ds = 0x10000
loading stage3 ...
stage3 loaded
but then I change the dispstring db in stage2 code to include more characters, it's displaying like this
es = 0x&312
ss = 0x&312
ds = 0x&312
sometimes it loads the stage2 again and prints it !!!
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: will 'db' overwrite other areas ?
i tried disabling the stage3 loading code ... but now it's loads stage2 once again and prints ...
i checked with sector loading code and addresses ...
i checked with sector loading code and addresses ...
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Re: will 'db' overwrite other areas ?
i found at the problem, but not able to understand why it's happening ...
the first four lines of my stage2 loader is :
mov ax, 0x1000
mov ds, ax
mov es, ax
mov ss, ax
when I remarked the "mov ss, ax" line, it's working quite fine ...
i know ss and ds falling in same address might create a problem ...
how the ss should be placed in stage2 loader ?
the first four lines of my stage2 loader is :
mov ax, 0x1000
mov ds, ax
mov es, ax
mov ss, ax
when I remarked the "mov ss, ax" line, it's working quite fine ...
i know ss and ds falling in same address might create a problem ...
how the ss should be placed in stage2 loader ?
- Combuster
- 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: will 'db' overwrite other areas ?
counterquestion: what is SS used for, where do you want that to be?