Help with comparing strings from different segments

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
heatsync
Posts: 1
Joined: Fri Feb 07, 2020 6:18 pm

Help with comparing strings from different segments

Post by heatsync »

Hi, I've asked this question on stackoverflow.com with no real help, and I've asked on the osdev subreddit, but all I got were up votes and no real help either. (no idea why I have so many up votes..... Seems like a noob problem that I'm having), so I'm asking here in hopes of some legitimate help.

Firstly, my bootstrap code :
https://pastebin.com/FmWwfEXk

Now, my boot sector is supposed to set CS, DS, SS to zero, and have ES to 07E0 to load my real mode DOS clone. After jumping to the start of it and after relocation, it sets CS, DS, SS accordingly.

But, running under the bochs debugger... Nothing is read, nothing after checking the root for the system file.

I cannot grasp what is wrong. Am I not understanding segmentation correctly....... ES=07E0, BX=0 is 7E00 right....same with ES:DI, no? Literally spent two days trying to understand what's wrong and it's driving my head nuts.

Shifting an offset to the right by 4 (div 16/10h) will create a segment, right? Because the three reading works when I zero All segments, but fails when I create a segment out of a label. No idea if it's writing to bogus memory or not

It looks correct, but obviously not.

Thanks for any help...... No idea how much I appreciate it.....
Octocontrabass
Member
Member
Posts: 5578
Joined: Mon Mar 25, 2013 7:01 pm

Re: Help with comparing strings from different segments

Post by Octocontrabass »

heatsync wrote:ES=07E0, BX=0 is 7E00 right....
Right, but you're doing ES=07E0, BX=7E00.
Post Reply