Re: how to freeze the 2.6 kernel on SMP m/c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 5, 2011 at 17:24, san deep <sandeep.albur@xxxxxxxxx> wrote:
> Hi,
>
> Could you please suggest  how to freeze  the 2.6 kernel(SMP m/c) with
> my own dlkm with  less number of code.
>
> I tried the below mentioned code snippet, it hangs only the terminal
> on which i executed the insmod command.
>  Please correct the below code to freeze whole kernel.
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/spinlock.h>
> #include <linux/delay.h>
>
> int init_module(void)
> {
>        spinlock_t lock = SPIN_LOCK_UNLOCKED;
>        while (1) {
>                spin_lock(&lock);
>                msleep(100);
>         }
>        //spin_unlock(lock);
>        printk(KERN_INFO "Hello world :).\n");
>        return 0;
> }

how about calling panic()?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux