but for harddisk (whose partition is also the rootfs) /dev/sda is created during kernel booting up (inside the initrd file, just gunzip and extract out the cpio file, eg, view the file scripts/local and u can see it make the /dev/sdXXXX nodes based on /sys/block/XXXX information, which in turn depends on the kernel calling xxxx_device_register() functions (there a few variations of them - organized hierarchically)).
on the other hand, if /dev/sda is not the rootfs, but just a normal harddisk listed in /etc/fstab, then likely it is mounted by udev, detecting it, and then calling (indirectly from userspace to kernel) sd_probe_async(), which will then printk() out the "Write Protect is off" message in your dmesg output - anytime u plug in the harddisk u can see this.
--
Regards,
Peter Teoh
On Wed, Feb 6, 2013 at 1:26 AM, horseriver <horserivers@xxxxxxxxx> wrote:
hi:)
During booting period .every device will have a node at /dev/ folder.
what is the detail of ths procedure?
thanks!
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Regards,
Peter Teoh
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies