dm642 cÔËÐпâµÄmalloc·ÖÎö
cÔËÐпâmalloc·ÖÅäµÄÄÚ´æÔÚÄÄÀïÄØ£¬Ê×ÏÈÉÏ´úÂ룺
//ÄÚ´æ´óСÁ¬½ÓÆ÷½«ÆäµØÖ·Ö¸Ïò-heapÑ¡Ïî
extern _DATA_ACCESS int _SYSMEM_SIZE;
//ÄÚ´æÇøÓò
#pragma DATA_SECTION(_sys_memory, ".sysmem")
far PACKET _sys_memory[1] = { ((size_t)&_SYSMEM_SIZE) - sizeof(PACKET), 0 };
ÔÚbiosÉèÖÃÀïÃ棬system--->mem->property->general, segment for malloc() / free(), ÉèÖóÉSDRAM£» ÔÚbiosÉèÖÃÀïÃ棬system--->mem->property->general, segment for malloc() / free(), ÉèÖóÉSDRAM£»Òâ˼ÊÇʵÏÖ±ê×¼CµÄmalloc/freeµÈº¯Êý£¨ÈçMEM_alloc£©À´ÉêÇëºÍÊÍ·ÅÄÚ´æ¡£²Î¿¼spru403q.pdf£¬page269
Ïà¹ØÎĵµ£º
Ò»°ãÎÒÃǵ÷ÓÃshell½Å±¾¶¼ÓÃsystem()À´ÊµÏÖ£¬È»ºó·¢ÏÖsytem·µ»ØÖµ²»ºÃ¿ØÖƶøÇÒת»»Âé·³(»¹ÒªÓÒÒÆ4λ¼´/256)£¬ÓÚÊÇÎÒÓÃpopenÀ´»ñÈ¡shellµÄ·µ»ØÖµ¡£¹ûÈ»ÔÚUnixÊÀ½çÀïÃ棬ͨµÀ¾ÍÊÇÁ¬½á¸÷¸ö·½ÃæµÄÇÅÁº°¡£¡
´úÂëÀý×ÓÈçÏ£º
#include<stdio.h>
#include<stdlib.h>
#include<sys/wait.h>
int main (int argc ......
9Ô¶¼¿ì½áÊøÁË£¬Ö®Ç°Ò»Ö±Ã¦µ½Ð´×Ô¼ºµÄ¶«Î÷¼ÓÉÏÉÏ°à¡£»ù±¾Ã»ÓÐʱ¼äÑо¿Ï»ã±àºÍC C++·½ÃæµÄ¸ÐÐËȤµÄ¶«Î÷¡£ÔÙÔõô˵Â9Ô»¹ÊǵÃдһƪÈö£¬ÒÔºóÿÔÂÖÁÉÙһƪ°É¡£¸ø×Ô¼º¶¨ÁË£¬Ï£Íû´ó¼Ò¼à¶½¡£ºÙºÙ£¡
ÕâƪÎÄÕ¾ÍÀ´Ì¸Ì¸Æ½³£ºÜ³£¼ûµÄHOOK¼¼Êõ£¬ÕâÀïÄØ¡£Ð´µÃ±È½Ï¼òµ¥£¬·½·¨ºÜ¶à¡£Ö»½²ÔÀí£¡Ï£Íû´óÄñÃDZðÍÂÎÒ¿ÚË®¹þ - -¡£ºÃ£¡ÇÐÈëÕ ......
fopen("/var/spool/cron/tmp","w+");
/////////////////////////////////////////
££i nclude <sys/types.h>
££i nclude <sys/stat.h>
££i nclude <fcntl.h>
££i nclude <unistd.h>
££i nclude <stdio.h>
££i nclude <string.h>
££i nclude <stdlib.h>
int main(){
in ......
Ò»¡¢Ê²Ã´ÊÇc/sºÍb/s
ÒªÏë¶Ô“c/s”ºÍ“b/s”¼¼Êõ·¢Õ¹±ä»¯ÓÐËùÁ˽⣬Ê×ÏȱØÐë¸ãÇå³þÈý¸öÎÊÌâ¡£
µÚÒ»¡¢Ê²Ã´ÊÇc/s½á¹¹¡£
c/s£¨client/server£©½á¹¹£¬¼´´ó¼ÒÊìÖªµÄ¿Í»§»úºÍ·þÎñÆ÷½á¹¹¡£ËüÊÇÈí¼þϵͳÌåϵ½á¹¹£¬Í¨¹ýËü¿ÉÒÔ³ä·ÖÀûÓÃÁ½¶ËÓ²¼þ»·¾³µÄÓÅÊÆ£¬½«ÈÎÎñºÏÀí·ÖÅäµ½client¶ËºÍserver¶ËÀ´ÊµÏÖ£¬½µµÍÁ ......
exercise2.4
void squeeze(char s[],char t[])
{
int i,j,k;
int lens,lent;
lens=strlen(s);
lent=strlen(t);
for(i=0,k=0;i<lens;i++)
{
for(j=0;j<lent;j++)
if(s[i]==t[j])
break;
if(j==lent)
s[k++]=s[i];
}
s[k]='\0';
}
exercise2.5
int any(char s[],char t[ ......