Hello, when I use this code with ints ENabled, the computer reboots:
__inline__ unsigned inportb(unsigned port)
{
unsigned ret_val;
__asm__ __volatile__("inb %w1,%b0"
: "=a"(ret_val)
: "d"(port));
return ret_val;
}
why?
Inportb and reboot:
Re:Inportb and reboot:
Because it's wrong somehow.
We can't tell why though. That single function looks correct to me.
We can't tell why though. That single function looks correct to me.
Re:Inportb and reboot:
there are 2 % in registers.Tom wrote: Hello, when I use this code with ints ENabled, the computer reboots:
__inline__ unsigned inportb(unsigned port)
{
unsigned ret_val;
__asm__ __volatile__("inb %w1,%b0"
: "=a"(ret_val)
: "d"(port));
return ret_val;
}
why?
Try like this :
Code: Select all
__inline__ unsigned inportb(unsigned port)
{
unsigned ret_val;
__asm__ __volatile__("inb %%w1,%%b0"
: "=a"(ret_val)
: "d"(port));
return ret_val;
}
and download it at : http://boost.zaphebergeur.net/indexo.php?page=dl
Re:Inportb and reboot:
why would the %'s have to do anything if it works With Out ints disabled? I think it's just my silly IDT I had...trying a new IDT...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Inportb and reboot:
i don't know how your code is relocated, but the DW IRQx in your IDT table is likely to trouble most linkers ... maybe you should check your loaded IDT is looking like what you expect ...
Re:Inportb and reboot:
I found this one that nu...(forgot the rest of is post name) uses on some OS dev site...testing that...I think it works but I forgot to put code to print a message if the IDT was loaded :-[
Anyway...i'll test it in a bit....
Anyway...i'll test it in a bit....