Presentation is loading. Please wait.

Presentation is loading. Please wait.

졸업 프로젝트 발표 1/74 Trinity Snapshot Boot 날 짜: 팀 명: Trinity

Similar presentations


Presentation on theme: "졸업 프로젝트 발표 1/74 Trinity Snapshot Boot 날 짜: 팀 명: Trinity"— Presentation transcript:

1 졸업 프로젝트 발표 1/74 Trinity Snapshot Boot 날 짜: 2010. 06. 10 팀 명: Trinity
팀 원: 정진철, 추민호, 김승태 지도교수: 임성수 교수님

2 2/74 Contents Contents I. Introduction II. Background
III. Expected effects IV. Technical Requirement – Suspend & Resume V. Odroid VI. Output Detail VII. Limiting factor VIII. Development Environment IX. Development Schedule X. Milestone XI. Reference

3 “Embedded System”에 관한 주제를 다루기로 하였습니다.
I. Introduction 3/74 『Trinity』 팀은 “Embedded System”에 관한 주제를 다루기로 하였습니다. 그 중, “Snapshot Boot” 라는 부팅 기법에 관하여 이번 프로젝트를 진행 할 계획입니다. “Snapshot Boot”는 Embedded Linux System에서 『Snapshot Image』 를 이용하여 빠른 부팅 시간을 얻기 위한 부팅 기술입니다.

4 Too Slow… 4/74 II. Background Global Smart Phone Market ↑ But,
Smart Phone Boot Time is … Too Slow… Boot Time은 Smart Phone 시장에서 중요한 경쟁력 요소가 될 것이다.

5 III. Expected effect 5/74 NAND Flash Price ↓ Embedded System에 저장장치를 추가하여 Snapshot Image를 사용하는 Snapshot Boot를 적용하면 빠른 부팅을 제공할 수 있다.

6 IV. Technical Requirement 6/74
1. ARM Architecture 기반의 Suspend 기능 구현 2. Boot loader Level에서 Resume 기능 구현 Snapshot Boot 기능 구현

7 Snapshot Boot Sequence
IV. Technical Requirement 7/74 Snapshot Boot Sequence

8 System의 RAM 과 Register의 내용를
IV. Technical Requirement - Suspend 8/74 Suspend-to-Disk System의 RAM 과 Register의 내용를 저장매체에 쓰는 작업을 말한다. DRAM (DDR2) Essential Pages Suspend Call 8GB SDHC Card Snapshot Image Suspend & Resume Processor Freeze Device Suspend Register States

9 * * * 9/74 IV. Technical Requirement - Suspend
‘Suspend to Disk’ - Procedure freeze_processes() Powerdown machine * free_some_memory() write_suspend_image() device_suspend() device_resume() device_power_down() device_power_up() * * save_processor_state() Make Snapshot Image

10 Details of Suspend procedure
IV. Technical Requirement - Suspend 10/74 Details of Suspend procedure Hibernation이 최초로 시작된다. Memory management Structure를 할당한다. Hibernate작업 이전에 프로세스 준비작업등을 수행한다.

11 Details of Suspend procedure
IV. Technical Requirement - Suspend 11/74 Details of Suspend procedure Page frames를 만들기 위한 비트맵을 메모리에 생성한다. Bitmap data structure는 Memory page를 가리키는 linked list로 구성된다.

12 Details of Suspend procedure
IV. Technical Requirement - Suspend 12/74 Details of Suspend procedure Processor가 활성화 되어있는지 확인한다.

13 Details of Suspend procedure
IV. Technical Requirement - Suspend 13/74 Details of Suspend procedure 사용자가 입력한 hibernation mode가 적합한지를 확인한다.

14 Details of Suspend procedure
IV. Technical Requirement - Suspend 14/74 Details of Suspend procedure Hibernation을 수행할 수 있는지 Power Management의 Level을 확인한다.

15 Details of Suspend procedure
IV. Technical Requirement - Suspend 15/74 Details of Suspend procedure 각각의 test를 수행하는 동안 5초간 Delay를 준다.

16 Details of Suspend procedure
IV. Technical Requirement - Suspend 16/74 Details of Suspend procedure 장치들을 멈추고 Snapshot image를 만든다.

