Instead of interrupts in PM?

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
Link

Instead of interrupts in PM?

Post by Link »

I´ve started writing a small "OS" and got a question. What should I do to get input/plot pixels and so one, since I´m in protected mode and cant use interrupts. whats the next step?
e.g., how do I wait for the user to press a key in PM
Link

RE:Instead of interrupts in PM?

Post by Link »

What I exactly mean is, that in other peoples source code, I´ve seen them using assembler and interrupts.. but when Im using interrupts in my kernel, the computer reboots..how come?
ezanahka

RE:Instead of interrupts in PM?

Post by ezanahka »

I use Bochs and reboots are usually the result of having too much unhandled exceptions. Rebooting is IMO a sign of having some kind of a serious bug in the code which resets the CPU through a triple fault or something equally serious.

With Bochs however you at least a good error message of what happened. The latest serious bug which I had that caused this kind of rebooting behaviour was having one wrong bit in a segment descriptor in the GDT. The error message helped me to fix the error by telling me exactly where the error was.

Are you sure that you have initialised every relevant thing for having interrupts working? PIC, IDT, IDTR?

There is no substitute for having understood and memorised almost everything about the CPU and the hardware. It helps you deal with bugs in your code... Currently that is exactly what I*m trying to do while also writing a short reference of everything relevant to OSDev hardware-wise...
JAAman

RE:Instead of interrupts in PM?

Post by JAAman »

you should get the Intel docs (if you dont have them) they will show all the details about the processor

you must assign the INTs to your own code -- they are invalid untill you do thats why its rebooting

you cannot use the bios INTs like you do in Rmode you have to write code to directly interface with the hardware and then (if you want) assign it to the INTs using the IDT (as discribed in the Intel Docs)
Post Reply