BOCHS: What can that be? Sometimes Memory Write isn't done

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
sebihepp
Member
Member
Posts: 194
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

BOCHS: What can that be? Sometimes Memory Write isn't done

Post by sebihepp »

Hello,

I have one problem with my Kernel. It seems that sometimes a Memory write isn't performed.

I have programmed a class that handles text output to 0xB8000. The class stores the
cursor position and updates the cursor. But: Sometimes If I write a text, only one char
either is missing and there is the old char(a space) or the cursor isn't updated, wich results
in that the char is overwritten, if it is not the last. But they occur only in Bochs and about
2 to 4 chars each screen (80x25).
I think it is a not performed write to memory. Either the char isn't written to 0xB8000, then it
left blank. Or if the cursor isn't updating the new value of the cursor position stored by the
class is not written.

I get no exception and no NMI. And the programm runs always fine. On real hardware I never
saw this phenomen.

Does anyone have an idea what that can be?

cheers
sebihepp
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: BOCHS: What can that be? Sometimes Memory Write isn't done

Post by AJ »

Hi,

Do you have SMP? I wonder if Bochs is showing up a bug that only appears if a lock isn't occurring in a timely manner.

Cheers,
Adam
sebihepp
Member
Member
Posts: 194
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: BOCHS: What can that be? Sometimes Memory Write isn't done

Post by sebihepp »

Well, very good idea.
But no, I have bochs compiled without specifying SMP.

I thought about Interrupts, but I searched many times through the code
and found nothing. Every used register is pushed and popped, ...
I think it can only be an interrupt. But on real Hardware this doesn't appear.

I will post the interrupt code later.

cheers
sebihepp
User avatar
Combuster
Member
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: BOCHS: What can that be? Sometimes Memory Write isn't done

Post by Combuster »

What AJ was talking about is not the potential bugs in your interrupt handling code, but rather the presence of a race condition, which in software requires a form of multitasking to show up.

From experience, bochs is more likely to show race conditions, since on average there are less instructions between external interventions
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply