[시스템프로그래밍][4장모듈프로그래밍][03모듈에 대해 알아야 할 것들]
[모듈과 커널 버전] 커널의 버전 확인하는 방법 : /linux/version.h #define UTS_RELEASE "2.6.14.6"#define LINUX_VERSION_CODE 132622#define KERNEL_VERSION(a, b, c) (((a)
2012.11.23
C에서 프로그램 수행 시간 측정 방법
C에서 프로그램 수행 시간 측정 방법#include "stdio.h" #include "time.h" void main() { clock_t before; double result; before = clock(); for ( int i = 0; i
2012.11.22
[screen] 설정파일
1. 설정 파일 위치/etc/screenrc 2. 유용한 옵션# turn visual bell onvbell onvbell_msg " Wuff ---- Wuff!! "
2012.11.21
[시스템프로그래밍]4장. [모듈프로그래밍]Hello_Module
1. 2.6커널용 Hello_Module 작성 #include #include #include // init routine int __init init_hello(void) { printk(KERN_ALERT "[Module Message] Hello, Module.\n"); return 0; } // finish routine void __exit exit_hello(void) { printk(KERN_ALERT "[Module Message] Do you realy want to break up with me?\n"); } module_init(init_hello); module_exit(exit_hello); MODULE_LICENSE("GPL"); 2. 2.6 모듈 빌드용 Make 파일 obj-m..
2012.11.21
[BackTracking] NQueen
문제 출처 : http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1889 나의 답 : 아래 코드이다.. 하지만 N = 13일경우 1초내에 계산이 안되서 accepted되었다..ㅠㅠ 속도 향상할 수 있는 point를 찾아야 겠다.. #include #include #define DEBUG 0 #define MAX_QUEENS 14 int g_cols[MAX_QUEENS]; // represent of chess board // g_cols[index] : column, index : row int g_num_queens; int g_num_possible_sequence; void SetInputFromFile(const char* fileName); v..
2012.11.20
[Greedy] 저울
출처 : http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=2499 2011.KOI.전국.초등부 #include #define DEBUG 1 #define MAX_WEIGHTS 1000 void SetInputFromFile(const char* fileName, int *num_weights, int *weights); void PrintAnswerToFile(const char* fileName, int min_umw /*minimum unmeasurable weight*/); int GetMinUnmeasurableWeight(const int num_weights, int *weights); void SortWeight(int num_weight..
2012.11.19
[시스템프로그래밍]03. [시스템콜]cpu_info
arm에서 사용하는 cpu_info 구조체는 /arch/arm/include/asm/cpu.h에 struct cpu_info_asm {...}으로 정의 되어 있다. 이 정보는 책과는 달라서 타겟의 proc/cpuinfo를 보려고 하였으나, proc파일시스템이 없는 것이다!!!!!허걱.... 그래서 FALINUX포럼에 가서 proc파일 시스템 만드는 법이 있길래 해보려고 했다..하지만, 아직 실력이 부족해서 뭔 말인지 모르겠다.ㅠㅠㅠ 나중에 실력좀 쌓이면 타겟에 간단하게나마 proc파일 시스템을 올려 보아야 겠다.
2012.11.19
[Greedy] 회의실 배정
출저 : 정올 (http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1370) #include #define DEBUG 1 typedef struct { int requested_order; int start_hour; int end_hour;}MEETING; MEETING g_requested_meetings[501];int g_num_requested_meetings;MEETING g_scheduled_meeting[501]; int ScheduleMeetings();void SortRequestedMeetings();void PrintRequestedMeetings(); // input outputvoid SetInputFfromFile(char* ..
2012.11.11
no image
[리눅스커널프로그래밍]01.개발환경 세팅
개발 환경 세팅 임베디드 보드에 개발을 하기 위해서는 개발환경 세팅을 좀 해주어야 합니다.이 부분은 인터넷을 찾아보면 다양하게 나와 있어 저도 많이 참고 했습니다. 많이 이용하는 방법은.윈도우가 설치된 PC, 가상OS로 리눅스(HOST), 개발보드(TARGET)를 갖춘 상태에서,서로를 연결하기 위한 공유기(로컬네트워크를 구축해야지요..), tftp, samba, nfs 를 이용하여 개발환경우 갖추었습니다. 다만 제가 가장 OS상에서 네트워크 설정을 잘 못해서 노트북에 리눅스를 설치에 버렸습니다.(다행이 노는 노트북이 있었네요.ㅎㅎ) 자 그럼, 제가 어떻게 세팅했는지에 대한 개략도입니다..
2012.11.11