x86 bios/bootloader question / EOF question

Programming, for all ages and all languages.
Post Reply
@modi
Posts: 9
Joined: Thu Mar 29, 2007 6:12 am
Location: United States

x86 bios/bootloader question / EOF question

Post by @modi »

I have two questions:

1. How does the EOF file character work? Is it the same for all files, or does it change depending on the file? I was wondering because I was wondering if it is possible to inject into a file to prematurely terminate the file, such as in a web application that takes client input and stores it in a file and what exploits of this kind to watch out for.

2. I want to learn to write an x86 bios/bootloader (are bios and bootloader the same thing?). What are some good places to start (books or websites)? Also, does Intel have any official specifications of this kind on their website?
Last edited by @modi on Fri Mar 30, 2007 12:37 am, edited 1 time in total.
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Post by ~ »

Nothing is the same. Those are too generic. I will make my own wiki so to document that and get away from nonsignificative xploits. See my profile =;
@modi
Posts: 9
Joined: Thu Mar 29, 2007 6:12 am
Location: United States

Post by @modi »

That didn't help at all. If the wiki you refer to existed and could answer my questions better than this forum, I would have ended up on it instead of this forum when I was searching Google. Please refrain from replying to my posts unless you are going to answer my questions or tell me why they shouldn't or won't be answered. As a side note, it's not polite to call other people's concerns non-significative unless 1. they are and 2. there is a justifiable reason for considering the person's concerns non-significative and the person is aware (or should be aware) of this reason. Even if, as you claim, my concerns are non-significative, there is no reason why I should have prior knowledge of this nor is it something I need to "get away" from as this is an operating systems development forum.
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Post by ~ »

OK, let's go by steps.

2. I want to learn to write an x86 bios/bootloader (are bios and bootloader the same thing?). What are some good places to start (books or websites)? Also, does Intel have any official specifications of this kind on their website?
Why do you think that bios and bootloader are the same thing? Again, I have uploaded ZIPs with bootloader tutorial code in my site which can be seen in my profile, that's what I used to learn and is public domain code.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: x86 bios/bootloader question / EOF question

Post by Solar »

@modi wrote:1. How does the EOF file character work?
There is no such thing as an "EOF character" in the file itself.

Look closely at the C functions used for character I/O. They deliver either a character value between 0 and 255 (the full range of possible values for a 8-bit value), or EOF (which is negative, usually -1). That is the reason why the return value of character functions is int instead of char.

The EOF value is not part of the on-disk file, it is a special value the system uses to signal that there are no more characters to be read. Point in case, you don't write an "EOF character" to file before closing the file, either. (You can't, because you cannot putchar( -1 ), or rather, because that would be cast to char before being written.)

Bottom line, there are no "exploits" to be feared due to "embedded EOF".
Every good solution is obvious once you've found it.
Post Reply