0%

qemu移植开源软件

webserver

boa

boa概述

image-20241015223050748

boa移植

1.解压源代码
1
tar -xvf boa-0.94.13.tar.gz 
2.生成Makefile
1
2
cd ./boa-0.94.13/src 
./configure
3.编译源代码
1
2
3
4
5
6
将Makefile中的下面内容:
CC = gcc
CPP = gcc –E
改为(即采用交叉编译工具):
CC = arm-linux-gcc
CPP = arm-linux-gcc –E
4.修改源代码 修改src/compat.h

出现错误:

1
2
3
4
compat.h:120:30: note: in definition of macro ‘TIMEZONE_OFFSET’
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
^
make: *** [util.o] Error 1

解决方案:

vim compat.h 
#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff        //修改成这个
//#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff        //注释掉

vim boa.c  //注释掉下面部分
#if 0     
    if (setuid(0) != -1) {
        DIE("icky Linux kernel bug!");
    }
#endif   
5.编译 make clean && make -j8生成boa文件

此时再次按照自己的需求修改安装目录,着重修改如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Port  80  
User 0
Group 0
#Listen 192.68.0.5
ErrorLog /boa/log/error_log
AccessLog /boa/log/access_log
DocumentRoot /boa/www
UserDir public_html
DirectoryIndex index.html
DirectoryMaker /boa/boa_indexer
KeepAliveMax 1000
KeepAliveTimeout 10
MimeTypes /boa/mime.types
DefaultType text/plain
CGIPath /bin:/usr/bin:/usr/local/bin
Alias /doc /usr/doc
ScriptAlias /cgi-bin/ /boa/cgi-bin/

我的目录在/etc/boa,boa.conf配置文件如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

# Boa v0.94 configuration file
# File format has not changed from 0.93
# File format has changed little from 0.92
# version changes are noted in the comments
#
# The Boa configuration file is parsed with a lex/yacc or flex/bison
# generated parser. If it reports an error, the line number will be
# provided; it should be easy to spot. The syntax of each of these
# rules is very simple, and they can occur in any order. Where possible
# these directives mimic those of NCSA httpd 1.3; I saw no reason to
# introduce gratuitous differences.

# $Id: boa.conf,v 1.25 2002/03/22 04:33:09 jnelson Exp $

# The "ServerRoot" is not in this configuration file. It can be compiled
# into the server (see defines.h) or specified on the command line with
# the -c option, for example:
#
# boa -c /usr/local/boa


# Port: The port Boa runs on. The default port for http servers is 80.
# If it is less than 1024, the server must be started as root.

Port 80

# Listen: the Internet address to bind(2) to. If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY). You only get one "Listen" directive,
# if you want service on multiple IP addresses, you have three choices:
# 1. Run boa without a "Listen" directive
# a. All addresses are treated the same; makes sense if the addresses
# are localhost, ppp, and eth0.
# b. Use the VirtualHost directive below to point requests to different
# files. Should be good for a very large number of addresses (web
# hosting clients).
# 2. Run one copy of boa per IP address, each has its own configuration
# with a "Listen" directive. No big deal up to a few tens of addresses.
# Nice separation between clients.
# The name you provide gets run through inet_aton(3), so you have to use dotted
# quad notation. This configuration is too important to trust some DNS.

#Listen 192.68.0.5

# User: The name or UID the server should run as.
# Group: The group name or GID the server should run as.

User 0
Group 0

# ServerAdmin: The email address where server problems should be sent.
# Note: this is not currently used, except as an environment variable
# for CGIs.

#ServerAdmin root@localhost

# ErrorLog: The location of the error log file. If this does not start
# with /, it is considered relative to the server root.
# Set to /dev/null if you don't want errors logged.
# If unset, defaults to /dev/stderr

ErrorLog /etc/boa/log/error_log
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
# is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
# process if the receiving end of a pipe stops reading."
#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"

