I forgot to write one important thing in my previous post about the problem of constant strings which obliged me to write this post. My previous post was locked.
Okay first things first. I've been writing a 16 bit O.S with GUI and extended memory support. I have been really annoyed my constant strings which don't work properly. I have posted this problem before but everyone out there suggest me to read the FAQ section about using proper linker script. I had already used the proper linker script ( the one that include *.rodata, *.rdata etc.) but it didn't work for me. I tried to post my problem to find a proper solution but everyone who reads my post suggest me to read the FAQ about linker script, which in fact is not the solution for me.
If anyone knows any other solution for working constant strings please please please post your reply. I would highly appreciate any reply hereby.
Constant strings are not not working [this is not a FAQ]
Constant strings are not not working [this is not a FAQ]
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: Constant strings are not not working [this is not a FAQ]
*sigh*
Solar wrote:What stuns me every time is how people seem to skip the debugging phase completely. The question always is "I write this code, and it doesn't work". The question never is "I write this code, and the string doesn't end up in the binary" or somesuch...
Every good solution is obvious once you've found it.
Re: Constant strings are not not working [this is not a FAQ]
Although I have not read it, probably for a good reason.Chandra wrote:My previous post was locked.
I won't suggest reading the FAQ, as you mention alread doing that. However, you do not describe your problem here, nor do you detail what you have already done to find out where the problem is. And no, I do not feel like checking another thread, locked for good reason, to find out. If you need help, detail what the problem is and what you already did to solve it.If anyone knows any other solution for working constant strings please please please post your reply.
EDIT: I did read the previous post, and you indeed do not seem to have done any debugging.
JAL
- 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: Constant strings are not not working [this is not a FAQ]
Since any reply is appreciated, maybe this helps:
Re: Constant strings are not not working [this is not a FAQ]
@Combuster: LOL
Chandra,
Did you allready debug your os at the point where things go wrong? Have you ever considered to do any research in or on your code? As for what I read in your post, you did nothing like that. At which offset does your string reside in the executable, where is it loaded at boottime? In other words, know what you should expect from your code and check if your expectations are met. Check the cpu's registers using the Bochs debugger. You have to know why it doesn't work, and it has probably nothing to do with your linker, since that is just an assumption that you're making.
Good luck with finding the source of your problem.
~Greetz~
Chandra,
Did you allready debug your os at the point where things go wrong? Have you ever considered to do any research in or on your code? As for what I read in your post, you did nothing like that. At which offset does your string reside in the executable, where is it loaded at boottime? In other words, know what you should expect from your code and check if your expectations are met. Check the cpu's registers using the Bochs debugger. You have to know why it doesn't work, and it has probably nothing to do with your linker, since that is just an assumption that you're making.
Good luck with finding the source of your problem.
~Greetz~
Re: Constant strings are not not working [this is not a FAQ]
Thanks for suggesting me to debug. Yeah, I found what was the problem, the problem was with the compiler's 16 bit generated code. It put my constant string somewhere else neither at the code segment nor at the data segment. I recently resolved the problem and the solution was to jump to 32 bit mode.
And it worked .............................
And it worked .............................
Programming is not about using a language to solve a problem, it's about using logic to find a solution !