8-bit byte array

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.
Post Reply
WookiePaw
Posts: 5
Joined: Sat Nov 15, 2014 9:44 am

8-bit byte array

Post by WookiePaw »

Hello all,

I am new around here and am currently writting a FAT driver from the specs. I came across a part in it that said an array was (as the title says) an 8-bit byte array. How would you do this? Would just making an array of pointers work?

Thanks for your time.


Best Regards,


EDIT: I am working in 32-bit architecture. I am using C, and I am used to writting userspace application, so please cut me just a tiny bit of slack :D
Last edited by WookiePaw on Sun Nov 16, 2014 10:52 am, edited 1 time in total.
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: 8-bit byte array

Post by no92 »

What language do you want to use? What architecture are you working on? Without any of that (minimal) information, there is no way we can help.

Assuming you will probably use C or Assembly, this should tell you that have not the required (very good) knowledge you have to have to do anything OSdev-related.
WookiePaw
Posts: 5
Joined: Sat Nov 15, 2014 9:44 am

Re: 8-bit byte array

Post by WookiePaw »

Just edited the Original Post :D
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: 8-bit byte array

Post by iansjack »

Which bit of the spec are you talking about? Can you link to it (or quote it) telling us which bit you are having difficulty with?
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: 8-bit byte array

Post by no92 »

iansjack wrote:Which bit of the spec are you talking about? Can you link to it (or quote it) telling us which bit you are having difficulty with?
Even though this is not absolutely required, you should always provide a link to the docs. Any information that will help us to help you.

Now, this question is exactly one Google-search away from an answer. Tip: you have to look for something that stores 8-bit-wide data on your development environment :D
WookiePaw
Posts: 5
Joined: Sat Nov 15, 2014 9:44 am

Re: 8-bit byte array

Post by WookiePaw »

The spec is FATgen103.doc. I was thinking of doing something like this:

u8int **Array[8];

Would that work for this instance? Thanks for the help guys!

PS: The refrence is from page 16, paragraph 1.
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: 8-bit byte array

Post by max »

WookiePaw wrote:The spec is FATgen103.doc. I was thinking of doing something like this:

u8int **Array[8];

Would that work for this instance? Thanks for the help guys!

PS: The refrence is from page 16, paragraph 1.
No, "8-bit byte array" most probably means a plain array of a type that has a size of 8 bits. What you just created there is an array containing 8 pointers to pointers to u8int's :P
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: 8-bit byte array

Post by Combuster »

Considering you claim to have userspace experience, you would at least know what C type to use when you read a regular binary file.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: 8-bit byte array

Post by iansjack »

That document is just saying that you read the sector into a buffer which is an array of bytes. Those bytes are the usual 8-bit bytes. (You might think that is redundant - it isn't.)
WookiePaw
Posts: 5
Joined: Sat Nov 15, 2014 9:44 am

Re: 8-bit byte array

Post by WookiePaw »

Ok, whoops. I though it was saying I need an 8-byte array of 8-bit items. Silly silly me #-o

Anyway, thanks guys :D
Post Reply