# AccessLog: The location of the access log file. If this does not
# start with /, it is considered relative to the server root.
# Comment out or set to /dev/null (less effective) to disable
# Access logging.

AccessLog /etc/boa/log/access_log
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
# is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
# process if the receiving end of a pipe stops reading."
#AccessLog "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"

# UseLocaltime: Logical switch. Uncomment to use localtime
# instead of UTC time
#UseLocaltime

# VerboseCGILogs: this is just a logical switch.
# It simply notes the start and stop times of cgis in the error log
# Comment out to disable.

#VerboseCGILogs

# ServerName: the name of this server that should be sent back to
# clients if different than that returned by gethostname + gethostbyname

#ServerName www.your.org.here

# VirtualHost: a logical switch.
# Comment out to disable.
# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
# become /var/www/IP-A.
# Example: http://localhost/ becomes /var/www/127.0.0.1
#
# Not used until version 0.93.17.2. This "feature" also breaks commonlog
# output rules, it prepends the interface number to each access_log line.
# You are expected to fix that problem with a postprocessing script.

#VirtualHost

# DocumentRoot: The root directory of the HTML documents.
# Comment out to disable server non user files.

DocumentRoot /etc/boa/www

# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.

UserDir public_html

# DirectoryIndex: Name of the file to use as a pre-written HTML
# directory index. Please MAKE AND USE THESE FILES. On the
# fly creation of directory indexes can be _slow_.
# Comment out to always use DirectoryMaker

DirectoryIndex index.html

# DirectoryMaker: Name of program used to create a directory listing.
# Comment out to disable directory listings. If both this and
# DirectoryIndex are commented out, accessing a directory will give
# an error (though accessing files in the directory are still ok).

DirectoryMaker /etc/boa/boa_indexer

# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
# has been commented out, the the on-the-fly indexing of Boa can be used
# to generate indexes of directories. Be warned that the output is
# extremely minimal and can cause delays when slow disks are used.
# Note: The DirectoryCache must be writable by the same user/group that
# Boa runs as.

# DirectoryCache /var/spool/boa/dircache

# KeepAliveMax: Number of KeepAlive requests to allow per connection
# Comment out, or set to 0 to disable keepalive processing

KeepAliveMax 1000

# KeepAliveTimeout: seconds to wait before keepalive connection times out

KeepAliveTimeout 10

# MimeTypes: This is the file that is used to generate mime type pairs
# and Content-Type fields for boa.
# Set to /dev/null if you do not want to load a mime types file.
# Do *not* comment out (better use AddType!)

MimeTypes /etc/boa/mime.types


# DefaultType: MIME type used if the file extension is unknown, or there
# is no file extension.

DefaultType text/plain

# CGIPath: The value of the $PATH environment variable given to CGI progs.

CGIPath /bin:/usr/bin:/usr/local/bin

# SinglePostLimit: The maximum allowable number of bytes in
# a single POST. Default is normally 1MB.

# AddType: adds types without editing mime.types
# Example: AddType type extension [extension ...]

# Uncomment the next line if you want .cgi files to execute from anywhere
#AddType application/x-httpd-cgi cgi

# Redirect, Alias, and ScriptAlias all have the same semantics -- they
# match the beginning of a request and take appropriate action. Use
# Redirect for other servers, Alias for the same server, and ScriptAlias
# to enable directories for script execution.

# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example: Redirect /bar http://elsewhere/feh/bar

# Aliases: Aliases one path to another.
# Example: Alias /path1/bar /path2/foo

Alias /doc /usr/doc

# ScriptAlias: Maps a virtual path to a directory for serving scripts
# Example: ScriptAlias /htbin/ /www/htbin/

ScriptAlias /cgi-bin/ /etc/boa/cgi-bin/

6.新建index.html和test.c

index.html:

