Foreword: I think my article is relatively simple. Some beginners can take a look, this is why I am not posting on the embedded version. For the master, if you don't take the time, hope can help me to see and give pointers to the mistakes. This is also the purpose of my coming here to communicate with you.
After the module driver is completed, the file system is mounted. I always thought: I compiled the kernel using the initrd mode, the device is loaded in the /linuxrc script under the RAM DISK file system, so a lot of time is wasted on this. However, I have a deeper understanding of initrd, and I will wait a minute. In fact, the first file system mounted by the kernel is root.cramfs in nand flash. The mount related code mount_root() is in the file /fs/super.c. Then mount the devcie file system under the /dev directory with the code mount_devfs_fs(). Because the noninitrd mode is used, the file system mount is complete, the init process continues down until it runs:
if (execute_command)execve(execute_command,argv_init,envp_init); here init switch Into another thread, the running program is defined in execute_command. Execute_command is the command line passed into vivi. You can see it during startup: Kernel command line: noinitrd root=/dev/bon/2 init=/linuxrc console=ttyS0 so execute_command corresponds to /linuxrc, so the program runs the script under the root directory. Linuxrc, in my system he corresponds: #!/bin/shecho "mount /etc as ramfs"/bin/mount -n -t ramfs ramfs /etc/bin/cp -a /mnt/etc/* /etcecho "re-create the /etc/mtab entries"/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock/3 //bin/mount -f -t ramfs ramfs /etcexec /sbin/init I will not explain (the last is to start bash), you can mount root.cramfs under linux under /mnt to see the content to know:
mount –t cramfs –o loop root. Cramfs /mnt/cramfs here actually want to tell everyone, how do we implement the boot automatically load some running programs, now it should be very clear, write a script is OK. (In fact, I have been in the yy problem before) Finally, I will not talk about the principle of initrd (initail ram disk), clichés, and many online. I will understand my understanding that initrd contains some of the module drivers, which share the size of the kernel to a certain extent, because both of them must be loaded into the memory at the same time when starting up; therefore, more importantly, it can To ensure the portability of the kernel, as long as different initrd file systems are provided for different hardware platforms, the kernel can remain unchanged. Therefore, the main role of initrd is to load some complex platform-related hardware, such as SCSI hard drives, network card drivers (like diskless workstations, using nfs).
In RHEL/CentOS, it is very convenient to use the setup configuration tool to configure many key conf
Computer Store News: According to the latest report from a German technology website, Valves Steam B
Linux Mint is an Ubuntu-based distribution whose goal is to provide a more complete and immediate ex
command not found Enter export PATH=/usr/bin:/usr/sbin:/bin:/sbin in the command line :/usr/X11R6/bi
20 Linux System Admin Interview Questions For Beginners – P
Solve the problem of mounting lvm under Linux
How to install JDK1.5 under Linux
The relationship between Linux and Android
Analysis of differences between Unix and Linux operating systems
Linux tomcat cluster configuration case
Solve the problem that Linux system can't boot
Simple two strokes to save the crashed Win XP system
Frequently Asked Questions in PPLive Internet TV
Make win2003 automatic installation disk Integration patch /Raid and hardware driver
WP8.1 notification center spy photos were exposed
What is the role of the Windows 7 device center?
Steps to install StarDict software on Linux
Win8 desktop double icon how to restore
Win8 system IE10 Favorites roaming function setting steps
Microsoft: 7 reasons to make you fall in love with Windows 10