Hello,
I'm trying to modify kernel buffers on kernel 4.2.19...
so I added one double type variable in "struct buffer_head" at fs.h
But whenever I compiled and referenced that variable, os even cannot boot and show me kernel panic screen..
error message is:
Partition check:
sda:<1>Unable to handle kernel NULL pointer dereference at virtual address 0000005c
printing eip:
c013a1e9
*pde = 00000000
Oops:0002
and registers, stack, call trace goes.
in my guess, there are fixed size of "struct buffer_head",
so it cannot accept my modification....maybe
or are there something I don't know? I need some help.
registers, stack, call trace
registers, stack, call trace are all the information you get about what happened, this is the most important part of an oops report.
did you really recompile all sources that refer fs.h? you have to make sure every place where the modified structure is allocated or used is recompiled with the new structure layout, or else different parts of the kernel talk about different memory locations for variables.
you cannot use floating point in the kernel, this includes the type 'double'.
why?
I think I saw many floating point type variables in kernel source..
are there any restriction?
yes
yes. see Documentation/HOWTO (3rd paragraph of the introduction) or the kernel-hacking document that is compiled from Documentation/DocBook/kernel-hacking.tmpl (chapter 3):
http://kernel.org/doc/htmldocs/kernel-hacking.html
what you probably saw were save areas or the FPU emulator? there is some code using MMX registers, but these are working on relatively large datasets (thus the MMX optimization) and you can afford the overhead for saving/restoring the status and watching for context switches. for single variables this is nonsense, choose a suitable unit (nanoseconds, lightyears) and use integers.
thanks a lot
:)