1
2
3
4
5
6
7
8
<html>
<body>
<h3>this is a test! 2024-10-15 jym</h3><br/>
<img src="oei.jpg"/>
<h3>tree picture</h3><br/>
<a href="/cgi-bin/test.cgi">to cgi page</a> //指定了cgi可执行文件存放的路径,默认从/boa的根目录开始查找
</body>
</html> j

test.c:

1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
int main()
{
printf("Content-type:text/html\n\n"); //这句一定要加上
printf("<html><body>");
printf("<font style=\"color:red; font-size:30px;\">Hello, CGI!</font><br/>");
printf("<a href=\"/index.html\">return index.html</a>");
printf("</body></html>");
return 0;
}

gcc -o test.cgi test.c 生成测试所用的test.cgi

7.拷贝相关文件
1
2
3
4
5
6
7
cp boa boa_indexer test.cgi index.html ../boa.conf ../../arm64_boa
cd ../../arm64_boa
mkdir www cgi-bin log
sudo cp /etc/mime.types ./
mv index.html www
mv test.cgi cgi-bin
cp ~/pics/oei.jpg ./www

image-20241017093215392

8.ARM移植

PC:

1
cp ./arm64_boa ../rootfs #rootfs是我所设置的nfs挂载目录

虚拟ARM:

1
mount -t nfs -o proto=tcp,nolock 10.0.0.1:/home/jym/code/linux/qemu/rootfs /mnt

将对应文件从/mnt文件夹中拷贝到对应目录 可执行文件放在/usr/sbin boa对应文件放在/etc/boa

第一遍运行出现如下问题:

1
2
[root@FriendlyARM /]# ./boa
gethostbyname:: Success

解决办法:

1
2
vim boa.conf #添加如下内容即可
ServerName www.mydomain.com
9.运行测试

image-20241017092231141

注意这里我们的虚拟开发板是10.0.0.2,在移植过程中,我先在x86平台上移植了boa,本地地址为127.0.0.1或者10.0.0.1都是如下所示画面,但是10.0.0.2却是原来的bo官方界面,后续移植的时候,我将虚拟平台上的boa重命名为boa_old,其中/etc/boa和/usr/sbin中都存在,然后将我生成的文件拷贝到/etc/boa中关掉之前的boa服务再次运行即可

1
2
ps | grep boa
kill 进程号

image-20241017092608730

image-20241017092209961

GoAhead

后续移植

GoAhead概述

GoAhead移植

madplay

madplay概述

Madplay是一个开源mp3解码库,对mp3解码算法做了很多优化

单纯想要播放音乐,在linux下播放MP3文件,我们可以使用sox,运行下面语句即可

1
2
sudo apt-get install sox libsox-fmt-all
play shanghaitan.mp3

madplay-PC-Linux

1.解压源码包

1
2
3
4
5
6
7
8
9
10
11
12
13
cd /arm
mkdir madplay
cd madplay
mkdir tarball src-x86 src-arm target-x86 target-arm

cd tarball
for f in $(ls *.tar.gz); do tar -zxvf $f –C ../src-x86; done
或者:
cd tarball
tar -zxvf zlib-1.2.3.tar.gz -C ../src-x86
tar -zxvf libid3tag-0.15.1b.tar.gz -C ../src-x86
tar -zxvf libmad-0.15.1b.tar.gz -C ../src-x86
tar -zxvf madplay-0.15.2b.tar.gz -C ../src-x86

目录说明:
tarball 目录用来存放所有的源代码包
src-x86 目录用来存放 X86 版本的所有源代码文件
src-arm 目录用来存放 ARM 版本的所有源代码文件
target-x86 目录是 X86 版本的安装目录
target-arm 目录是 ARM 版本的安装目录
接下来把从网上下载到的源代码包放入 tarball 目录

2.编译madplay及它所依赖的库文件

