10. Recompile the kernel to support keyboard and mouse drivers
11. Fourth Test start
12. Using scripting to implement the INIT function
13. Fifth Test start
14. Compile the kernel so that it can directly identify the device files
15. Sixth Test Start
10. Recompile the kernel to support keyboard and mouse drivers
[[email protected] ~]# lsusb //View USB interface type and model [[EMAIL&NBSP;PROTECTED]&NBSP;~]#&NBSP;CD /usr/src/linux[[email protected] ~]# make menuconfig//enables keyboard and mouse driver support Device drivers --->Input device support ---> [*] Keyboards --->[*] Mice ---> default is PS/2 driver, if USB, you need to load USB driver first <*> Mouse interface[*] USB support ---><*> support for Host-side USB<*> xHCI HCD (usb 3.0) support[*] debugging for the xhci host controller<*> ohci hcd support 1.1 Drive <*> UHCI HCD (Most intel and via) support[[email Protected] linux]# make bzimage[[email protected] linux]# cp arch/x86/boot/bzimage /mnt/boot/vmlinuz cp: overwrite '/mnt/boot/vmlinuz '? y
At this point, you can copy several common commands for testing.
11. Fourth Test start
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/66/wKiom1hMnzHhsGlqAAAROqAxw8Y583.png-wh_500x0-wm_3 -wmp_4-s_3446266227.png "title=" 3.png "alt=" Wkiom1hmnzhhsglqaaaroqaxw8y583.png-wh_50 "/>
12. Using scripting to implement the INIT function
(Note porting mount, echo command)
[Email protected] ~]# vim/mnt/sysroot/sbin/init#!/bin/bashecho-e "\twelcome to \033[32mmy mini\033[0m Linux" mount-n-t Proc Proc/procmount-n-T Sysfs sysfs/sysmount-n-o remount,rw/dev/sda2//bin/bash[[email protected] ~]# chmod +x/mn T/sysroot/sbin/init[[email protected] ~]# mkdir/mnt/sysroot/{sys,proc,dev}[[email protected] ~]# vim/mnt/boot/grub/ Grub.confdefault=0timeout=5hiddenmenutitle sxj minu root (hd0,0) kernel/vmlinuz root=/dev/sda2 init=/sbin/i NIT (can be omitted, default location)
13. Fifth Test start
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8B/66/wKiom1hMn4egTsg9AAACMLp930o991.png-wh_500x0-wm_3 -wmp_4-s_3539542695.png "style=" Float:none; "title=" 4.png "alt=" Wkiom1hmn4egtsg9aaacmlp930o991.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8B/62/wKioL1hMn4eDNxUYAAAXdGH8nvk106.png-wh_500x0-wm_3 -wmp_4-s_3409864597.png "style=" Float:none; "title=" 5.png "alt=" Wkiol1hmn4ednxuyaaaxdgh8nvk106.png-wh_50 "/>
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/62/wKioL1hMn4iw1Ys9AAAyj1G13uY716.png-wh_500x0-wm_3 -wmp_4-s_1438146125.png "style=" Float:none; "title=" 6.png "alt=" Wkiol1hmn4iw1ys9aaayj1g13uy716.png-wh_50 "/>
Since the device files were created by the Udev program, we do not have udev at this time,
All/dev/directories are empty
14. Compile the kernel so that it can directly identify the device files
[[email protected] ~]# Cd/usr/src/linux[[email protected] linux]# make menuconfig//Select to directly identify device file option device Drivers---> Generic Driver Options---> [*] Maintain a DEVTMPFS filesystem to Mount At/dev [*] AutoMount DEVTMPFS At/dev, after the kernel mounted the rootfs [[E-mail protected] linux]# make Bziamge[[email protected] linux]# CP arch/ X86/boot/bzimage/mnt/boot/vmlinuz cp:overwrite '/mnt/boot/vmlinuz '? Y[[email protected] linux]# sync
15. Sixth Test Start
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/62/wKioL1hMoFCiAthxAAAxQ_KWqGE594.png-wh_500x0-wm_3 -wmp_4-s_24241303.png "title=" 7.png "alt=" Wkiol1hmofciathxaaaxq_kwqge594.png-wh_50 "/>
This article is from the "Homecoming" blog, make sure to keep this source http://sixijie123.blog.51cto.com/11880770/1881602
Build a mini Linux from scratch (3)