‫Hello and welcome, guys, in this lecture, we are going to implement a kernel panic, so what is the
‫kernel panic?
‫Essentially, if we can detect something's gone wrong and we cannot recover from it, we can call the
‫panic function, which is similar to print like we've done here.
‫Print Hello, world.
‫Right.
‫And what the panic function will do is it will print a message to the screen and then it will hold the
‫kernel so the kernel can continue.
‫So this is not a very difficult function to implement and we are going to implement it now.
‫So just above Colonel Mean here, we're going to go avoid panic and it's going to accept a conjecture.
‫I will call it message and we just go print message.
‫Finally, we go wall one, this is an infinite loop like that, we now copy and paste this and put it
‫in the kernel da Sharifullah and we're now going to experiment with this just after hello will test
‫here.
‫We're going to go panic.
‫The system cannot continue error.
‫OK, we now make clean that build and we run it.
‫We see the system cannot continue.
‫Error, error.
‫So that is a system panic guys.
‫OK, and we can also just call the halt construction as well.
‫But this infinite loop will be just fine for this case.
‫Let's now remove that panic online A3 and there we go.
‫We've now implemented panic.
‫So now whenever we have a situation in the kernel that is unrecoverable, we will just panic the system.
‫So, for example, when we run out of memory, we can panic the system.
‫So the system halts something like that.
‫You know, although if we did run out of memory, we could probably find ways of gaining more like killing
‫processes.
‫But that's more advanced stuff, you know.
‫So, yes, simply put, the panic's used for one.
‫We cannot recover the kernel and that it's unsafe to continue.