Well, I worked out the problem, but I dont know why it is a problem, I have two boot loaders, one is a two stage loader (this causes an error), the other one is a single stage loader (this one works), when I boot with the 2 stage loader I do not get exceptions or anything like that, the variables will just not increment (GDTs are identical in both), but when I use the single stage loader everything runs perfect.
This is very weird!!
Strange Behaviour in C
Re:Strange Behaviour in C
From what I learned in class, and on my own, if you icrement a pointer *foo++; you are actually changing the memory address it is pointing to by the bit value of the primitive on which the pointer is based. So, a char pointer should increment 8-bits.
Re:Strange Behaviour in C
try:
it's just an idea, but may work.
Code: Select all
*(++video)
Re:Strange Behaviour in C
Perhaps the compiled code is assuming something about the stack and hasn't be initialised properly?
- Nick
- Nick
Re:Strange Behaviour in C
Perhaps you are right Nick, in the two stage loader I define a segment specifcally for the stack, and the base is not zero.
But in the signle stage loader, my data segment is used for the stack, and it is zero based.
I will try this and let you know.
Thanks.
But in the signle stage loader, my data segment is used for the stack, and it is zero based.
I will try this and let you know.
Thanks.
Re:Strange Behaviour in C
Well that didn't take long, and guess what, Nick is now a genius in my book, because he was spot on the money.
Good stuff, that saved me alot of bug searching.
;D ;D
Thanks Nick, and everyone else who tried to help me.
Good stuff, that saved me alot of bug searching.
;D ;D
Thanks Nick, and everyone else who tried to help me.