17 Details of Suspend procedure
IV. Technical Requirement - Suspend 17/74 Details of Suspend procedure 필요한 메모리의 크기만큼 공간을 비워둔다.

18 Details of Suspend procedure
IV. Technical Requirement - Suspend 18/74 Details of Suspend procedure Power Management Event Message 프로세스를 중단시킨다.

19 Details of Suspend procedure
IV. Technical Requirement - Suspend 19/74 Details of Suspend procedure Interrupt를 중단시키고, 장치들을 중단 시킨후, Hibernation image를 생성한다. 이미지 생성을 마치면, 다시 장치들을 실행한다.

20 Details of Suspend procedure
IV. Technical Requirement - Suspend 20/74 Details of Suspend procedure Suspend를 시작을 나타내는 함수이다.

21 Details of Suspend procedure
IV. Technical Requirement - Suspend 21/74 Details of Suspend procedure Power Management 에서 사용하는 Active device에 Lock을 건다.

22 Details of Suspend procedure
IV. Technical Requirement - Suspend 22/74 Details of Suspend procedure Device의 전원을 끈다.

23 Details of Suspend procedure
IV. Technical Requirement - Suspend 23/74 Details of Suspend procedure 프로세서의 현재 상태를 저장한다.

24 Details of Suspend procedure
IV. Technical Requirement - Suspend 24/74 Details of Suspend procedure 프로세서를 다시 복구한다.

25 Details of Suspend procedure
IV. Technical Requirement - Suspend 25/74 Details of Suspend procedure 장치들을 다시 작동시킨다.

26 IV. Technical Requirement - Suspend 26/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image device_power_up() Trigger “Suspend-to-Disk” -> Everything works fine. device_resume() write_suspend_image() Powerdown machine

27 IV. Technical Requirement - Suspend 27/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image 2. Freeze processes -> Freeze processes works correctly. device_power_up() device_resume() write_suspend_image() Powerdown machine

28 IV. Technical Requirement - Suspend 28/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image 3. Free unnecessary memory ->We think that free unnecessary memory works correctly, because nr_free_pages become from 39708 device_power_up() device_resume() write_suspend_image() Powerdown machine

29 IV. Technical Requirement - Suspend 29/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image 4. Suspend devices ->Suspend devices procedure works well. device_power_up() device_resume() write_suspend_image() Powerdown machine

30 IV. Technical Requirement - Suspend 30/74
freeze_processes() free_some_memory() device_suspend() device_power_down() 5. Power down devices ->Power down devices procedure works well. save_processor_state() Make Snapshot Image device_power_up() device_resume() write_suspend_image() Powerdown machine

31 IV. Technical Requirement - Suspend 31/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image device_power_up() 6. Save processor state device_resume() write_suspend_image() Powerdown machine

32 IV. Technical Requirement - Suspend 32/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image device_power_up() device_resume() 7. Save processor registers write_suspend_image() Powerdown machine

33 IV. Technical Requirement - Suspend 33/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image 8. Allocate memory for snapshot image device_power_up() device_resume() write_suspend_image() Powerdown machine

34 IV. Technical Requirement - Suspend 34/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image device_power_up() 10. Restore processor state ->Store processor state’s reverse procedure. We think that it works fine. device_resume() write_suspend_image() Powerdown machine

35 IV. Technical Requirement - Suspend
35/74 IV. Technical Requirement - Suspend freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() Make Snapshot Image device_power_up() 11 – 14. ->Procedure works from 11 to 14. device_resume() write_suspend_image() Powerdown machine

36 IV. Technical Requirement - Suspend 36/74
freeze_processes() free_some_memory() device_suspend() device_power_down() save_processor_state() 15. Halt machine -> Power off machine code works fine. Make Snapshot Image device_power_up() device_resume() write_suspend_image() Powerdown machine

37 Resume 37/74 IV. Technical Requirement - Resume Snapshot Image를 이용하여
System을 복구하는 과정이다. DRAM (DDR2) Essential Pages Resume Call Image Check 8GB SDHC Card Snapshot Image Suspend & Resume Restore Processor Freeze Device Suspend Register States

