Some errors

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
Unexpected

Some errors

Post 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
Tim

Re:Some errors

Post 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.
Unexpected

Re:Some errors

Post by Unexpected »

1. Is there bug in jumping to pmode?
2. I mean, can I declare === as strcmp() ?
Whatever5k

Re:Some errors

Post 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.
Tim

Re:Some errors

Post 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.
Unexpected

Re:Some errors

Post by Unexpected »

Here is my boot loader source.

[attachment deleted by admin]
Whatever5k

Re:Some errors

Post 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
Unexpected

Re:Some errors

Post by Unexpected »

Anyone look at my source ? :(
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Some errors

Post 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 ...
Unexpected

Re:Some errors

Post 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.
beyondsociety

Re:Some errors

Post by beyondsociety »

Try adding a STI after setting up your real-mode stack. I see that you have a CLI but no STI.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Some errors

Post by Pype.Clicker »

a pmode second stage ? how will it load your kernel ? using VM86 or something alike ?
Unexpected

Re:Some errors

Post 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]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Some errors

Post 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 ...
Post Reply