zlib
1
2
3
4
cd ../src-x86/zlib-1.2.3
./configure --prefix=/home/jym/code/linux/qemu/madplay/target-x86
make -j8
make install
libid3tag
1
2
3
4
cd ../libid3tag-0.15.1b
./configure --prefix=/home/jym/code/linux/qemu/madplay/target-x86/ --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/home/jym/code/linux/qemu/madplay/target-x86/include LDFLAGS=-L/home/jym/code/linux/qemu/madplay/target-x86/lib
make -j8
make install

其中,–disable-shared –enable-static 是指定为静态编译,不过这样并不能够进行静态编译.

libmad
1
2
cd ../libmad-0.15.1b
./configure --prefix=/home/jym/code/linux/qemu/madplay/target-x86 --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/home/jym/code/linux/qemu/madplay/target-x86/include LDFLAGS=-L/home/jym/code/linux/qemu/madplay/target-x86/lib

如果此时 make,make install 就会报错,说是”-fforce-mem”参数不能识别。打开当前目录下的 Makefile 文件,去掉里面出现的”-fforce-mem”,再进行后续操作

1
2
make -j8
make install
madplay
1
2
3
4
cd ../madplay-0.15.2b
./configure --prefix=/home/jym/code/linux/qemu/madplay/target-x86 --disable-debugging --disable-shared --enable-static CPPFLAGS=-I/home/jym/code/linux/qemu/madplay/target-x86/include LDFLAGS=-L/home/jym/code/linux/qemu/madplay/target-x86/lib
make -j8
make install

但是,这样得到的是动态链接。如果在 madplay-0.15.2b 目录中执行gcc 命令,并且在最后加上-static,运行以后就可以得到静态链接的程序

静态链接
1
gcc -Wall -O2 -fomit-frame-pointer -o madplay madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_oss.o -L/home/jym/code/linux/qemu/madplay/target-x86/lib /home/jym/code/linux/qemu/madplay/target-x86/lib/libmad.a /home/jym/code/linux/qemu/madplay/target-x86/lib/libid3tag.a -lz -lm -static
1
2
ls /home/jym/code/linux/qemu/madplay/target-x86/bin/
abxtest madplay

使用file查看madplay文件

1
2
3
4
5
jym@jym-virtual-machine:~/code/linux/qemu/madplay/target-x86/bin$ file madplay
madplay: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=16f52c3b88a3bce95f5274f8d6b43d15b03fca25, for GNU/Linux 3.2.0, not stripped

jym@jym-virtual-machine:~/code/linux/qemu/madplay/src-x86/madplay-0.15.2b$ file madplay
madplay: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=e5deaf02bfed1309a9f82f53f4c89edcd0e45070, for GNU/Linux 3.2.0, not stripped

image-20241016232303443

3.运行测试

移植完成后还有一个问题需要处理,直接运行会报错如下:

1
2
3
jym@jym-virtual-machine:~/code/linux/qemu/madplay/target-x86/bin$ ./madplay shanghaitan.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
audio: /dev/dsp: 没有那个文件或目录

原因是madplay使用oss建构,在网上查找了一些资料,可以用alsa支持oss架构,后续我再探索,root 账号下不能用audio,切记!

简单解决方法如下:使用madplay解码再使用aplay播放

1
./madplay -o wav:- shanghaitan.mp3 | aplay

最终效果如图所示

image-20241016233558824

4.构建脚本文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# This build script is for madplay under PC-Linux
MADPLAY_DIR=/home/jym/code/linux/qemu/madplay
TARBALL_DIR=$MADPLAY_DIR/tarball
SRC_DIR=$MADPLAY_DIR/src-x86
TARGET_DIR=$MADPLAY_DIR/target-x86

tar -zxvf $TARBALL_DIR/zlib-1.2.3.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/libid3tag-0.15.1b.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/libmad-0.15.1b.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/madplay-0.15.2b.tar.gz -C $SRC_DIR
# for f in $(ls $TARBALL_DIR/*.tar.gz); do tar -zxvf $f -C $SRC_DIR; done
cd $SRC_DIR/zlib-1.2.3
./configure --prefix=$TARGET_DIR
make
make install

