OSDev.org https://forum.osdev.org/ |
|
large integer implicitly truncated to unsigned type https://forum.osdev.org/viewtopic.php?f=13&t=31208 |
Page 1 of 1 |
Author: | DixiumOS [ Thu Jan 12, 2017 2:39 am ] |
Post subject: | large integer implicitly truncated to unsigned type |
I am trying to follow Bran's IDT tutorial (changing some things, of course). However, i get a overflow error (trying to fit a value that is larger than possible). How would i fix this overflow error? Current code as of now is at DixiumOS-1 repo here. Problem is located at interrupts/idt.c, function idt_install, at line Code: idtp.limit = (sizeof (struct idt_entry) * 256) - 1; "warning: large integer implicitly truncated to unsigned type [-Woverflow]" |
Author: | Octocontrabass [ Thu Jan 12, 2017 2:45 am ] |
Post subject: | Re: large integer implicitly truncated to unsigned type |
What is the value you are trying to assign to idtp.limit? What is the type of idtp.limit? What is the range of possible values for that type? |
Author: | dozniak [ Thu Jan 12, 2017 5:31 am ] |
Post subject: | Re: large integer implicitly truncated to unsigned type |
How did you manage to copypaste the code with mistakes? I'm not really amazed, just tired by the SNR. |
Author: | DixiumOS [ Thu Jan 12, 2017 5:36 am ] |
Post subject: | Re: large integer implicitly truncated to unsigned type |
dozniak wrote: How did you manage to copypaste the code with mistakes? I'm not really amazed, just tired by the SNR. Oops. Silly me. That fixed the problem, thank you. I need to fix my IDT code though. It triple faults the system for whatever reason. |
Author: | iansjack [ Thu Jan 12, 2017 5:51 am ] |
Post subject: | Re: large integer implicitly truncated to unsigned type |
DixiumOS wrote: I need to fix my IDT code though. It triple faults the system for whatever reason. 'Twas ever thus.So, fix it. Don't keep listing all of your mistakes; it just confirms people's opinion. |
Author: | Octocontrabass [ Thu Jan 12, 2017 5:53 am ] |
Post subject: | Re: large integer implicitly truncated to unsigned type |
DixiumOS wrote: It triple faults the system for whatever reason. Your function to install the ISRs calls the ISRs and places their return value to the IDT instead of placing the function pointer in the IDT. But it never gets that far, because the first ISR it calls has IRET in inline assembly, which tries to use the stack frame as a return address. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |