A couple of things: 1) if you found no kernel code that does a generic power operation, have you wondered why? 2) are you sure you cannot rewrite 2^20 in some other way...? Hint: bit shifts. - With this said, look at the duplicate linked above if you really need to write a generic "2 to the power of N" or [here](https://stackoverflow.com/q/101439/3889449) for a generic "X to the power of Y" function.
– Marco BonelliNov 27 '21 at 13:44
You can't use any floating point functions in the kernel, because FPU registers are not saved during kernel calls.
– starkNov 27 '21 at 15:41