Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux mmapÇý¶¯ÊµÏÖ

ÔÚʵÏÖÇý¶¯³ÌÐòµÄmmapº¯Êýʱ£¬Òª×¢ÒâÓ³É䵨ַµÄת»»ÎÊÌ⣬¼û´úÂë¡£
¶¨ÒåÒ»¸öÉ豸½á¹¹Ì壺
struct leedriver
{
struct cdev cdev;
unsigned char mem[MEMSIZE];
};
ÕâÀïÃæÕâ¸öMEMSIZE£¬×îС¶¼ÒªÊÇ4096£¬ÒòΪÄÚ´æÓ³ÉäÊÇÒÔҳΪµ¥Î»µÄ¡£
ÔÚʵÏÖsimple_remap_mmapº¯Êýʱ£¬´úÂëÈçÏÂ
static int simple_remap_mmap(struct file *filp, struct vm_area_struct *vma)
{
vma->vm_pgoff = ((u32)virt_to_phys(leedriverp->mem)) >> PAGE_SHIFT;
printk("vma->vm_pgoff = %lx\n",vma->vm_pgoff);
if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;
vma->vm_ops = &simple_remap_vm_ops;
simple_vma_open(vma);
return 0;
}

×¢Ò⺯Êý¿ªÍ·µÄvma->vm_pgoff = ((u32)virt_to_phys(leedriverp->mem)) >> PAGE_SHIFT;
leedriverp->memÊǸöÄÚºËÐéÄâµØÖ·£¬Ó¦¸Ãͨ¹ývirt_to_physת»»³ÉÎïÀíµØÖ·£¬ÔÙ½øÐÐ×óÒÆ²Ù×÷£¬¾ÍOKÁË¡£
Ö®ºó¶¨ÒåÒ»ÏÂvm_ops
static struct vm_operations_struct simple_remap_vm_ops = {
.open = simple_vma_open,
.close = simple_vma_close,
};

²¢ÇÒÔÚfile_operationsÖÐÌí¼Ó.mmap£½simple_remap_mmap£¬Õû¸ö¹ý³Ì¾ÍÍê³ÉÁË


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

linux 64bit firefox flash plugin

http://plugindoc.mozdev.org/linux-amd64.html#flash
download flash:
http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz
cp libflashplayer.so /usr/lib/mozilla-firefox/plugins
restart firefox
check:
about:plugins ......

ÐÞ¸Ä Linux Ö÷»úÃû

Linux ÏÂʲô¶¼±È½ÏÂé·³£¬¾ÍÁ¬ÐÞ¸ÄÖ÷»úÃûÒ²²»ÀýÍâ¡£
Linux °²×°ºÃºó£¬ÆäĬÈϵÄÖ÷»úÃûÊÇ localhost¡£ÐÞ¸Ä Linux Ö÷»úÃûÐèÒª3²½¡£
ʹÓà hostname Ð޸ĵ±Ç°Ö÷»úÃû¡£
hostname new-hostname
ÐÞ¸Ä /etc/sysconfig/network  ÅäÖÃÎļþ£¬ÒÔ±ãÏ´ÎÖØÆôµÄʱ£¬Ê¹ÓÃеÄÖ÷»úÃû¡£
´ò¿ª /etc/sysconfig/network Îļþ£ ......

linux±ÊÊÔÌâÄ¿


Ò»£®Ìî¿ÕÌâ
1. ÔÚLinuxϵͳÖУ¬ÒÔ     ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ     ÖжÁȡҪ¼ÓÔØµÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà     À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪ               ¡£
5. Á´½Ó ......

Linux Shell ±Ê¼Ç¶þ(Ñ­»·½á¹¹)

³ÌÐò12£ºÀàËÆjava ÀïÃæµÄswitch case
[root@localhost scripts]# cat sh12.sh
read -p "input comand:" command
case $command in
"fix")
echo "fix system"
;;
"fuck")
echo "fuck you"
;;
*)
echo "what a stupid man!ex>$0 some word"
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