The weirdest thing to-date!
The weirdest thing to-date!
I just finished kPrint and just added a function to clear the current line (wraps to top like Clicker32). Now get this: the BOCHS BIOS panics and kills the program for _NO REASON_. In the log it complains about a "unknown" command. Here is the gotcha', it quits in real mode. WTF? I don't know what's up, but when I disable the clear-current-line, it works fine. Just _calling_ it is fatal. I tried increasing inital stack space, but this didn't help. I'm using just the everyday kPutChar and For stuff. (everything goes to kPutChar for the wondering). Code is avilable on request.
Cheers, DH.
PS. I'm weirded out ;P
Cheers, DH.
PS. I'm weirded out ;P
Re:The weirdest thing to-date!
requesting code...
Re:The weirdest thing to-date!
None that you are aware of.Dragon_Hilord wrote:Now get this: the BOCHS BIOS panics and kills the program for _NO REASON_.
Contrary to popular belief, computers still are deterministic. If you can't see a reason for something, you are not in posession of all the facts.
Like, your source code.
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:The weirdest thing to-date!
i'd suspect a non-terminating loop here that would be clearing everything, including your code.
here again, activating "trace-on" might help figuring out what occured before the crash...
here again, activating "trace-on" might help figuring out what occured before the crash...
Re:The weirdest thing to-date!
Computers are not fully deterministic, but each component in itself is deterministic. IE, if you do A, you get B.Solar wrote:None that you are aware of.Dragon_Hilord wrote:Now get this: the BOCHS BIOS panics and kills the program for _NO REASON_.
Contrary to popular belief, computers still are deterministic. If you can't see a reason for something, you are not in posession of all the facts.
Like, your source code.
Bochs is however fully deterministic in that if a timer interrupt occured at exactly cycle X the last time, it will do that too this time. The sole few undeterministic events are keypresses etc. If you don't use them, it should give the same result / crash each time.
Re:The weirdest thing to-date!
I will put the code up on sourceforge soon (for ease).
There are two things in the log of interest:
1) Unknown opcode
2) FDD not avilable
3) Some unnamed exception.
I'll try to have the code up withen the week ;D
There are two things in the log of interest:
1) Unknown opcode
2) FDD not avilable
3) Some unnamed exception.
I'll try to have the code up withen the week ;D
Re:The weirdest thing to-date!
OT: Add http:// at the front of your link to "SJ High School!"
Re:The weirdest thing to-date!
I'm gonna put some code in from memory (psudo code) to help give the idea:
Cheers, DH. Hope this helps some (this is the VERY basic system that is used before a console module is created and loaded, which is used forever after).
[edit]I was just sifting through the quicklinkz and found this:
[/edit]
Code: Select all
File: Screen.c
unsigned int _X;
unsigned int _Y;
kPutChar(y, x, color, character);
kPrint(fmt* ...)
{
loop through fmt{
if char, call _PrintChar(char)
if int, call _PrintInt(int)
if str, call _PrintStr(str)
if hexint, call _PrintIntHex(int)
Allelse: _PrintChar(char)
}
}
_CheckScreen()
{
is _X <= MAXWIDTH?
yes: _X=0
_Y++
is _Y <= MAXHEIGHT?
yes: _X=0
_Y=0
is _X = 0?
yes: ClearLine(_Y) <--Remove this and all runs honkey-dorey!
}
_PrintChar(char)
{
kputchar(_Y, _X, char)
_X++
_CheckScreen()
}
_PrintInt(int)
{
Process to character
_PrintChar(intcharacter)
_CheckScreen() <-- There is probably more code I don't remember
}
_PrintIntHex(int)
Process to character
_PrintChar(inthexcharacter)
_CheckScreen()
}
_PrintStr(str)
{
for each character in string
_PrintChar(char)
}
_ClearLine(line)
{
int i
for (i=0;i<MAXWIDTH;i++)
kPutChar(line, i, 0xFFF, ' ') <-- 0xFFF universial color for normal color
}
[edit]I was just sifting through the quicklinkz and found this:
I _WAS_ having this problem, then changed the code (increased the stack to 32k (see barebones)). Strangly enough, when I changed the code in _ClearLine, and reverted to 16k stack, it still crashed with a different result. *grumble* I'm gonna _HAVE_ to go through ALL my source files, attach the GPL notice, and setup a sourcefoege account and project before I can have the code up for you all *grumble*.running in bogus memory: you sent your code pointer (eip) to some uninitialized memory area. This means either you followed a null/uninitialized pointer, or damaged the return address of your stackframe. Make your code more clean, test pointers before you follow them, initialize every pointer, especially those who are on the stack, and enable -Wall.
[/edit]
Re:The weirdest thing to-date!
Might there be a problem with counting?Dragon_Hilord wrote: I will put the code up on sourceforge soon (for ease).
There are two things in the log of interest:
1) Unknown opcode
2) FDD not avilable
3) Some unnamed exception.
I'll try to have the code up withen the week ;D
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:The weirdest thing to-date!
i see something potentially harmfull ... "clearline" calls "check screen" and "checkscreen" calls printline ...
hmm hmm ...
not 100% sure but could that lead to stack overflow ?
hmm hmm ...
not 100% sure but could that lead to stack overflow ?
Re:The weirdest thing to-date!
NOW THAT COULD BE IT! I don't remember if kPrintChar calls CheckScreen or not. I'll check asap! Thanks pype ;D
cheers, DH.
PS. I'm gonna download the latest clicker ;D
cheers, DH.
PS. I'm gonna download the latest clicker ;D
Re:The weirdest thing to-date!
Here is my kprintf code...
only supports %u and %x up to now...but it does what I need.
only supports %u and %x up to now...but it does what I need.
Code: Select all
int kprintf(char *message, ...)
{
int i=0;
char buffer[10];
char *buffer_ptr;
va_list data;
va_start(data, message);
while (*message) {
if (*message == '%')
{
unsigned int num = va_arg(data, unsigned int);
message++;
switch(*message)
{
case 'u':
buffer_ptr = buffer + 9;
*buffer_ptr = '\0';
do
{
unsigned long temp;
temp = (unsigned long)num % 10;
buffer_ptr--;
*buffer_ptr = temp + '0';
num = (unsigned long)num / 10;
}
while(num != 0);
while (*buffer_ptr)
putch(*buffer_ptr++);
break;
case 'x':
buffer_ptr = buffer + 9;
*buffer_ptr = '\0';
do
{
unsigned long temp;
temp = (unsigned long)num % 16;
buffer_ptr--;
if (temp < 10)
*buffer_ptr = temp + '0';
else
*buffer_ptr = temp - 10 + 'a';
num = (unsigned long)num / 16;
}
while(num != 0);
buffer_ptr--; *buffer_ptr = 'x';
buffer_ptr--; *buffer_ptr = '0';
while (*buffer_ptr)
putch(*buffer_ptr++);
}
message++;
}
else
putch(*message++);
}
va_end(data)
return 0;
}
Re:The weirdest thing to-date!
May the bells ring and banners fly! Fixed at last and fully operational! ;D Thank go out to all who helped. (FYI, it was my kScreenLocate command, called by _ClearLine, was calling _ScreenCheck, and so on.)
Note to n00bs: Read your code before you come to the forum, it's probably something obvious, like this
Cheers, DH.
Note to n00bs: Read your code before you come to the forum, it's probably something obvious, like this
Cheers, DH.