In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the necessary knowledge of QtE". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Boot script
The boot script file is "/ etc/init.d/rcS", and most operating systems have similar files. The code in this file belongs to the scripting language and is easy to understand.
Let's intercept a representative analysis. Note that the following lines of code may not directly correspond to the user's, which does not affect user learning, but mainly to understand the entire startup process and what has been done during the startup process.
01 #! / bin/sh
02 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
03 runlevel=S
04 prevlevel=N
05 umask 022
06 export PATH runlevel prevlevel
Code analysis
01 #! / bin/sh means that this script uses / bin/sh to interpret execution, #! Is a special token, followed by the path to the shell that interprets the script.
02 PATH=XX is the default valid execution path, which represents the path under the root root directory.
03 the user level is set here, and the default is single user. (do users remember that Linux is multi-user)
04 indicates that the permission of the new file created by the user is 755
05 set the environment variable (similar to the environment variable that modifies the Ubuntu when building the compilation environment)
12 / bin/hostname iTOP-4412
14 # / bin/mount-n-t proc none / proc
23 / sbin/mdev-s
24 / bin/hotplug
39 ln-sf / dev/ttyS2 / dev/tty2
43 amixer cset numid=5 127
50 / sbin/hwclock-s-f / dev/rtc
52 syslogd
12 set the host name to iTOP-4412, where users can change it to their own name.
14 use the mount command to set up a commonly used temporary directory
The 23 mdev command automatically generates the node files needed for the driver
24 hotplug mount USB device
39 ln command to establish a link
43 amixer sets audio parameters
50 hwclock set clock
52 syslogd records all kinds of messages running in the system
53 / etc/rc.d/init.d/netd start
……
81 / sbin/ifconfig lo 127.0.0.1
……
87 echo "Starting Qtopia4, please waiting..."
Start various service programs
Ifconfig configuration Network
Echo command prints information to the output terminal
89 # / bin/qtopia &
"#" means to comment out this line, and "&" means to run in the background
91 / bin/helloworld-qws &
Means that when you run "helloworld", the QWS function starts. "QWS" is the window system of QT, that is, you need to add "- qws" before the screen can be displayed.
Note that the script command is relatively easy to understand, through the analysis of this section, I believe that the user has a certain ability to read the script code, in the later part of the manual, the script command will not give you a detailed analysis. You only need to learn when you encounter script commands, this is just an introduction to learning and understanding script files.
2. Porting and modifying qt4 files (mouse touch and font)
When introducing the configuration file in section 7.4, mention the touch library file "/ usr/local/tslib" produced by Xunwei, which has compiled the touch function into the Qt/E4.7.1 library file, and the development board can support touch and mouse functions.
When users run helloworld earlier, they will find that touch and mouse do not seem to work, but can use touch and mouse in qt4.
This section describes how to port the touch capabilities of qt4 to the application helloworld.
As shown in the following figure, open the "etc/init.d/rcS" file and change the last line to "/ bin/qt4_shell &" so that the system will run the qt4.shell program after boot. After the modification is complete, save and exit.
Then use the command "# cp-r bin/qt4 bin/qt4.shell" to copy the "bin/qt4" file into a "bin/qt4.shell" file, as shown in the following figure.
Then open the bin/qt4.shell file, as shown in the following figure.
The code "export TSLIB_ROOT=/usr/local/tslib" calls touch and mouse drivers.
The code "export QTDIR=/opt/qt-4.7.1/" invokes QtE's library.
As shown in the following figure, this paragraph about the mouse driver has been commented out.
Modify the code related to touching the mouse in the image above to the following code.
If [!-c / dev/input/event2]; then
Export QWS_MOUSE_PROTO='Tslib:/dev/input/event2'
# if [- e / etc/pointercal-a!-s / etc/pointercal]; then
If [- e / etc/pointercal]; then
Fsize=$ (/ bin/ls-al / etc/pointercal | cut-d'-f 23)
Echo $fsize
# if [- s / etc/pointercal]; then
If [$fsize-ge "1]; then
Echo "/ etc/pointercal is exit"
Else
Echo "/ etc/pointercal is empty"
Rm / etc/pointercal
/ usr/local/tslib/bin/ts_calibrate
Fi
Else
Echo "/ etc/pointercal not found"
/ usr/local/tslib/bin/ts_calibrate
Fi
Else
Export QWS_MOUSE_PROTO= "MouseMan:/dev/input/mice"
# > / etc/pointercal
Fi
# export QWS_MOUSE_PROTO= "Tslib {TSLIB_TSDEVICE}"
# / usr/local/tslib/bin/ts_calibrate
On the first line of the code above, there is "!" The mouse is supported; the touch should not work properly.
If you get rid of "!" Touch is supported. Need to calibrate first, use the above code to calibrate only once, do not have to check every time.
In addition, if the user does not click the "cross box" in turn during the first calibration, then there may be a problem touching the file, then you can refer to Section 7.3.3, delete the "/ etc/point*" file, and restart the development board to calibrate again.
After modifying this code, it's best to delete the "/ etc/point*" file. For example, if the user just started using touch, and then changed to mouse control, because the "/ etc/point*" file already exists, it will make people feel that the mouse can be used, and the touch can be used but there is a problem, then delete the "/ etc/point*" file and restart.
As shown in the following figure, then find the parameters that control the font.
As shown above, delete the following three lines to avoid abnormal display caused by too large fonts.
*)
Export QWS_DISPLAY= "LinuxFb:mmWidth91:mmHeight53:1"
As shown in the following figure, on the last line, the red box starts the routine that comes with QtE by default, which is changed to
". / bin/helloworld-qws", the code in the red box should be commented or deleted.
3.qt mount drive letter
Mounting u disk under linux QT system
As shown in the following figure, after qt starts, use the command "mknod / dev/sda1 b 8 1" in HyperTerminal to create the device node of the U disk, as shown in the following figure.
After you insert the U disk, the loading information will pop up after you insert the U disk as shown in the following figure.
Use the command "mount / dev/sda1 / mnt/udisk/" in HyperTerminal to mount the U disk.
This is shown in the following figure. Using the lookup command "ls / mnt/udisk", you can see the contents of the USB drive. The green file in the following picture is a small file built by the author on the U disk, which can be seen here.
Mounting tf Card under linux QT system
If the user is using a tf card, as shown in the following figure, the following message pops up after the tf card is inserted into the tf card slot.
As shown in the following figure, first use the command "midir / mnt/udisk1", use the command to load the tf card "mount/dev/mmcblk1p1 / mnt/udisk1", p1 is the number identified by the above development board, and should be modified according to the actual situation.
Then use the lookup command "ls / mnt/udisk1" to see the files in the tf card.
This is the end of the content of "what is the necessary knowledge of QtE". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.