cd $SRC_DIR/libid3tag-0.15.1b
./configure --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib
make
make install

cd $SRC_DIR/libmad-0.15.1b
./configure --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib

sed 's/-fforce-mem //g' Makefile > Makefile.bak
mv Makefile.bak Makefile

make
make install

cd $SRC_DIR/madplay-0.15.2b
./configure --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib
make
make install

gcc -Wall -O2 -fomit-frame-pointer -o madplay-s madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_oss.o -L$TARGET_DIR/lib $TARGET_DIR/lib/libmad.a $TARGET_DIR/lib/libid3tag.a -lz -lm -static

mv madplay madplay-d
mv $TARGET_DIR/bin/madplay $TARGET_DIR/bin/madplay-d
cp -a madplay-s $TARGET_DIR/bin

madplay-ARM-Linux

1.构建脚本

移植ARM-Linux版本和上述PC端流程类似,使用交叉编译器即可,这里给出编译脚本,一键运行即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# This build script is for madplay under ARM-Linux
MADPLAY_DIR=/home/jym/code/linux/qemu/madplay
TARBALL_DIR=$MADPLAY_DIR/tarball
SRC_DIR=$MADPLAY_DIR/src-arm
TARGET_DIR=$MADPLAY_DIR/target-arm
tar -zxvf $TARBALL_DIR/zlib-1.2.3.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/libid3tag-0.15.1b.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/libmad-0.15.1b.tar.gz -C $SRC_DIR
tar -zxvf $TARBALL_DIR/madplay-0.15.2b.tar.gz -C $SRC_DIR
# for f in $(ls $TARBALL_DIR/*.tar.gz); do tar -zxvf $f -C $SRC_DIR; done

export CC=arm-linux-gcc
cd $SRC_DIR/zlib-1.2.3
./configure --prefix=$TARGET_DIR
make -j8
make install

cd $SRC_DIR/libid3tag-0.15.1b
./configure --host=arm-linux --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib
make -j8
make install

cd $SRC_DIR/libmad-0.15.1b
./configure --host=arm-linux --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib

sed 's/-fforce-mem //g' Makefile > Makefile.bak
mv Makefile.bak Makefile

make -j8
make install

cd $SRC_DIR/madplay-0.15.2b
./configure --host=arm-linux --prefix=$TARGET_DIR --disable-debugging --disable-shared --enable-static CPPFLAGS=-I$TARGET_DIR/include LDFLAGS=-L$TARGET_DIR/lib
make -j8
make install

arm-linux-gcc -Wall -O2 -fomit-frame-pointer -o madplay-s madplay.o getopt.o getopt1.o version.o resample.o filter.o tag.o crc.o rgain.o player.o audio.o audio_aiff.o audio_cdda.o audio_hex.o audio_null.o audio_raw.o audio_snd.o audio_wave.o audio_oss.o -L$TARGET_DIR/lib $TARGET_DIR/lib/libmad.a $TARGET_DIR/lib/libid3tag.a -lz -lm -static

mv madplay madplay-d
mv $TARGET_DIR/bin/madplay $TARGET_DIR/bin/madplay-d
cp -a madplay-s $TARGET_DIR/bin

这里经过验证,是可以不报错运行完毕的,生成的相关文件信息如下:

image-20241017090810624!image-20241017090719513

2.运行验证

启动虚拟arm平台

image-20241017091028207

音乐成功响起

image-20241017091252686

