OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:09 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 2:39 am 
Offline
Member
Member
User avatar

Joined: Tue Jan 10, 2017 3:19 pm
Posts: 84
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]"

_________________
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1


Top
 Profile  
 
 Post subject: Re: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 2:45 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
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?


Top
 Profile  
 
 Post subject: Re: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 5:31 am 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
How did you manage to copypaste the code with mistakes?

I'm not really amazed, just tired by the SNR.

_________________
Learn to read.


Top
 Profile  
 
 Post subject: Re: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 5:36 am 
Offline
Member
Member
User avatar

Joined: Tue Jan 10, 2017 3:19 pm
Posts: 84
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. :P

I need to fix my IDT code though. It triple faults the system for whatever reason.

_________________
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1


Top
 Profile  
 
 Post subject: Re: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 5:51 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: large integer implicitly truncated to unsigned type
PostPosted: Thu Jan 12, 2017 5:53 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group