38 * * * Jump to kernel 38/74 IV. Technical Requirement - Resume
Boot Loader (U-Boot 1.3.4) software_resume() Read system image from storage to RAM Wakeup board freeze_processes() * Copy system image to RAM device_suspend() * Minimal device setup for resume device_power_down() Jump to kernel resume point Restore system image * Jump to kernel restore_processor_state() device_power_up() device_resume() thaw_processes()

39 Details of Resume procedure
IV. Technical Requirement - Resume 39/74 Details of Resume procedure Resume이 시작되는 지점이다. software_resume()을 호출한다.

40 Details of Resume procedure
IV. Technical Requirement - Resume 40/74 Details of Resume procedure 이미지 검사를 수행하며, Device를 멈추고, 이미지를 메모리로 복원하는 함수를 호출한다.

41 Details of Resume procedure
IV. Technical Requirement - Resume 41/74 Details of Resume procedure Resume device의 signature를 확인한다. Image File을 검증하는 단계이다.

42 Details of Resume procedure
IV. Technical Requirement - Resume 42/74 Details of Resume procedure Page Frame을 만들기 위한 bitmaps을 메모리에 생성한다.

43 Details of Resume procedure
IV. Technical Requirement - Resume 43/74 Details of Resume procedure Hibernation Image를 읽는다.

44 Details of Resume procedure
IV. Technical Requirement - Resume 44/74 Details of Resume procedure 장치를 멈추고, Hibernation image를 복구한다.

45 Details of Resume procedure
IV. Technical Requirement - Resume 45/74 Details of Resume procedure Device를 중지시킨다.

46 Details of Resume procedure
IV. Technical Requirement - Resume 46/74 Details of Resume procedure 각 장치들의 interrupt를 꺼주고, 저장된 이미지로부터 ram의 Content를 복구한다.

47 Details of Resume procedure
IV. Technical Requirement - Resume 47/74 Details of Resume procedure Device의 전원을 종료한다.

48 Details of Resume procedure
IV. Technical Requirement - Resume 48/74 Details of Resume procedure 메모리의 contents를 Suspend image로 부터 복구한다.

49 Details of Resume procedure
IV. Technical Requirement - Resume 49/74 Details of Resume procedure 중단된 프로세서의 상태를 복구한다.

50 Details of Resume procedure
IV. Technical Requirement - Resume 50/74 Details of Resume procedure Device의 전원을 다시 공급한다.

51 U-Boot 51/74 IV. Technical Requirement - Boot loader
ARM, MIPS, PPC와 같은 다양한 Architecture를 지원하는 Boot-loader이다. Initialize CPU Initialize Board Uncompress Kernel Load Kernel to Memory Uncompress RFS Image Load RFS to Memory Initialize Devices Kernel Preparation Root File System Preparation Boot-loader Level

52 U-Boot(1.3.4) Directory Structure
IV. Technical Requirement - Boot loader 52/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net U-Boot(1.3.4) Directory Structure

53 각각의 보드 초기화 함수가 구현되어 있으며, board.c 파일로부터 호출된다.
IV. Technical Requirement - Boot loader 53/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 각각의 보드 초기화 함수가 구현되어 있으며, board.c 파일로부터 호출된다.

54 IV. Technical Requirement - Boot loader 54/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net Architecture나 Target에 무관한 소프트웨어로 시간설정, USB 디바이스 설정 명령어 등이 존재한다.

55 각각의 CPU에 대한 정보와 interrupt 함수가
IV. Technical Requirement - Boot loader 55/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 각각의 CPU에 대한 정보와 interrupt 함수가 구현된 파일이 있다.

56 IV. Technical Requirement - Boot loader 56/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 디스크 드라이버 (SATA/SCSI) 및 디스크 파티션 정보가 들어있다.

57 IV. Technical Requirement - Boot loader 57/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 네트워크, PCI와 같은 장치 드라이버가 있다.

58 IV. Technical Requirement - Boot loader 58/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 각 보드 장치의 base address 주소, memory Controller에 관한 레지스터 설정 헤더파일이 있다.

59 메모리 크기 설정, baudrate 설정, CPU 정보 출력 등 각 보드의 특정 루틴을 호출하는
IV. Technical Requirement - Boot loader 59/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 메모리 크기 설정, baudrate 설정, CPU 정보 출력 등 각 보드의 특정 루틴을 호출하는 프로세서 라이브러리 파일이 있다.