生成的相关信息如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
Title: ▒Ϻ▒̲
Artist: Ҷ▒▒▒▒
Year: 2000
Genre: Goa
<3>__free_from_pool: freeing wrong coherent size from pool
__free_from_pool: freeing wrong coherent size from pool
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283258>] (snd_pcm_oss_get_format+0x10/0x28)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283258>] (snd_pcm_oss_get_format+0x10/0x28)
[<80283258>] (snd_pcm_oss_get_format+0x10/0x28) from [<80283ed8>] (snd_pcm_oss_ioctl+0x438/0xd2c)
[<80283258>] (snd_pcm_oss_get_format+0x10/0x28) from [<80283ed8>] (snd_pcm_oss_ioctl+0x438/0xd2c)
[<80283ed8>] (snd_pcm_oss_ioctl+0x438/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<80283ed8>] (snd_pcm_oss_ioctl+0x438/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)
<3>__free_from_pool: freeing wrong coherent size from pool
__free_from_pool: freeing wrong coherent size from pool
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283280>] (snd_pcm_oss_get_channels+0x10/0x28)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283280>] (snd_pcm_oss_get_channels+0x10/0x28)
[<80283280>] (snd_pcm_oss_get_channels+0x10/0x28) from [<80283fb4>] (snd_pcm_oss_ioctl+0x514/0xd2c)
[<80283280>] (snd_pcm_oss_get_channels+0x10/0x28) from [<80283fb4>] (snd_pcm_oss_ioctl+0x514/0xd2c)
[<80283fb4>] (snd_pcm_oss_ioctl+0x514/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<80283fb4>] (snd_pcm_oss_ioctl+0x514/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)
<3>__free_from_pool: freeing wrong coherent size from pool
__free_from_pool: freeing wrong coherent size from pool
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800151e8>] (unwind_backtrace+0x0/0xf0) from [<800189c4>] (arm_dma_free+0x188/0x1b0)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<800189c4>] (arm_dma_free+0x188/0x1b0) from [<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027dfa4>] (snd_dma_free_pages+0xb4/0xc8) from [<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<8027d4ac>] (snd_pcm_lib_free_pages+0x2c/0x54) from [<80292144>] (aaci_pcm_hw_free+0x40/0x5c)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292144>] (aaci_pcm_hw_free+0x40/0x5c) from [<80292180>] (aaci_pcm_hw_params+0x20/0xd4)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80292180>] (aaci_pcm_hw_params+0x20/0xd4) from [<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80276ce4>] (snd_pcm_hw_params+0x114/0x3e0) from [<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80277984>] (snd_pcm_common_ioctl1+0x5a0/0x10a4) from [<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278990>] (snd_pcm_playback_ioctl1+0x38/0x4c0) from [<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80278e84>] (snd_pcm_kernel_ioctl+0x40/0x6c) from [<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80282730>] (snd_pcm_oss_change_params+0x818/0xcc0) from [<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283230>] (snd_pcm_oss_get_rate+0x10/0x28)
[<80283214>] (snd_pcm_oss_get_active_substream+0x68/0x74) from [<80283230>] (snd_pcm_oss_get_rate+0x10/0x28)
[<80283230>] (snd_pcm_oss_get_rate+0x10/0x28) from [<80284658>] (snd_pcm_oss_ioctl+0xbb8/0xd2c)
[<80283230>] (snd_pcm_oss_get_rate+0x10/0x28) from [<80284658>] (snd_pcm_oss_ioctl+0xbb8/0xd2c)
[<80284658>] (snd_pcm_oss_ioctl+0xbb8/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<80284658>] (snd_pcm_oss_ioctl+0xbb8/0xd2c) from [<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c6c9c>] (do_vfs_ioctl+0x80/0x5b0) from [<800c7204>] (sys_ioctl+0x38/0x60)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)
[<800c7204>] (sys_ioctl+0x38/0x60) from [<8000e2c0>] (ret_fast_syscall+0x0/0x30)

iconv

后续移植

iconv概述

iconv是字符编码转换库

iconv应用

FrameBuffer

后续移植

FrameBuffer概述

framebuffer简介

image-20241015225141191

FrameBuffer编程模型

image-20241015225312473

对framebuffer设备操作

image-20241015225538409

操作framebuffer步骤

image-20241015225711248

framebuffer信息结构

framebuffer实战