ºìÁªLinuxÃÅ»§
Linux°ïÖú

»ùÓÚ˹µÀS3C2410µÄLinuxÄں˱àÒë

·¢²¼Ê±¼ä:2008-03-30 16:20:35À´Ô´:ºìÁª×÷Õß:eaxbiopl
1£¬±àÒëÔµÓÉ
ʹÓÃ˹µÀµÄzImageÎļþ£¬ÎÒ×Ô¼º±àÒëµÄMplayer²»ÄÜʹÓ㬱ØÐë¼Ó£­£­nosoundÑ¡Ïî²ÅÄܲ¥·ÅÊÓƵ¡£ºóÀ´¼ûһƪÎÄÕÂ˵ÊÇLinuxÄÚºËÒôƵÇý¶¯µÄÎÊÌ⣬ËùÒÔ¾ö¶¨ÖØбàÒëÄںˡ£

2£¬±àÒ빤¾ß¼°×ÊÁÏ
2.1Äں˰汾£ºË¹µÀS3C2410ÆÕ¼°°æ2¹âÅÌ×Ô´øµÄ
2.1½»²æ±àÒëÆ÷£ºcross-2.95.3.tar.bz2£¬¿ÉÄÜÊÇÔÚARM¹Ù·½µÄftp·þÎñÆ÷ÉÏϵģ¬ÎÒÍüÁË¡£

3£¬±àÒë¹ý³Ì
3.1¿½±´cross-2.95.3.tar.bz2µ½£¯usr£¯local£¯arm£¯Ä¿Â¼,²¢×ªµ½£¯usr£¯local£¯armĿ¼
sudo cp cross-2.95.3.tar.bz2 /usr/local/arm
sudo cd /usr/local/arm

3.2 ½âѹcross-2.95.3.tar.bz2
sudo tar -jxvf cross-2.95.3.tar.bz2

3.3Ð޸ġ«£¯.bashrc
sudo gedit ~/.bashrc
ÔÚ×îºó¼ÓÒ»¾ä export PATH=/usr/local/arm/2.95.3/bin:$PATH

3.4½«¹âÅÌÖÐÌṩµÄlinux-sd.tar.gzºÍmtd.tar.gz¿½±´µ½£¯usr£¯srcĿ¼
sudo cp linux-sd.tar.gz /usr/src/
sudo cp mtd.tar.gz /usr/src

3.5 ½âѹÒÔÉÏÁ½¸öÎļþ²¢×ªµ½Éú³ÉµÄlinuxĿ¼
sudo tar -zxvf linux-sd.tar.gz
sudo tar -zxvf mtd.tar.gz
sudo cd linux

3.6 ÐÞ¸Ä linux/drivers/sound/s3c2410-uda1341.cÖеĺ¯Êýsmdk2410_audio_open()ÈçÏ£º[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;
}[/code]3.7ÐÞ¸ÄMakefileÖеıäÁ¿CROSS_COMPILE(ÒòΪÉèÖõÄÊǾø¶Ô·¾¶£¬ËùÒÔ3.3²½ºÃÏñÊDz»±ØÒªµÄ)

sudo gedit Makefile

CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-

3.8Èç¹ûÏÈÇ°±àÒë¹ý£¬µ«Ã»Óгɹ¦£¬ÒªÏÈmake clean

3.9±àÒëÉú³ÉzImageÎļþ
sudo make zImage

4£¬±àÒëÖÐÅöµ½µÄÎÊÌâ
4.1Ò»¿ªÊ¼ÎÒÔÚOpenSUSE 10¡£3ÖбàÒ룬µ«´Ë°æ±¾µÄLinuxÖÐȨÏÞ¹ÜÀíºÃÏñÓÐЩÎÊÌ⣬ÀÏÊdzöÏÖ ¡°make£º £ª£ª£ª£¯usr£¯src£¯linux ÊÇÒ»¸öĿ¼¡£Í£Ö¹¡£"µÄ´íÎó.ºóÀ´×ªµ½Ubuntu 8¡£04beta°æÖвÅûÓÐÕâ¸ö´íÎó¡£

4.2ʹÓÃ3.3.2µÄarm£­linux£­gcc½»²æ±àÒëÆ÷ʱ»á³öÏÖ[code]blkpg.c: In function `blk_ioctl':
blkpg.c:250: error: asm-specifier for variable `__r1' conflicts with asm clobber list
blkpg.c:250: confused by earlier errors, bailing out
make[3]: *** [blkpg.o] Error 1
make[3]: Leaving directory `/home/andante/2.4.18-rmk7/drivers/block'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/home/andante/2.4.18-rmk7/drivers/block'
make[1]: *** [_subdir_block] Error 2
make[1]: Leaving directory `/home/andante/2.4.18-rmk7/drivers'
make: *** [_dir_drivers] Error 2[/code]µÄ´íÎ󣬺óÀ´¸ÄÓÃ2.95.3°æ±¾µÄ½»²æ±àÒëÆ÷²Å³É¹¦¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. dugulei ÓÚ 2008-04-08 13:33:28·¢±í:

    ÕæÎ޳ܣ¬×ªÔرðÈ˲©¿ÍÉϵĶ«Î÷µ±³É×Ô¼ºµÄ