2-Tizen_v2

Similar documents
AL-M200 Series

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

P4VM800_BIOS_CN.p65

Abstract arm linux tool-chain root NET-Start! 2

P4V88+_BIOS_CN.p65

ARM JTAG实时仿真器安装使用指南

ebook140-9

Windows 2000 Server for T100

Microsoft Word - 正文.doc

untitled

Bus Hound 5

EK-STM32F

epub83-1

Oracle 4

Cadence SPB 15.2 VOICE Cadence SPB 15.2 PC Cadence 3 (1) CD1 1of 2 (2) CD2 2of 2 (3) CD3 Concept HDL 1of 1

1

自由軟體教學平台

NEXT SDT2.51 C:\ARM251 SDT2.51 ARM SDT 2.51 ARM PROJECT MANAGER SDT 2

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

ebook140-8

Windows XP

Guide to Install SATA Hard Disks

ICD ICD ICD ICD ICD

如 果 此 設 備 對 無 線 電 或 電 視 接 收 造 成 有 害 干 擾 ( 此 干 擾 可 由 開 關 設 備 來 做 確 認 ), 用 戶 可 嘗 試 用 以 下 一 種 或 多 種 方 法 來 消 除 這 個 干 擾 : 重 新 調 整 與 確 定 接 收 天 線 方 向 增 大 此 設

SDP

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

目 录


典型自编教材

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

<4D F736F F D20C7B6C8EBCABD6C696E7578BBF9B4A1CAB5D1E92E646F63>

untitled

Microsoft Word - template.doc

1.ai

Chapter 2

On/Off/ FlexiClip HFC FlexiClip

1 CPU

K7VT2_QIG_v3


A9RF716.tmp

USB解决方案.ppt

Microsoft Word - PS2_linux_guide_cn.doc

IP505SM_manual_cn.doc

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

SA-DK2-U3Rユーザーズマニュアル

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

epub 61-2

A Preliminary Implementation of Linux Kernel Virus and Process Hiding

Microsoft Word - InoTouch Editor编程软件手册 doc

1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se

ebook 185-6

RAID RAID 0 RAID 1 RAID 5 RAID * ( -1)* ( /2)* No Yes Yes Yes A. B. BIOS SATA C. RAID BIOS RAID ( ) D. SATA RAID/AHCI ( ) SATA M.2 SSD ( )

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

ebook70-22

mvc

ARM Cortex-M3 (STM32F) STMicroelectronics ( ST) STM32F103 Core: ARM 32-bit Cortex -M3 CPU 72 MHz, 90 DMIPS with 1.25 DMIPS/MHz Single-cycle multiplica

UBOOT 的编译命令直接一次性编译 make O=am335x CROSS_COMPILE=arm-arago-linux-gnueabi ARCH=arm am335x_evm 配置 make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- am3

TX-NR3030_BAS_Cs_ indd

PCMCIA Compact Flash GPRS GPS PCMCIA Personal Computer Memory Card International Association CF Compact Flash PCMCIA CF PCMCIA/CF

untitled

Software Boot and PL Configuration

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

