Page 1 of 1

8-bit byte array

Posted: Sun Nov 16, 2014 10:34 am
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

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 10:45 am
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.

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 10:53 am
by WookiePaw
Just edited the Original Post :D

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 10:57 am
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?

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 11:00 am
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

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 11:36 am
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.

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 11:45 am
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

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 11:56 am
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.

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 12:50 pm
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.)

Re: 8-bit byte array

Posted: Sun Nov 16, 2014 1:16 pm
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