第23节:返回的信息有哪些
1)启动信息
– 操作系统启动之后会在终端中打印硬件信息以及驱动程序信息:
硬件信息:
U-Boot 2010.03 (May 17 2017 - 09:00:45) for iTOP-4412 Android
APLL = 1000MHz, MPLL = 800MHz
ARM_CLOCK = 1000MHz
PMIC: S5M8767(VER5.0)
Board: iTOP-4412
DRAM: 1 GB
MMC: max_emmc_clock:40 MHZ
Set CLK to 400 KHz
EMMC CLOCK OUTPUT:: 400KHz -[div:50]
response timeout error : 00000104 cmd 8
response timeout error : 00000104 cmd 55
max_emmc_clock:40 MHZ
Input CLK [ 50 MHz] is higher than limit [40 MHZ]
Set CLK to 40000 KHz
EMMC clock output: 40000 KHz
max_emmc_clock:40 MHZ
Input CLK [ 50 MHz] is higher than limit [40 MHZ]
Set CLK to 40000 KHz
EMMC clock output: 40000 KHz
MMC0: 7456 MB
驱动程序信息:
[ 1.260000] s5m87xx 1-0066: S5M87xx MFD probe done!!!
[ 1.260000] s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.3: i2c-3: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.4: i2c-4: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.5: i2c-5: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.7: i2c-7: S3C I2C adapter
[ 1.260000] Advanced Linux Sound Architecture Driver Version 1.0.24.
[ 1.260000] Bluetooth: Core ver 2.16
[ 1.260000] NET: Registered protocol family 31
[ 1.260000] Bluetooth: HCI device and connection manager initialized
[ 1.260000] Bluetooth: HCI socket layer initialized
[ 1.260000] Bluetooth: L2CAP socket layer initialized
[ 1.260000] Bluetooth: SCO socket layer initialized
[ 1.260000] cfg80211: Calling CRDA to update world regul
2)程序运行错误
– 程序在执行的时候,会因为各种情况无法正常运行而结束
例子:
[root@iTOP-4412]# ./hello
-/bin/sh: ./hello: Permission denied
3)函数返回值错误
– 函数返回值错误
例子:
void backward(int n)
{
cout<<n%10;
if(n<10) return;
else backward(n/10);
}
int main()
{
int n;
cout<<"输入整数:"<<endl;
cin>>n;
cout<<"原整数:"<<n<<endl<<"反向数:";
backward(n);
cout<<endl;
return 0;
}
注意:如果判断正确是不会报函数错误的。
4)特殊变量错误
– 系统自带库函数提供的错误查询方式
在errno.h的头文件里,包含了一些错误的代码,是这里面有一个参数用来存储你最近一次出错的信息。perror和errno.h是结合其他一起用的。
1)启动信息
– 操作系统启动之后会在终端中打印硬件信息以及驱动程序信息:
硬件信息:
U-Boot 2010.03 (May 17 2017 - 09:00:45) for iTOP-4412 Android
APLL = 1000MHz, MPLL = 800MHz
ARM_CLOCK = 1000MHz
PMIC: S5M8767(VER5.0)
Board: iTOP-4412
DRAM: 1 GB
MMC: max_emmc_clock:40 MHZ
Set CLK to 400 KHz
EMMC CLOCK OUTPUT:: 400KHz -[div:50]
response timeout error : 00000104 cmd 8
response timeout error : 00000104 cmd 55
max_emmc_clock:40 MHZ
Input CLK [ 50 MHz] is higher than limit [40 MHZ]
Set CLK to 40000 KHz
EMMC clock output: 40000 KHz
max_emmc_clock:40 MHZ
Input CLK [ 50 MHz] is higher than limit [40 MHZ]
Set CLK to 40000 KHz
EMMC clock output: 40000 KHz
MMC0: 7456 MB
驱动程序信息:
[ 1.260000] s5m87xx 1-0066: S5M87xx MFD probe done!!!
[ 1.260000] s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.3: i2c-3: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.4: i2c-4: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.5: i2c-5: S3C I2C adapter
[ 1.260000] s3c-i2c s3c2440-i2c.7: i2c-7: S3C I2C adapter
[ 1.260000] Advanced Linux Sound Architecture Driver Version 1.0.24.
[ 1.260000] Bluetooth: Core ver 2.16
[ 1.260000] NET: Registered protocol family 31
[ 1.260000] Bluetooth: HCI device and connection manager initialized
[ 1.260000] Bluetooth: HCI socket layer initialized
[ 1.260000] Bluetooth: L2CAP socket layer initialized
[ 1.260000] Bluetooth: SCO socket layer initialized
[ 1.260000] cfg80211: Calling CRDA to update world regul
2)程序运行错误
– 程序在执行的时候,会因为各种情况无法正常运行而结束
例子:
[root@iTOP-4412]# ./hello
-/bin/sh: ./hello: Permission denied
3)函数返回值错误
– 函数返回值错误
例子:
void backward(int n)
{
cout<<n%10;
if(n<10) return;
else backward(n/10);
}
int main()
{
int n;
cout<<"输入整数:"<<endl;
cin>>n;
cout<<"原整数:"<<n<<endl<<"反向数:";
backward(n);
cout<<endl;
return 0;
}
注意:如果判断正确是不会报函数错误的。
4)特殊变量错误
– 系统自带库函数提供的错误查询方式
在errno.h的头文件里,包含了一些错误的代码,是这里面有一个参数用来存储你最近一次出错的信息。perror和errno.h是结合其他一起用的。