USPTO Academic research Corporate needs Global/International Inventors Libraries News Media/Publication Patent Attorney or Agent USPTO e (ebusiness Ce

05 01 X Window X Window Linux Linux X Window X Window Webmin Web Linux Linux X Window X Window Notebook PC X Window X Window module Linux Linux kernel

Microsoft Word - H6800BM_translation base_Update_1_2014_ doc

Red Flag Linux Desktop 4.0 Red Flag Linux Desktop 4.0 1

ebook71-13

Windows 2000 Server for T100

中文模板

ebook62-1

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

投影片 1

LSC操作说明

T2 Internal Engineer Prober basic Training Manual T2 Internal Engineer Prober basic training manual - 1 -

Dell Vostro 14–3459 用户手册

声 明 Copyright 2010 杭 州 华 三 通 信 技 术 有 限 公 司 及 其 许 可 者 版 权 所 有, 保 留 一 切 权 利 未 经 本 公 司 书 面 许 可, 任 何 单 位 和 个 人 不 得 擅 自 摘 抄 复 制 本 书 内 容 的 部 分 或 全 部, 并 不 得

錄...1 說...2 說 說...5 六 率 POST PAY PREPAY DEPOSIT 更

T1028_Manual_KO_V3 0.pdf

els0xu_zh_nf_v8.book Page Wednesday, June, 009 9:5 AM ELS-0/0C.8

Progress Report of BESIII Slow Control Software Development

Microsoft Word - 11.doc

P3B-F Pentium III/II/Celeron TM

Panaboard Overlayer help

1 MTK 2 MTK 3 MTK

CAUTION RISK OF ELECTRIC SHOCK DO NOT OPEN 2

<4D F736F F D20C7B6C8EBCABDCFB5CDB3C9E8BCC6CAA6BFBCCAD4B4F3B8D92E646F63>

IT (1) IDE... 2 (2) BIOS IDE RAID... 3 (3) RAID BIOS RAID... 5 (4) R A I D (5) ID E RA ID... 15

PowerPoint Presentation

Desktop Management Guide

Table of Contents Design Concept 03 Copyrights & TradeMark 04 Special Notice 05 Notice to concerned 05 Installation and Registration Introduction 07 s

RunPC2_.doc

HOL-CHG-1695

华恒家庭网关方案

Serial ATA ( Nvidia nforce430)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Microsoft Win

1 Windows Windows Vista Windows Server 2008 ImageX Windows Windows Deployment Services virtual machines Windows activation infrastructure o Win

1-1 SH79F6431 A. 2( ) 9~15V ( 12V) U2 U3 3.3V SH79F B. 1(VCC/GND) SH79F6431 C. VDDIO SH79F6431 P4 P5 P0.6 P0.7 VDDIO VDDIO=5V D. 2 V 1.0

untitled

资源管理软件TORQUE与作业调度软件Maui的安装、设置及使用

Transcription:

!1 42 Tizen v2.3 Bootup

内容!2 42 Bootloader(U-boot) Bootloader 概述 U-boot Systemd Systemd 概述 Platform Bootup Parsing Unit File

!3 42 Bootloader(U-boot)

Tizen bootup 概述!4 引导加载程序 将机器 id 和启动参数传递给内核 Power on ROM code Booting device Bootloader Kernel Platform

什么是引导加载程序 bootloader!5 引导加载程序是什么? 引导加载程序是当系统初始化时的第 一个执 行程序 ( 在主程序前, 例如内核 ) 引导加载程序是 一个计算机程序, 在 自检完成后加载主程序 ( 即操作系统内核 ) 为什么需要引导加载程序? 给出了 一个开发环境 节省了 flash 读写的成本 给加载任何操作系统提供灵活性

引导加载程序的类型!6 引导加载程序的不同类型是什么? Boot-ROM ( or Pre-Boot Loader) 小代码加载第 一阶段引导加载程序 First Stage Boot Loader 小段代码初始化 NAND/MMC & DRAM 控制器 Second Stage Boot Loader 第 二阶段的引导加载程序的主要功能是内核加载到 RAM 或直接跳跃到内核的开始 Pre-Bootloader First-Stage Bootloader Second-Stage Bootloader OS Kernel

U-boot 加载过程!7 Cortex-A9 Exynos4412 DRAM controller DRAM 1 Internal ROM irom code Internal SRAM essd controller NAND controller SD/MMC controller UART/USB Booting Device (NAND, MMC, SD, USB) 1 st BL 2 2 nd BL 3 OS

U-boot 加载过程!8 BL0; irom code (boot-rom or pre-boot loader) 简单的平台 无关的代码存储在内部 ROM 初始化基本功能 ( 时钟, 栈, 堆, 等等 ) 加载第 一阶段引导加载程序 ( 从启动设备内部存储器 ) BL1; first boot loader 简单的平台 无关的代码存储在外部存储器 ( 引导设备 ) 加载第 二引导加载程序 初始化 NAND/MMC & DRAM 控制器 BL2; second boot loader 平台依赖复杂的代码存储在外部存储器中 初始化时钟,UART 从引导装载操作系统映像 DRAM 的 手段 跳转到操作系统

U-boot 目录结构!9 /u-boot /u-boot api Machine/arch independent API examples Example code for standalone applications arch Architecture specific files fs Filesystem code jffs2, etc.) (cramfs, ext2, board Board dependent files include Header files common Misc architecture independent functions lib Files generic to all architectures disk Code for disk drive partition handling net Networking code doc Documentation post Power on self test drivers Commonly used device drivers rtc Real time clock drivers tools Tools to build S-Record or images U-boot

U-boot 编码顺序!10 1. 禁 用所有中断 2. 从 ROM 将所有初始化数据复制到 RAM 3. 清空未初始化的数据区域 4. 分配和初始化堆栈空间 5. 初始化处理器的堆栈指针 6. 创建并初始化堆 7. 执 行所有全局数据的初始化 8. 启 用中断 9. 调 用主循环

U-boot 编码顺序!11 Reset CPU and Hardware cpu/armv7/start.s _start() Setup SP Board Setup Environment for Early (ASM->C) Disable IRQ &FIQ. supervisor mode cpu/armv7/start.s reset() Switch to arm/lib/crt0.s _main() Early Board Setup General Relocation cpu/armv7/start.s relocate_code() Low Level Initialization arm/lib/crt0.s board_init_f() Copy Binary to RAM cpu_init_crit Invalidate and disable Instruction & data Cache Calculate Addresses (SP, Dest, GD) for Relocation Fix Relocation Clear BSS Disable MMU lowlevel_init board/samsung/lowlevel_init.s lowlevel_init() Setup SP for Common Board Setup Setup GD and JUMP to Final Board Setup arm/lib/crt0.s board_init_r() Jump into main loop

U-boot 编码顺序!12 _start() /* Entry point function */ reset() /* Reset CPU configurations */ save_boot_params() /* Save boot parameters */ Disable the FIQ & IRQ Switch to supervisor mode cpu_init_crit() Invalidate I, D Cache Disable I cache if CONFIG_SYS_ICACHE_OFF Disable MMU lowlevel_init() _main() /* setup initial stack & global data. And jump to C routine for board initialization */

U-boot 编码顺序!13 board_init_f() arch_cpu_init // basic arch cpu dependent setup board_early_init_f // early board initialization, UART pin setting timer_init // initialize timer env_init // initialize mmc/sdcard environment init_baudrate // initialize baudrate settings serial_init // serial communication setup console_init_f // stage 1 init of console, configure console from console.c display_banner // say that we are here, print u-boot banner print_cpuinfo // display cpu info checkboard // display board info init_func_i2c // initialize I2C dram_init // configure available RAM backs arm_pci_init

U-boot 编码顺序!14 board_init_r() board_init // setup chipselects specific configuration logbuff_init_ptrs // initialize default log level mem_malloc_init // configure malloc area nand_init mmc_init // initialize flash/mmc env_relocate // relocate environment or set NULL stdio_init // setup stdio ready for use api_init // initialize API console_init_r // fully init console as a device arch_misc_init // miscellaneous arch dependent initialization misc_init_r // miscellaneous platform dependent initialization interrupt_init // set up exceptions enable_interrupts // enable exceptions board_late_init // board late initialization eth_initialize // setup ethernet main_loop // jump to main loop & waiting for commands from console

U-boot 编码顺序!15 main_loop() Wait for 3 seconds Key pressed within 3 seconds Input command Command_mode() Autoboot_mode() boot() loads() tftpboot() flash() Jump to kernel image address

通过 U-boot 加载!16 Reset CPU SDRAM Kernel Root File-System Booting device Bootloader uboot Kernel Image Root File System Optional compressed Bootloader uboot

通过 U-boot 加载!17 打包 uimage When the kernel is complied, mkimage attaches image_header to kernel image 解包 uimage Magin number! CRC check! decompress! get board information! kernel booting #define IH_MAGIC 0x27051956 /* Image Magic Number */ #define IH_NMLEN 32 /* Image Name Length */ typedef struct image_header { uint32_t ih_magic; /* Image Header Magic Number */ uint32_t ih_hcrc; /* Image Header CRC Checksum */ uint32_t ih_time; /* Image Creation Timestamp */ uint32_t ih_size; /* Image Data Size */ uint32_t ih_load; /* Data Load Address */ uint32_t ih_ep; /* Entry Point Address */ uint32_t ih_dcrc; /* Image Data CRC Checksum */ uint8_t ih_os; /* Operating System */ uint8_t ih_arch; /* CPU architecture */ uint8_t ih_type; /* Image Type */ uint8_t ih_comp; /* Compression Type */ uint8_t ih_name[ih_nmlen]; /* Image Name */ } image_header_t;

start_kernel!18 Architecture dependent setup setup_arch() [/arch/arm/kernel/setup.c] Exception(or trap) initialization trap_init() [/arch/arm/kernel/trap.c] Interrupt initialization init_irq() [/arch/arm/kernel/irq.c] sotfirq_init() [/kernel/sotfirq.c] Scheduler initialization sched_init() [/kernel/sched.c] Timer initialization time_init() [/arch/xxx/kernel/time.c] Console initialization console_init() [/driver/char/tty_io.c] Module initialization init_module() [/kernel/module.c]

!19 start_kernel 内存和系统初始化, 缓存和缓冲初始化, 文件系统初始化 kmem_cache_init() [/mm/slab.c] mem_init() [/arch/a,r/mm/init.c] kmem_cache_size() [/mm/slab.c] fork_init() [/kernel/fork.c] proc_caches_init() [/kernel/fork.c] vfs_caches_init() [/fs/dcache.c] buffer_init() [/fs/buffer.c] page_cache_init() [/mm/filemap.c] signals_init() [/kernel/signal.c] proc_root_init() [/fs/proc/root.c] ipc_init() [/ipc/util.c] init process creation rest_init() [/init/main.c]

!20 systemd

什么是 systemd?!21 Sysvinit userspace launch (PID 1) 一次只有 一个进程运 行 直接启动系统, 然后 sleep 直到下 一次重新启动 Systemd Default init in Fedora 15 and later Leonard Poettering (2009) 改善软件框架来表达依赖性 允许在系统启动时同时或并 行处理更多的过程 减少计算开销

!22 什么是 systemd? Systemd in Tizen System and service manager for tizen systemd Ver. (download http://www.freedesktop.org/software/systemd/) Parallelizes service execution Socket and D-Bus activation for starting services and daemon on-demand starting of daemons Managing the service processes as a group using Linux cgroup Supporting automount points Snapshotting and restoring of services

systemd 体系结构!23

systemd 体系结构!24 systemd Utility 监测和控制 systemd 本 身和它的服务 systemctl 开发 人员可以查询或发送控制命令对 systemd 服务管理者 'systemd-journalctl' 用于查看 日志 文件 systemd target Tizen 启动过程分开在不同的离散步骤, 每个步骤使 用 target 单元同步点来分组单位 每个 目标的启动过程是 高度并 行, 具体 目标单位在这样的顺序下的到达具有不确定性 systemd daemon Tizen 平台系统和服务管理者 作为初始化系统 'systemd' daemonruns as user session with '--user' option 'systemd-journald' is a system service that collects and stores log data from the Kernel, from user processes via syslog or STDOUT/STDERR

systemd 体系结构!25 systemd core 管理所有单元如 service, socket, mount 等等, 储存所有的 日志数据. controlled by using systemd utility like 'systemctl' systemd library & Linux Kernel systemd requires to enable 'cgroup' and 'autofs' option in Kernel configuration It also depends on dbus and some libraries such as libnotify, libudev

平台启动 sysinit.target!26 早期启动脚本 Most of file system are mounted and systemd related daemons are launched Kernel sysinit.target basic.target bootmode.target multi-user.target graphical.target dev-hugepages.mount dev-mqueue.mount proc-sys-fs-binfmt_misc.automount sys-fs-fuse-connections.mount sys-kernel-config.mount sys-kernel-debug.mount sys-kernel-security.mount systemd-ask-password-console.path systemd-binfmt.service systemd-journald.service systemd-modules-load.service systemd-random-seed-load.service systemd-readahead-collect.service systemd-readahead-replay.service systemd-sysctl.service systemd-tmpfiles-setup.service swap.target -.mount local-fs.target boot.mount csa.mount fsck-root.service media.mount opt-usr.mount opt.mount remount-rootfs.service resize2fs-root.service systemd-remount-api-vfs.service var-run.mount socket.target dbus.socket systemd-initctl.socket systemd-journald.socket systemd-shutdownd.socket telnetd.socket udev-control.socket udev-kernel.socket

平台启动 basic.target!27 基础启动 All necessary initialization for general purpose daemons are completed Kernel sysinit.target basic.target bootmode.target multi-user.target graphical.target opt-var-kdb-db-libsqlfs.service opt-var-kdb-db-smack-labels.service smack-default-labeling.service systemd-tmpfiles-clean.timer tizen-debug-level.service udev-trigger.service udev.service vconf-setup.service

平台启动 bootmote.target!28 选择启动模式 If kernel boot parameter has charger_detect_boot, the platform boots up as charging mode Kernel sysinit.target basic.target bootmode.target multi-user.target graphical.target bootmode-charging.service bootmode-graphical.service

平台启动 multi-user.target!29 设置 一个 无图形 支持的多 用户系统 Launching platform infrastructure daemons (such as dbus, power manager, gps manager, telephony daemon, WRT security daemon, media server, systemd-related daemons) Kernel sysinit.target basic.target bootmode.target multi-user.target graphical.target alarm-server.service avsystem.service bluetooth-address.service bluetooth-frwk-service.service bluetooth.service dbus.service dlog-main.service dlog-radio.service getty.target gps-manager.service media-server.service nfc-manager.service power-manager.service pulseaudio.service secure-storage.service sensor-framework.service system-server.service systemd-ask-password-wall.path systemd-logind.service systemd-user-sessions.service telephony.service

平台启动 graphical.target!30 设置 一个图形环境 System user session for app privilege daemons such as Enlightenment (window manager) Special target for middleware & mobile service Kernel sysinit.target basic.target ac.service launchpad-reload@app.service user-session@app.service wrt_launchpad_daemon@app.service bootmode.target xorg.service xorg.target tizen-mobile-session.target wrt-preinstall-widgets.service multi-user.target graphical.target core-efl.target boot-animation.service cbhm.service e17.service indicator.service osp-app-service.service quickpanel.service scim.service starter.path xmodmap.service xrdb.service tizen-middleware.target calendar.service contacts-service.service download-provider.service email.service msg-service.service pushd.service sound-server.service

!31 Systemd 分析

平台启动!32 systemd 控制从 initramfs 移动到 Tizen 平台的 systemd Run hardware init and fs mount, etc services 启动流程运 行 几个单元 (.target) 不同的 目标可以并 行运 行 许多 linux 发 行版采 用systemd 作为默认 Red Hat Enterprise Linux, CentOS, Fedora, Arch Linux, opensuse 不要使 用守护进程控制脚本 t(/sbin/init, /etc/init.d/*, /etc/rc*.d) /usr/lib/systemd unit files: service, target, socket, device, mount, automount, path, snapshot, swap, timer systemd utilities: systemctl, notify, analyze, cgis, cgtop, logictl, journalctl, nspawn

平台启动!33 https://wiki.tizen.org/wiki/porting_guide entry point.target vs.service.target; service grouping.service; process run

解析单元 文件 示例 (1/8)!34 /usr/lib/systemd/system target to parse cat sysinit.target

解析单元 文件 示例 (2/8)!35 Website http://www.freedesktop.org/wiki/software/systemd/ systemd download http://www.freedesktop.org/software/systemd/ manpage

解析单元 文件 示例 (3/8)!36 Can search all function and unit, configuration of systemd enter target index

解析单元 文件 示例 (4/8)!37 target unit file

解析单元 文件 示例 (5/8)!38 Description on unit file option

解析单元 文件 示例 (6/8)!39

解析单元 文件 示例 (7/8)!40

解析单元 文件 示例 (8/8)!41 User awareness unit name = System Initialization If emergency is running, wait Run with local-fs.target, swap.target, sysinit.target.wants Run after local-fs.target, swap.target, emergency.service, emergency.target User can control service start and stop

不同的会话!42 [Unit], [Service], [Install], [Socket], [Swap], [Mount], example; telephony.service [Unit]; general options unit name = Telephony daemon Run after modem.service [Service]; process options Run telephony-daemon as main process [Install]; actual work of unit excute Create telephony.service symlink at multi-user.target.wants

References! systemd official Site http://www.freedesktop.org/wiki/software/ systemd/ systemd FAQ (written by developer) http://0pointer.de/blog/projects/the-biggest-myths