Page 1 of 1

strange things happening!

Posted: Thu Nov 14, 2002 10:02 pm
by adeelmahmood1
well i have noticed a few things going on which are quite strange for me atleast .. first of all i have my function prototypes in the header files and function defintions in the main kernel and its working fine

but if i try to put those function definitions in the header file along with the prototypes and just call them from main .. it doesnt works .. can some one explain WHY ??

secondly with a few things my kernel size got 8704 bytes ( 2200 H ) .. and even when i add so much stuff in the kernel it is still of same size ??

i mean first of all it should not be that much big and secondly OK if it is that much big than why doesnt the size changes by adding code and variables into it?

i know these questions are not so important .. but when u r working on that lower lovel i think u should care about every single thing ..
thanx for ur help

Re:strange things happening!

Posted: Thu Nov 14, 2002 11:23 pm
by Schol-R-LEA
adeelmahmood1 wrote: well i have noticed a few things going on which are quite strange for me atleast .. first of all i have my function prototypes in the header files and function defintions in the main kernel and its working fine

but if i try to put those function definitions in the header file along with the prototypes and just call them from main .. it doesnt works .. can some one explain WHY ??
Not without knowing what you mean when you say "it doesn't work", no. If I had to give an answer, I'd say it's probably because of a linking problem, but that's a WAG and not a solid solution. Can you provide more details about the problem, please? Pertinent information would include where the failure occurs, what error messages are given (if any), what the symptoms and behavior are, among other things. It would also help if you could SMTC, too, of course.
secondly with a few things my kernel size got 8704 bytes ( 2200 H ) .. and even when i add so much stuff in the kernel it is still of same size ??

i mean first of all it should not be that much big and secondly OK if it is that much big than why doesnt the size changes by adding code and variables into it?
Again, without seeing the code I couldn't answer for certain, but my guess is that, rather than reading the specific sectors which the kernel is in, you are scarfing up the whole of track 0, head 0 (minus the boot sector) at a single burst. This would read in 17 sectors, which would be exactly 2200h bytes. Since the area you are reading is considerably larger than the kernel, the kernel size doesn't affect it; most of what is being read in is empty space.

Remember, because disk accesses are by sector, the size of anything you read in from disk will be in a multiple of 512 bytes (or whatever your sector size is set to), no matter what the size of the actual data is. This will become an issue when you implement your file system, as you will need to keep track not only which sectors are used by a file but also how much of the last sector it uses. Something to keep in mind.