In particular, I'd like to add a fd flag and a branch in a couple of fd-handling syscalls that should be used if the flag is set instead of the current code. I think the only thing that matters here for the purposes of this question is that this should be a generic rather than hardware specific modification.How do I set things up so that I can rebuild the modified kernel and test the new feature quickly? I figure I need a basic setup that'll boot in a virtual machine and run my test code, which I guess could be simply in initram and the boot might not need to go any further (?)Are there any good guides on this or can you explain it in a single answer here?
How do I quickly build and test the kernel if I want to modify a system call
linux;kernel
eudyptula-boot is quite handy for this; its introductory blog post has more details, but basically it allows you to boot a VM using the kernel you wish to test, and your existing filesystems (using overlayfs). That way you can quickly check a kernel without rebooting, and you still have access to all your files.The only requirement on the kernel being tested is that it support overlayfs and 9p; these are easy to activate in the kernel configuration before building it.