Writing my own OS

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

fadi_jor
Posts:11
Joined:Sat Nov 15, 2008 5:33 pm

Post by fadi_jor » Sun Dec 07, 2008 8:11 pm

yes...It works :D

Thanks for all.

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Sun Dec 07, 2008 8:59 pm

No problem - thats what we are here for.

I think we need a tutorial on Intel vs AT&T asm syntax andor an FAQ for situations like this.
Image

fadi_jor
Posts:11
Joined:Sat Nov 15, 2008 5:33 pm

Post by fadi_jor » Mon Dec 08, 2008 12:18 pm

yes; that toutorial will be very useful.

Thank u for every things u did to help us.
bye;;;

fadi_jor
Posts:11
Joined:Sat Nov 15, 2008 5:33 pm

Post by fadi_jor » Wed Dec 10, 2008 2:48 pm

Hi all;

I need a help on how I can shutdown my system using C/C++ or assembly.

Thx

fadi_jor
Posts:11
Joined:Sat Nov 15, 2008 5:33 pm

Post by fadi_jor » Thu Dec 11, 2008 12:50 pm

Hi;
when I write:

Code: Select all

DebugPrintf ("\n precision %d",3.75);
it displays a huge random No.

I think the problem in the DebugDisplay.cpp:

Code: Select all

int DebugPrintf (const char* str, ...)

/*** integers ***/
					case 'd':
					case 'i': {
						int c = va_arg (args, int);
						char str[32]={0};
						itoa_s (c, 10, str);
						DebugPuts (str);
						i++;		// go to next character
						break;
					}

plz help me to display many digits Number!

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Fri Dec 12, 2008 1:12 am

Having not seeing this really large number, I am willing to bet that it's 1081081856

Am I right?




Here is how I made my guess:

You are passing a parameter of 3.75, which is a floating point value. Your DebugPrintf is interpreting it as an integer.

Because a computer can only deal with integers, it has no idea about floating points. Therefore, there exits the IEEE 754 standard for representing floating point values as integers.

http://en.wikipedia.org/wiki/Floating_p ... esentation has more information about the specific format of floating point numbers.

Enjoy

~Andrew
Image

Post Reply