Linux»·¾³ÏÂÓÃcÓïÑÔдµÄ²¥·ÅwavÎļþµÄС³ÌÐò
#include <unistd.h>
#include <fcntl.h>
#include
<sys/types.h>
#include <sys/ioctl.h>
#include
<stdlib.h>
#include <stdio.h>
#include
<linux/soundcard.h>
/* ÏÂÃæµÄÈý¸ö²ÎÊýÊǸú¾ßÌåÎļþÏà¹ØµÄ£¬ÎļþʲôÑù£¬¾ÍÒªÉèÖóÉʲôÑù */
#define RATE 11025
#define SIZE 16
#define CHANNELS
2 // 1±íʾµ¥ÉùµÀ£¬2ΪÁ¢ÌåÉù
/* ................ */
unsigned char
buf[RATE*SIZE/8]; //bufÀïÃæÕýºÃ·ÅÒ»ÃëÖÓµÄÒôƵ£¬ÏÂÃæµÄ¼ÆÊ±»¹ÒªÓÃ
int main()
{
int fd;
int wavfd; //wavÎļþµÄÃèÊö·û
int arg; /* ..ioctl..... */
int status; /*
........ */
/* ...... */
fd = open("/dev/dsp",
O_RDWR);
if (fd < 0) {
printf("open of /dev/dsp failed");
exit(1);
}
wavfd = open("a.wav",O_RDONLY);
if (wavfd
< 0) {
printf("open of wav failed");
exit(1);
}
/* .......... */
arg = SIZE;
status = ioctl(fd,
SOUND_PCM_WRITE_BITS, &arg);
if (status == -1)
perror("SOUND_PCM_WRITE_BITS ioctl failed");
if (arg != SIZE)
perror("unable to set sample size");
/* .......... */
arg = CHANNELS;
status = ioctl(fd,
SOUND_PCM_WRITE_CHANNELS, &arg);
if (status == -1)
&nb
Ïà¹ØÎĵµ£º
contact me go -> xuqiang.docs@hotmail.com
ARM Linux Boot Sequence
The following traces the Linux boot sequence for ARM-based systems in the 2.6.18 kernel. It looks at just the earliest stages of the boot process, until the generic non-processor-specific start_kernel function is called. The line ......
ÐǼÊÒëÍõµÄ°²×°
“ÐǼÊÒëÍõ”ÊÇÓÃGtk2¿ª·¢µÄ¿çƽ̨µÄ¹ú¼Ê»¯µÄ´ÊµäÈí¼þ¡£Ëü¾ßÓГͨÅä·ûÆ¥Å䔡¢“Ñ¡ÖÐÇøÈ¡´Ê”¡¢“Ä£ºý²éѯ”µÈÇ¿´ó¹¦ÄÜ¡£±¾ÎÄÖ÷Òª½â˵һÏÂÖ÷³ÌÐòºÍ´Ê¿âµÄ°²×°£»
Ò»¡¢Ê²Ã´ ......
ȨÏÞÓëÎļþϵͳ°²È«
1,“ls -l”ÃüÁîÊä³ö½á¹ûÖи÷×ֶκ¬Ò壺
(1),ÎļþÀàÐÍ£¬µÚ1루“-”ÆÕͨÎļþ¡¢“d”Ŀ¼Îļþ¡¢“l”·ûºÅÁ´½ÓÎļþ¡¢“b”¿ìÉ豸Îļþ¡¢“c”×Ö·ûÉ豸Îļþ¡¢“p”¹ÜµÀÎļþ¡¢“s”socketÎļþ£©
(2),ȨÏÞ£¬µÚ2ÖÁ10루 ......
¿´linuxÄں˺ÜÈÝÒ×±»struct address_space Õâ¸ö½á¹¹ÃÔ»ó£¬ËüÊÇ´ú±íij¸öµØÖ·¿Õ¼äÂð£¿Êµ¼ÊÉϲ»Êǵģ¬ËüÊÇÓÃÓÚ¹ÜÀíÎļþ£¨struct inode)Ó³Éäµ½ÄÚ´æµÄÒ³Ãæ(struct page)µÄ£»ÓëÖ®¶ÔÓ¦£¬address_space_operations ¾ÍÊÇÓÃÀ´²Ù×÷¸ÃÎļþÓ³Éäµ½ÄÚ´æµÄÒ³Ãæ£¬±ÈÈç°ÑÄÚ´æÖеÄÐÞ¸Äд»ØÎļþ¡¢´ÓÎļþÖжÁÈëÊý¾Ýµ½Ò³Ã滺³åµÈ¡£
& ......
ÔÚLinuxÖÐÓÐ7ÖÖÆô¶¯¼¶±ð£¬Ä¬ÈÏÊÇX-Window£¬ÏñÊÇWindowsµÄ´°¿Úģʽ£¬¶øLinuxµÄ²Ù×÷ºÍÅäÖÃÒ»°ãÎÒÃǶ¼²ÉÓÃÊäÈëÃüÁîµÄ·½Ê½À´Íê³É£¬ÏñDOS²Ù×÷ϵͳһÑù£¬ÈçºÎÈÃLinuxÒ»Æô¶¯¾Í½øÈëÕâÖÖÄ£Ê½ÄØ£¿
ÒÔ¹ÜÀíÔ±Éí·Ý½øÈëLinux£¬ÐÞ¸ÄÎļþ£º/etc/inittabÎļþ
ÕÒµ½¡°id:5:initdefault:¡±£¬ÆäÖ ......