Linux Kernel compilation based on SDO S3C2410-general Linux technology-Linux programming and kernel information. The following is a detailed description. 1. Reason for compilation
When using the zImage file of Sidao, The Mplayer compiled by myself cannot be used. The -- nosound option must be added to play the video. Later, I saw an article about the Linux kernel audio driver, so I decided to re-compile the kernel.
2. compile tools and materials
2.1 kernel version: elasticsearch
2.1 Cross Compiler: cross-2.95.3.tar.bz2, may be in the ARM official ftp server up and down, I forgot.
3. compilation process
3.1beibeicross-2.95.3.tar.bz2 to the/usr/local/arm/directory and go to the/usr/local/arm directory.
Sudo cp cross-2.95.3.tar.bz2/usr/local/arm
Sudo cd/usr/local/arm
3.2 decompress cross-2.95.3.tar.bz2
Sudo tar-jxvf cross-2.95.3.tar.bz2
3.3 modify ~ /. Bashrc
Sudo gedit ~ /. Bashrc
Add an export PATH =/usr/local/arm/2.95.3/bin: $ PATH
3.4copy linux-sd.tar.gzand mtd.tar.gz from the optical disk to the/usr/src directory.
Sudo cp linux-sd.tar.gz/usr/src/
Sudo cp mtd.tar.gz/usr/src
3.5 decompress the preceding two files and go to the generated linux directory.
Sudo tar-zxvf linux-sd.tar.gz
Sudo tar-zxvf mtd.tar.gz
Sudo cd linux
3.6 modify the function smdk2410_audio_open () in linux/drivers/sound/s3c2410-uda1341.c as follows:
CODE: sudo gedit drivers/sound/s3c2410-uda1341.c Static int smdk2410_audio_open (struct inode * inode, struct file * file) { Int cold =! Audio_active;
DPRINTK ("audio_open \ n ");
If (file-> f_flags & O_ACCMODE) = O_RDONLY ){ If (audio_rd_refcount | audio_wr_refcount) Return-EBUSY; Audio_rd_refcount ++; } Else if (file-> f_flags & O_ACCMODE) = O_WRONLY ){ If (audio_wr_refcount) Return-EBUSY; Audio_wr_refcount ++; } Else if (file-> f_flags & O_ACCMODE) = O_RDWR ){ If (audio_rd_refcount | audio_wr_refcount) Return-EBUSY; Audio_rd_refcount ++; Audio_wr_refcount ++; } Else Return-EINVAL;
If (cold ){ Audio_rate = AUDIO_RATE_DEFAULT; Audio_channels = AUDIO_CHANNELS_DEFAULT; Audio_fragsize = AUDIO_FRAGSIZE_DEFAULT; Audio_nbfrags = AUDIO_NBFRAGS_DEFAULT; Init_s3c2410_iis_bus_tx (); If (file-> f_mode & FMODE_WRITE )){ // Init_s3c2410_iis_bus_tx (); Audio_clear_buf (& output_stream ); If (! Output_stream.buffers & audio_setup_buf (& output_stream )) Return-ENOMEM; } If (file-> f_mode & FMODE_READ )){ // Init_s3c2410_iis_bus_rx (); Audio_clear_buf (& input_stream ); } }
// MOD_INC_USE_COUNT;
Return 0; } |