Page 1 of 1

Some errors

Posted: Tue Apr 01, 2003 9:51 am
by Unexpected
Hi, I have two questions:
1. When I testing OS in BOCHS 2.0.2, it shows this message "00000960879p[CPU ] >>PANIC<< prefetch: RIP > CS.limit", what does it mean?

2. Can I use s1 === s2 instead of strmp(s1, s2), I mean use === as operator?

Thnx

Re:Some errors

Posted: Tue Apr 01, 2003 10:30 am
by Tim
Unexpected wrote:Hi, I have two questions:
1. When I testing OS in BOCHS 2.0.2, it shows this message "00000960879p[CPU ] >>PANIC<< prefetch: RIP > CS.limit", what does it mean?
In real mode, it means that IP has gone beyond 64KB.
In protected mode, it means that EIP has gone beyond the CS segment limit.
2. Can I use s1 === s2 instead of strmp(s1, s2), I mean use === as operator?
No. Why should you? === isn't an operator.

Re:Some errors

Posted: Tue Apr 01, 2003 11:14 am
by Unexpected
1. Is there bug in jumping to pmode?
2. I mean, can I declare === as strcmp() ?

Re:Some errors

Posted: Tue Apr 01, 2003 11:49 am
by Whatever5k
Unexpected wrote: 2. I mean, can I declare === as strcmp() ?
What programming language are you using? C++ supports overloading operators, I think that's what you want.

Re:Some errors

Posted: Tue Apr 01, 2003 5:23 pm
by Tim
Unexpected wrote:1. Is there bug in jumping to pmode?
Maybe. It's your code -- you tell me...
2. I mean, can I declare === as strcmp() ?
No. C++ doesn't let you define your own operators, nor does it let you override existing ones (so you can't define [tt]operator =(const char *, const char *);[/tt]). Stick with strcmp() or use the [tt]std::string[/tt] class.

Re:Some errors

Posted: Wed Apr 02, 2003 7:28 am
by Unexpected
Here is my boot loader source.

[attachment deleted by admin]

Re:Some errors

Posted: Wed Apr 02, 2003 8:26 am
by Whatever5k
abless wrote: What programming language are you using? C++ supports overloading operators, I think that's what you want.
Oups, not quite right. C++ only allows you to define the result of operators in combination with structs or classes.
Sorry for that

Re:Some errors

Posted: Thu Apr 03, 2003 5:26 am
by Unexpected
Anyone look at my source ? :(

Re:Some errors

Posted: Thu Apr 03, 2003 5:36 am
by Pype.Clicker
you should CLI before you enter pmode ... you have a STI @ done which is necessary for correct floppy reading, but i can't see any CLI after that ...

Re:Some errors

Posted: Thu Apr 03, 2003 8:40 am
by Unexpected
Added befor jumping to PMode CLI's but still I have "RIP > CS.limit" :(
Maby some problem in 2nd stage?
But in 2nd stage I coded only INT handlers and reloading GDT.

Re:Some errors

Posted: Thu Apr 03, 2003 2:52 pm
by beyondsociety
Try adding a STI after setting up your real-mode stack. I see that you have a CLI but no STI.

Re:Some errors

Posted: Thu Apr 03, 2003 3:28 pm
by Pype.Clicker
a pmode second stage ? how will it load your kernel ? using VM86 or something alike ?

Re:Some errors

Posted: Fri Apr 04, 2003 6:14 am
by Unexpected
No it in PMode, jus compiled as AOUT and I use it for functions that I can't use in C.. anyway here is a source.

[attachment deleted by admin]

Re:Some errors

Posted: Fri Apr 04, 2003 6:24 am
by Pype.Clicker
i definitely think you should try to find out what's the value of EIP at the time of the crash. Maybe you can also use "show call" (or something alike) in the bochs debug command line, to find out what called that buggy code ...

are you aware that flags are pushed and popped automagically by the CPU when a IRQ is handled ? and that IF is cleared before the interrupt handler is called ?

your CLI, STI PUSHF and POPF in IRQx_HANDLER are just confusing, imho...
(and dangerous as it will reenable interrupts before the previous one returns ... if your handler last too long, you might have a stack overflow quickly ...