*인*
개인 인증
판매자 정보
학교정보
입력된 정보가 없습니다.
직장정보
입력된 정보가 없습니다.
자격증
판매지수
판매중 자료수
9개
전체 판매량
93개
최근 3개월 판매량
0개
자료후기 점수
평균 A
자료문의 응답률
-
전체자료 9개
임베디드프로젝트 (Graphic LCD로 문자나 그림을 출력)
▣ 프로젝트를 수행할 때 얻게 되는 장점➊ LDS2000장비를 사용하지 않기 때문에 실습후에도 LDS2000장비에 대해 별도로 시간과 장소를 할애 하지 않아도 된다.❷ 실습의 틀에서 벗어나 창의적인 주제로 프로젝트를 할 수 있기 때문에 프로젝트에 대한 질을 향상시킬 수 있다고 본다.❸ 임베디스 소프트웨어를 직접 구상하고 만들어 봄으로서 차후 다른 여러 소프트웨어도 쉽게 제작할 수 있을거라 생각된다.❹ 프로젝트를 수행함으로써, 실무에 중점을 둘 수 있고 프로젝트 진행 능력과 프로젝트 운영 환경등을 체험할 수 있다.2. 연구개발 목표 이번 프로젝트의 최종 목표는 실습에서 배운 내용을 토대로 PC의 직렬포트나 병렬포트를 이용하여 Graphic LCD로 문자나 그림을 출력하는 것이다.❶ linux kernel2.4기반의 응용 프로그램을 통한 LCD화면에서의 GUI환경 구현❷ 매크로를 통한 예약그림과 예약문자 LCD화면 출력❸ 응용프로그램에서의 키조작을 통한 LCD화면의 메뉴이동3. 연구개발 내용 및 범위▣ 연 구 내 용❶ 연구 개발장비 확보 및 개발 환경 조성❷ Graphic LCD의 디바이스 드라이버 작성❸ 디바이스 드라이버와 사용자간의 응용프로그램 구현❹ 예약된 문자와 그림을 Graphic LCD에서 출력❺ 응용프로그램에서의 이미지 호출을 Graphic LCD에서 매크로 형식으로 출력❻ 사용자가 Graphic LCD의 메뉴를 보고 메뉴이동 키를 누르면 Graphic LCD에서의 메뉴이동....
공학/기술 |
2011.06.26|
40페이지| 3,000원 |
조회(680)
미리보기
[운영체제(OS) Shell(셸) 구현]운영체제(OS) Shell 구현
1. 문제 제기(1) 환경 변수 관련(2) CD 명령어 구현(3) 히스토리 관련(4) 명령어관련i) && 와 || 관련ii) ; 와 ( ) 구현(5) 리다이렉션 관련(6) 파이프 관련2. 관련 연구(2) cdint chdir(const char *path)char * getcwd(char *buf, size_t size);해더파일 : unistd.hChdir() 함수에는 변경하고자 하는 경로 명을 인수로 전달한다.Getcwd() 함수는 현재의 경로 위치를 첫번째 인수 buf에 넘겨준다.(3) historyint isdigiit(int c);Int isalpha(int c);해더파일 : chtype.h(6) pipeint pipe(int file_descriptor[2]);해더파일 : unistd.hPipe()함수를 호출하면 파이프를 생성하고 file_descriptor배열에 파이프 디스크립터를두개 받아온다.3. 문제 해결 방법(2) cd 명령어 구현int chdir(const char *path);char * getcwd(char *buf, sizt_t size);위의 함수를 이용하여서 모든 cd 명령어의 옵션을 구현하였습니다.(3) 히스토리 관련History 라는 2차원 배열을 전역 변수로 선언하여 사용자가 입력모든 명령어를배열에다가 넣어두고.. 번호가 들어오면은 들어온 번호의 배열을 실행시켰고문자가 들어오면은 strstr() 함수를 이용하여서 가장 최근의 명령어를 찾아서 실행시켰습니다.(4) && 와 || 구현&& 와 || 를 먼저 파싱을 한 후에 && 와 || 의 개수만큼 반복을 한다.그런데 && 는 1번째 명령어가 참을 경우에만 뒤의 명령어를 실행하고 || 의 경우에는1번째 명령어가 참이 아닐 경우에도 실행을 한다.(6) 파이프 관련Pipe() 함수를 호출하면 파이프를 생성하고 file_descriptor 배열에 파이프 디스크립터를두개 받아온다.이중 file_descriptor[0]에는 파이프의 입력 디스크립터를 ,file_descriptor[1]에는 mmand */int run_pipeCmd(char *arg[]);/* run pipe command*/int run_orCmd(char *arg[]);/* run || command*/int run_andCmd(char *arg[]);/* run && command*/void redirect_in(char *arg[]); /* redirection "" */void redirect_out_add(char *arg[]);/* redirection ">>" */int builtin_func(char *arg[]);/* cd, pwd , exit Command */void cd_func(char *arg[]);/* change dirctory */void run_history(char arg[]);/* history command */void history_display(void); /* history display */void set_history(char arg[]); /* history command save */void pwd_func(char *argv[]);/* pwd*/void exit_func(char *argv[]);/* exit*/int back_func(char *arg[]);/* & */int pipe_check(char *arg[]);/* | check*/struct builtcmd {char *cmd;void (*fptr)(char *arg[]);}builtin[6] ={ {"cd", cd_func},{"pwd",pwd_func}, {"exit",exit_func},{NULL,NULL} };char history[100][20]; /* history save command */char history_Count;/* history Command Count */char env[100][100];/* */char temp_homedir[1024];/* Temp Home dirtoary */extern char **environ;char **pifunc(or_arglist)){run_orCmd(or_arglist);}}else if(pArgCnt == 2 || pArgCnt == 1){if(!builtin_func(arglist)){run_command(arglist);}}else if(!builtin_func(pipe_arglist)){run_pipeCmd(pipe_arglist);}pArgCnt = 0;/* pipe Command init */orCnt = 0; /* || Command init */andCnt = 0; /* && Command init */for(i=0; or_arglist[i]; i++)or_arglist[i] = NULL;for(i=0; and_arglist[i]; i++)and_arglist[i] = NULL;for(i=0; arglist[i]; i++)arglist[i]=NULL;}}char ** parse(char *line){// parseingchar *token;static char *arg[80];int i=0;if(line==NULL)return NULL;token=strtok(line," tn");while(token){arg[i++]=token;token=strtok(NULL, " tn");}arg[i]=NULL;return (char **) arg;}char ** pipe_parse(char *line){// pipe parseing ( | )char *token;static char *arg_pipe[80];int i=0;if(line==NULL)return NULL;token=strtok(line,"|");while(token){arg_pipe[i++]=token;token=strtok(NULL, "|");pArgCnt++;}arg_pipe[i]=NULL;return (char **) arg_pipe;}char ** or_parse(char *line){// parseing ( || )char *token;static char *arg_or[80g[0]);exit(1);}close(0);dup2(pfd[0], 0);close(pfd[0]);close(pfd[1]);execvp(arg[pipe_pos+1], &arg[pipe_pos+1]);perror("execvp");break;}else{execvp(arg[0], &arg[0]);exit(1);}default:if(back_flag==0){waitpid(pid,NULL,0);}waitpid(-1, NULL, WNOHANG);break;}return 0;}int run_pipeCmd(char *arg[]) // 참고 1번 참고 2번{int i,pid;char **arglist;char **arglist2;int pfd[2];if((pid = fork()) == 0){for(i = 0; i < pArgCnt-1;i++){pipe(pfd);switch(pid = fork()){case -1:perror("fork");exit(1);case 0:close(STDOUT_FILENO);dup2(pfd[1],STDOUT_FILENO);close(pfd[0]);close(pfd[1]);arglist = parse(arg[i]);execvp(arglist[0],arglist);break;default:close(STDIN_FILENO);dup2(pfd[0],STDIN_FILENO);close(pfd[0]);close(pfd[1]);}}arglist2 = parse(arg[pArgCnt-1]);execvp(arglist2[0],arglist2);}else{waitpid(pid, NULL, 0);}return 0;}int run_orCmd(char *arg[]){int i,pid;char **arglist;int pfd[2];if((pid = fork()) == 0){for(i = 0; i < orCnt;i++){pipe(pfd);switch(pid = fork()){case -1:perror("fork");exit(1);case 0:arglist = parse(argi]; i++){if(strcmp(arg[i], ">>") == 0)break;}if(arg[i]){if((fd = open(arg[i+1],O_WRONLY|O_APPEND,0644))==-1){perror("open");return ;}dup2(fd,1);close(fd);for(;arg[i+2];i++)arg[i] = arg[i+2];arg[i] = NULL;}}int builtin_func(char *arg[]){// builtin Commandint i;for(i = 0; builtin[i].cmd ; i++){if(strcmp(builtin[i].cmd,arg[0]) == 0){builtin[i].fptr(arg);return 1;}}return 0;}void cd_func(char *arg[]) 참고 1번 143page{// change dirtorychar* homedir;char path[1024];strcpy(path,getcwd(path,1023));if(arg[1]==NULL){homedir = getenv("HOME");}else if(strcmp(arg[1],"~")== 0){ /* home dir */homedir = getenv("HOME");}else if(strcmp(arg[1],"-") == 0){chdir(temp_homedir);}elsehomedir=arg[1];if(strcmp(arg[1],"-") == 0){chdir(temp_homedir);}else{chdir(homedir);}if(!strcmp(temp_homedir,path)== 0){strcpy(temp_homedir,path);}}void pwd_func(char *arg[]){// pwdchar path[1024];getcwd(path,1023);printf("%sn",path);}void exit_func(char *arg[]){exit(0);}void run_history(char arg[]){// history cmmand runint num;int}
공학/기술 |
2010.06.15|
23페이지| 2,000원 |
조회(580)
미리보기
[운영체제(OS) Shell(셸) 구현]운영체제(OS) Shell 구현
#include #include #include #include #include #include #include #include #include #include #include #include #include /* User define function */char ** parse(char *line); /* parseing */char ** pipe_parse(char *line); /* pipe_parseing */char ** or_parse(char *line); /* || parseing */char ** and_parse(char *line); /* && parseing */int run_command(char *arg[]); /* command */int run_pipeCmd(char *arg[]); /* run pipe command */int run_orCmd(char *arg[]); /* run || command */int run_andCmd(char *arg[]); /* run && command */void redirect_in(char *arg[]); /* redirection "" */void redirect_out_add(char *arg[]); /* redirection ">>" */int builtin_func(char *arg[]); /* cd, pwd , exit Command */void cd_func(char *arg[]); /* change dirctory */void run_history(char arg[]); /* history command */void history_display(void); /* history display */void set_history(char arg[]); /* history command save */void pwd_func(char *argv[]); /* pwd */void exit_func(char *argv[]); /* exit */int back_func(char *arg[]); (void){char line[256]; /* User Input Save array */char pipe_line[256];char or_line[256];char and_line[256];char **arglist;int i;while(1){printf("myshell> ");fgets(line, 255, stdin);if(line[0]=='n')continue;if(line[0]== ' ')continue;line[strlen(line)-1]='