60 TFTP, ARP등 Ethernet 설정 함수가 있다.
IV. Technical Requirement - Boot loader 60/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net TFTP, ARP등 Ethernet 설정 함수가 있다.

61 IV. Technical Requirement - Boot loader 61/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net README 문서가 있다.

62 IV. Technical Requirement - Boot loader 62/74
U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 예제코드가 있다.

63 FAT/JFFS와 같은 파일시스템 코드가 있다.
IV. Technical Requirement - Boot loader 63/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net FAT/JFFS와 같은 파일시스템 코드가 있다.

64 S-Record 또는 U-Boot image를 만드는
IV. Technical Requirement - Boot loader 64/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net S-Record 또는 U-Boot image를 만드는 도구 코드가 있다.

65 각 장치에 대해 Power On Self Test를 하는
IV. Technical Requirement - Boot loader 65/74 U-Boot Hierarchy /u-boot api api_examples doc examples fs nand_spl onenand_* post tools board common cpu disk drivers include Lib_* net 각 장치에 대해 Power On Self Test를 하는 코드가 있다.

66 Processor: S5PC100 (Cortex-A8) Memory: 512MB DDR2
V. Odroid 66/74 Specifications Processor: S5PC100 (Cortex-A8) Memory: 512MB DDR2 Flash: 10GB (2GB T-Flash, 8GB SDHC) Operating System: Android 1.5R3 with Linux

67 Snapshot Boot Sequence
VI. Output Detail 67/74 Snapshot Boot Sequence Initialize Board Restore Register Setup Device Resume Device & System Power On Boot-loader (U-Boot) Kernel Check Image State Resumed Create Image 8GB SDHC Card DRAM (DDR2) Essential Pages Copy Image Previous State Snapshot Image

68 VI. Output Detail 68/74

69 VI. Output Detail 69/74

70 VII. Limiting Factor 70/74 Memory uses: KB (146MB) SDHD Card Transcend 8GB SDHC Card Read Speed: 14.54MB/Sec Write Speed: 7.93MB/Sec 145MB / 14.54MB/Sec = 9.97 Sec/Read 145MB / 7.93MB/Sec = Sec/Write 실제로 사용되는 Active Page만 Image로 만드는 방법을 적용시켜야 한다.

71 VIII. Development Environment
71/74 Hardware: Intel Pentium 4 CPU 2.80GHz 512 MB DDR2 SDRAM Software: Linux (Ubuntu) U-Boot svn arm-linux-gcc (GCC) 4.2.2

72 IX. Development Schedule 72/74
개발일정 12월 1월 2월 3월 4월 5월 개발환경구축 Project 계획 정리 Project 개발 환경 구축 자료조사 Target Board 조사 Bootloader 조사 Flash Memory 조사 Odroid’s Device 목록 정리 설계 Snapshot Code 검증 및 분석 구현 Snapshot Image 구현 테스트 System Test

73 73/74 X. Milestone 마일스톤 개요 시작일 종료일 관련 논문 조사
Snapshot Boot 관련 논문 및 자료 조사 Target Board 조사 및 선정 Snapshot Boot를 적용할 Target Board를 조사 부트로더 자료 조사 U-Boot에 관련된 자료 조사 Flash Memory 조사 NAND, NOR 플래시 메모리 관련 자료 조사 Suspend-to-Disk 관련 자료 조 사 Linux Kernel의 Hibernation 구조 조사 Snapshot Image 생성 구현 부트로더 포팅 Bootloader 포팅 1차 결과물 점검 프로젝트 진행상황 점검 중간 발표 프로젝트 중간 발표 개발 완료 프로젝트 개발 완료 테스트 프로젝트 개발 테스트 최종 발표 프로젝트 최종 발표

74 XI. Reference 74/74 번호 종류 제목 출처 발행년도 저자 기타 1 논문 Improving Linux Startup Time Usi ng Software Resume (and other t echniques) Sony, Corp. 2006, 7 Hiroki Kamin aga 2 Hardker- nel Odroid Official Site 3 문서 Flash Memory Guide Kingston 2009 4 U-Boot


Download ppt "졸업 프로젝트 발표 1/74 Trinity Snapshot Boot 날 짜: 팀 명: Trinity"

Similar presentations


Ads by Google