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?
x86 bios/bootloader question / EOF question
x86 bios/bootloader question / EOF question
Last edited by @modi on Fri Mar 30, 2007 12:37 am, edited 1 time in total.
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.
OK, let's go by steps.
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.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?
Re: x86 bios/bootloader question / EOF question
There is no such thing as an "EOF character" in the file itself.@modi wrote:1. How does the EOF file character work?
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.