Page 1 of 1

uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 5:50 am
by Yashas
:?:
What are these?
Are those a C feature or should we define it, for example unsigned short int uint8.
i find those most of the code in osdev.

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 6:02 am
by Unkn0wn1
They're typedefs, often used for portability.

Code: Select all

typedef unsigned char uint8;
typedef unsigned short int uint16;
typedef unsigned int uint32;
typedef unsigned long int uint64;
EDIT: Added semicolons (Oops! I'm not much of a C guy, more into ASM)

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 6:04 am
by Yashas
What are they usedfor and can we use unsigned int instead of unsigned short int?

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 6:09 am
by Unkn0wn1
Depends. You in real mode?

EDIT: They are used so that you only really have to use a different compiler and ASM on different platforms. You can change those typedefs as needed in each arch

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 6:16 am
by Yashas
Mine is protected mode(32 bit) vey powerful with ATA,IDE,VGA.But i never used these so i wanted to know what are those.

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 6:20 am
by Unkn0wn1
Then no. Long is twice CPU-bit, Short is half, char is 8 bits (Size of an ASCII character...)

I state it in this thread as well. I doubt you got all those features. A disk image would be good, or source, as proof

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 7:51 am
by Yashas
Tell me which driver you want ATA,AHCI,IDE(Comes in AHCI),NTFS(Little Dumb can just read)

Even i kno long is twice.I was showing some i did not kno the number 8 in the uint8 was the niumber of bits.

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 8:02 am
by brain
To be honest id love to see some ntfs code :-) I have some other stuff you don't that we could "trade" ;-)

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 8:14 am
by Yashas
Just wait for a week I will post it here.Becaz i hav just started.
And also i ahv posted the base of the NTFS Code somewhere the forume today.

Mostly it the Keyboard Topic

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 12:50 pm
by Brynet-Inc
Unkn0wn1 wrote:Then no. Long is twice CPU-bit, Short is half, char is 8 bits (Size of an ASCII character...)
Wow, talk about the blind leading the blind.

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 12:54 pm
by bluemoon
http://en.wikipedia.org/wiki/C_data_types, See Fixed width integer types which include (u)intN_t.

Re: uint8,uint16,uint32???

Posted: Sun Feb 05, 2012 3:08 pm
by Unkn0wn1
Ooops... Well, I haven't really got into that stuff, and in this case, it is, so I kinda made stupid assumptions...