일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 컴시
- 별
- logo
- 미디어학부
- 우분투
- Signal
- 컴퓨터시스템개론
- 프로세스
- 태그를 입력해 주세요.
- 로고 프로그램
- 커널
- 정기철
- 숭실대
- 와인
- Lock
- 학생복지위원회
- 쓰레드
- kernel
- 로고
- wine
- 리눅스
- 함수
- 운영체제
- 별지기
- 파일io
- Android
- 안드로이드
- Linux
- Process
- 학복위
- Today
- Total
두근두근이야기
[퍼온글입니다]리눅스 프로젝트1 본문
1
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.3.tar.gz
tar xvfz linux-2.6.37.3.tar.gz
mv linux-2.6.37.3 /usr/src/
cd /usr/src/linux-2.6.37.3
make mrproper
make oldconfig //ncurse lib needed .config 복사?..
make
make modules
make modules_install
cp /usr/src/linux-2.6.37.3/arch/x86/boot/bzImage /boot/vmlinuz-2.6.37.3
cp /usr/src/linux-2.6.37.3/System.map /boot/System.map-2.6.37.3
cd /boot
mkinitrd initrd-2.6.37.3.img 2.6.37.3
gedit /etc/grub.conf
######################################################################################
######################################################################################
2. syscall add
linux source/arch/x86/include/asm/unistd_32.h
#define __NR_newsyscall 341
gedit arch/x86/kernel/syscall_table_32.S
.long sys_newcall /* 341 */
linux source/kernel 에서 newcall.c
#include <linux/unistd.h , errno.h, kernel.h, sched.h>
asmlinkage int sys_newcall(int n){
printk("hello");
return 0;
}
linux source/kernel 에서 Makefile o추가.
1.번과 동일.
test gcc -I/linux source/include
test.c #include <linux/unistd.h, stdio.h>
int n; n= newsyscall(10);
라이브러리 작성?
######################################################################################
######################################################################################
3.
ifconfig eth0 192.168.0.1 up
ifconfig eth0 192.168.0.2 up
setip 192.168.0.1 192.168.0.2
setip 192.168.0.2 192.168.0.1
mount -t nfs 192.168.0.1:/nfs_resources /mnt/nfs
######################################################################################
######################################################################################
4?
bus problem..
DEFAULTS=/root/linux-2.4.19-rmk4-pxa2-sm1/.config
######################################################################################
######################################################################################
5. 체크포인트..
/usr/src/linux-2.4.22/include/linux/sched.c
420line int shoud_ckpt;
/usr/src/linux-2.4.22/arch/i386/kernel/proccess.c
790line current->should_ckpt = 0;
/usr/src/linux-2.4.22/include /asm-i386/unistd.h
260 line #define __NR_ckpt 259
#define __NR_recover 260
/usr/src/linux-2.4.22/arch/i386/kernel/entry.S
218line call SYMBOL(do_ckpt)
667line .long SYMBOL_NAME(sys_ckpt)
668line .long SYMBOL_NAME(sys_recover)
/usr/src/linux-2.4.22/kernel/Makefile
ckpt.o 추가 ckpt.c복사
cp /boot/config-2.4.20-8 /usr/src/linux/.config, oldconfig , bzImage , modules , modules_install , install
######################################################################################
######################################################################################
6. 프로젝트
1. should ckpt;
./include/linux/sunrpc/sched.h
2.arch/arm/kernel/sys_arm.c
error = do_execve(filename, argv, envp, regs);
if ( error == 0 ){
current->should_ckpt = 0;
}
putname(filename);
3./root/linux-2.4.19/include/asm-arm/unistd.h
#define __NR_ckpt (__NR_SYSCALL_BASE+226)
#define __NR_recover (__NR_SYSCALL_BASE+226)
4./root/linux-2.4.19/arch/arm/kernel/entry-common.S
blne __do_signal
call SYMBOL_NAME(do_ckpt)
restore_user_regs
5.call.S
/* 226 */ .long SYMBOL_NAME(sys_ckpt)
/* 227 */ .long SYMBOL_NAME(sys_recover)
출처: http://blog.naver.com/PostView.nhn?blogId=bg810113&logNo=30136468539
이쪽 블로그 한번씩 방문해 주세요!
'IT > IT ::Advanced SystemProgramming' 카테고리의 다른 글
mta sztaki (0) | 2013.04.27 |
---|---|
arm register (0) | 2013.04.26 |
유용한 블로그네요. 많이들 방문해보세요 (0) | 2013.04.26 |
[퍼온글입니다]barrios kernel story (0) | 2013.04.26 |
http://lxr.linux.no/ 리눅스 커널소스 분석 사이트, 크로스 레퍼런스 등 제공 (0) | 2013.04.26 |