How to make arch_decomp_wdog function able to run in both physical/virtual memory
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to make arch_decomp_wdog function able to run in both physical/virtual memory
Is there some easy way I can detect if the kernel is running in physical memory (kernel decompression) or in virtual memory (initramfs decompression). The reason for this, is that I would like to implement an arch_decomp_wdog function that kicks the CPU HW watchdog using calls that are available in each mode.
The kernel always runs in (non-paged) physical memory.
I haven't looked at this, but logically the decompression will take place before the initramfs is invoked. Think about what happens if the initramfs is embedded in the kernel itself.
In its magickal world, "'the system,' as it were, 'really does not exist yet.'" Uh huh. "The BIOS has done its thing, and then grub (or lilo) has done its thing, but we're just not quite ready yet."
In that magickal, transcendental, but nevertheless very necessary state, "all bets are off, and it is understood." Therefore, "if you are there, then it is presumed that you know that you are there, and you therefore have no need to 'detect' it."
My advice: choose one appropriate moment, and therefore one appropriate environment, in which to unleash your friendly dogs.
From a cursory look, nothing too magical.
The boot-loader loads it (and the kernel obviously), and updates the kernel header record with the address and size of the initrd(fs).
The bootloader branches to the kernel which uncompresses itself and does its thing. If an initrd was passed, it gets mounted and (initrd) init run. Just looks like an early userspace prior to the real root being mounted.
Additional details on the arch_decomp_wdog question
Thanks for all replies so far!
Some additional details about the watchdog kick.
The system is an ARM9-based one where the CPU watchdog has been enabled from the bootstrap.
Depending on how far we have come with the kernel initialization, the MMU is either off or on.
It seems that we need to access the watchdog HW differently, depending on if we have the MMU enabled or not.
An untested attempt:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.