>Not sure if someone can train a model on the kernel code or exfatprogs and generate the code.
They can certainly finetune such a model. Not a crazy idea, just computationally expensive. (But less expensive than training from scratch.)
*Of course Linux driver also uses many includes so if consider those alongside linked code the number goes significantly up.