uint8,uint16,uint32???

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

uint8,uint16,uint32???

Post 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.
Unkn0wn1
Member
Member
Posts: 37
Joined: Fri Jan 13, 2012 11:18 am

Re: uint8,uint16,uint32???

Post 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)
Not sane
Just remember, FIND Is Not DOS :)
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

Re: uint8,uint16,uint32???

Post by Yashas »

What are they usedfor and can we use unsigned int instead of unsigned short int?
Unkn0wn1
Member
Member
Posts: 37
Joined: Fri Jan 13, 2012 11:18 am

Re: uint8,uint16,uint32???

Post 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
Not sane
Just remember, FIND Is Not DOS :)
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

Re: uint8,uint16,uint32???

Post 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.
Unkn0wn1
Member
Member
Posts: 37
Joined: Fri Jan 13, 2012 11:18 am

Re: uint8,uint16,uint32???

Post 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
Not sane
Just remember, FIND Is Not DOS :)
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

Re: uint8,uint16,uint32???

Post 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.
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: uint8,uint16,uint32???

Post by brain »

To be honest id love to see some ntfs code :-) I have some other stuff you don't that we could "trade" ;-)
Yashas
Member
Member
Posts: 45
Joined: Sun Feb 05, 2012 5:19 am
Location: India
Contact:

Re: uint8,uint16,uint32???

Post 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
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: uint8,uint16,uint32???

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: uint8,uint16,uint32???

Post by bluemoon »

http://en.wikipedia.org/wiki/C_data_types, See Fixed width integer types which include (u)intN_t.
Unkn0wn1
Member
Member
Posts: 37
Joined: Fri Jan 13, 2012 11:18 am

Re: uint8,uint16,uint32???

Post by Unkn0wn1 »

Ooops... Well, I haven't really got into that stuff, and in this case, it is, so I kinda made stupid assumptions...
Not sane
Just remember, FIND Is Not DOS :)
Locked