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.
thehardcoreOS wrote:Wait wait wait wait. You said "volatile"? I did not mark my coordinates as volatile. When I do that I get: error: conflicting type qualifiers for ‘mouse_x’
I already checked IDT and GDT, they seem fine to me. (using info xyz)
Volatile simply tells the compiler to not optimize out the variables / code whatever you use it on.
For variables it also stops "precaching" the value into registers and on each use it will get loaded again from memory now.
Make sure the IRQ is called, and if it is, please post the code your using to get the mouse coords.
Also make sure its ONLY called when you move the mouse or click a button.
thehardcoreOS wrote:Wait wait wait wait. You said "volatile"? I did not mark my coordinates as volatile. When I do that I get: error: conflicting type qualifiers for ‘mouse_x’
I already checked IDT and GDT, they seem fine to me. (using info xyz)
Volatile simply tells the compiler to not optimize out the variables / code whatever you use it on.
For variables it also stops "precaching" the value into registers and on each use it will get loaded again from memory now.
Make sure the IRQ is called, and if it is, please post the code your using to get the mouse coords.
Also make sure its ONLY called when you move the mouse or click a button.
Here is my code(idt,gdt,isr,irq,mouse,kernel): http://pastebin.com/PuFbn8CG
Please see if everything is okay with it.
Note: this code does not have any syntax errors, that is not the problem.
If you see any errors, pointless code, junk code, etc... please tell me
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
In all these years, I never had a proper excuse to use this until now... I guess that also means you've got the questionable honour of taking the new world record low home today.
I also spy half a dozen bugs that would be covered by compiler warnings. You are not free to ignore these; please pass the following to the compiler to see how broken your code actually still is:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Combuster wrote:In all these years, I never had a proper excuse to use this until now... I guess that also means you've got the questionable honour of taking the new world record low home today.
I also spy half a dozen bugs that would be covered by compiler warnings. You are not free to ignore these; please pass the following to the compiler to see how broken your code actually still is:
I think I mentioned for you to actually verify that your IRQ is being called back in the first page. Is this the first time you actually checked it, and if so, why did you wait so long? This problem could be resolved a lot sooner if you provide the requested information.
We also mentioned that you can't use IRQ 12 here since you remapped the PIC. In other words, this is wrong. (Think of what the PIC's actually do and where the PS/2 Mouse is connected. What, precisely, would the "12" here do and think about why it wouldn't work.)
neon wrote:I think I mentioned for you to actually verify that your IRQ is being called back in the first page. Is this the first time you actually checked it, and if so, why did you wait so long? This problem could be resolved a lot sooner if you provide the requested information.
We also mentioned that you can't use IRQ 12 here since you remapped the PIC. In other words, this is wrong. (Think of what the PIC's actually do and where the PS/2 Mouse is connected. What, precisely, would the "12" here do and think about why it wouldn't work.)