Kernel panic error occur when Os missing the booting files or can not communicate with hardware or Os related files.mainly these file it will be as a grup.conf or system unable to find the root file system.
Reason for Kernal Panic Error
Hard ware failure
unable to fine the root file system
Missing boot file >> /boot/grup/grup.conf and /etc/fstab or /boot