Microsoft Word - ARM Linux中断机制分析.doc

Size: px
Start display at page:

Download "Microsoft Word - ARM Linux中断机制分析.doc"

Transcription

1 作者 : 张俊岭 sprite_zjl@sina.com; jlzhang@tangrae.com.cn QQ: 日期 : 说明 : 本文档基于 AT91SAM9260EK 板 1 数据结构 中断机制的核心数据结构是 irq_desc, 它完整地描述了一条中断线 ( 或称为 中断通道 ) irq_desc 结构在 include/linux/irq.h 中定义 : typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc); struct irq_desc { irq_flow_handler_t handle_irq; /* 高层次的中断事件处理函数 */ struct irq_chip *chip; /* 低层次的硬件操作 */ struct msi_desc *msi_desc; /* MSI 描述符?? */ void *handler_data; /* chip 方法使用的数据 */ void *chip_data; /* chip 私有数据 */ struct irqaction *action; /* 行为链表 (action list) */ unsigned int status; /* 状态 */ unsigned int depth; /* 关中断次数 */ unsigned int wake_depth; /* 唤醒次数 */ unsigned int irq_count; /* 发生的中断次数 */ unsigned int irqs_unhandled; spinlock_t lock; /* 自旋锁 */ #ifdef CONFIG_SMP cpumask_t affinity; unsigned int cpu; #if defined(config_generic_pending_irq) defined(config_irqbalance) cpumask_t pending_mask; #ifdef CONFIG_PROC_FS struct proc_dir_entry *dir; /* 在 proc 文件系统中的目录 */ const char *name; /* 名称 */ cacheline_aligned; 在 kernel/irq/handle.c 中有个全局 irq_desc 数组, 描述了系统中所有的中断线 : 第 1 页共 15 页

2 struct irq_desc irq_desc[nr_irqs] cacheline_aligned = { [0... NR_IRQS-1] = {.status = IRQ_DISABLED,.chip = &no_irq_chip,.handle_irq = handle_bad_irq,.depth = 1,.lock = SPIN_LOCK_UNLOCKED(irq_desc->lock), #ifdef CONFIG_SMP.affinity = CPU_MASK_ALL ; 数组共有 NR_IRQS 个元素, 每个元素对应一条中断线 其中 NR_IRQS 是系统中的中断线的数量, 对于 AT91SAM9260EK 板, 这个值为 32 下面来看 irq_desc 结构中的重要数据成员 首先是 handle_irq, 这是个函数指针, 指向的是一个高层次的中断事件处理函数, 定义了处理中断事件的一种策略 在 kernel/irq/chip.c 中实现了 5 个函数 :handle_simple_irq(),handle_level_irq(), handle_edge_irq(),handle_fasteoi_irq() 以及 handle_percpu_irq() handle_irq 指针可以指向这 5 个函数中的一个, 选择一种中断事件处理策略, 这是通过函数 set_irq_handler() 完成的 接下来是 chip, 这是个 irq_chip 结构指针 irq_chip 结构定义了对中断线的底层硬件操作, 在 include/linux/irq.h 中 : struct irq_chip { const char *name; unsigned int (*startup)(unsigned int irq); void (*shutdown)(unsigned int irq); void (*enable)(unsigned int irq); void (*disable)(unsigned int irq); void (*ack)(unsigned int irq); /* 确认中断 */ void (*mask)(unsigned int irq); /* 屏蔽中断 */ void (*mask_ack)(unsigned int irq); /* 确认并屏蔽中断 */ void (*unmask)(unsigned int irq); /* 取消屏蔽中断 */ void (*eoi)(unsigned int irq); /* 中断结束 */ void (*end)(unsigned int irq); void (*set_affinity)(unsigned int irq, cpumask_t dest); /* 重新触发中断 */ 第 2 页共 15 页

3 int (*retrigger)(unsigned int irq); /* 设置中断触发类型 : 高电平 / 低电平 / 上升沿 / 下降沿 */ int (*set_type)(unsigned int irq, unsigned int flow_type); /* 唤醒中断 */ int (*set_wake)(unsigned int irq, unsigned int on); ; 这个数据结构很简单, 就是定义了一系列的函数指针, 表示对底层硬件的具体操作行为 最后的数据成员是 action, 这是个 irq_action 结构指针 irq_action 结构定义了安装在中断线上的一个中断处理程序, 在 include/linux/interrupt.h 中 : struct irqaction { irq_handler_t handler; /* 具体的中断处理程序 */ unsigned long flags; cpumask_t mask; const char *name; /* 名称, 会显示在 /proc/interreupts 中 */ void *dev_id; /* 设备 ID, 用于区分共享一条中断线的多个处理程序 */ struct irqaction *next; /* 指向下一个 irq_action 结构 */ int irq; /* 中断通道号 */ struct proc_dir_entry *dir; /* procfs 目录 */ ; 多个中断处理程序可以共享同一条中断线,irqaction 结构中的 next 成员用来把共享同一条中断线的所有中断处理程序组成一个单向链表,dev_id 成员用于区分各个中断处理程序 综合起来, 可以得出中断机制各个数据结构之间的联系, 如下图 : 第 3 页共 15 页

4 第 4 页共 15 页

5 2 初始化 中断机制的初始化通过 start_kernel() 中的两个函数完成 :trap_init() 和 init_irq() trap_init() 在 arch/arm/kernel/traps.c 中 : void init trap_init(void) { unsigned long vectors = CONFIG_VECTORS_BASE; extern char stubs_start[], stubs_end[]; extern char vectors_start[], vectors_end[]; extern char kuser_helper_start[], kuser_helper_end[]; int kuser_sz = kuser_helper_end - kuser_helper_start; /* 异常向量表拷贝到 0x0000_0000( 或 0xFFFF_0000), 异常处理程序的 stub 拷贝到 0x0000_0200( 或 0xFFFF_0200) */ memcpy((void *)vectors, vectors_start, vectors_end - vectors_start); memcpy((void *)vectors + 0x200, stubs_start, stubs_end - stubs_start); memcpy((void *)vectors + 0x kuser_sz, kuser_helper_start, kuser_sz); /* 拷贝信号处理函数 */ memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, sizeof(sigreturn_codes)); /* 刷新 Cache, 修改异常向量表占据的页面的访问权限 */ flush_icache_range(vectors, vectors + PAGE_SIZE); modify_domain(domain_user, DOMAIN_CLIENT); 这个函数把定义在 arch/arm/kernel/entry-armv.s 中的异常向量表和异常处理程序的 stub 进行重定位 : 异常向量表拷贝到 0xFFFF_0000, 异常向量处理程序的 stub 拷贝到 0xFFFF_0200 然后调用 modify_domain() 修改了异常向量表所占据的页面的访问权限, 这使得用户态无法访问该页, 只有核心态才可以访问 arm 处理器发生异常时总会跳转到 0xFFFF_0000( 设为 高端向量配置 时 ) 处的异常向量表, 因此进行这个重定位工作 至于异常向量表所使用的物理空间和虚拟空间, 则是在 setup_arch()->paging_init()->devicemaps_init() 中创建的 ( 参见 ARM Linux 的存储映射 ) init_irq() 在 arch/arm/kernel/irq.c 中 : void init init_irq(void) { int irq; 第 5 页共 15 页

6 /* 设置 irq_desc 数组的 status 为 IRQ_NOREQUEST IRQ_NOPROBE */ for (irq = 0; irq < NR_IRQS; irq++) irq_desc[irq].status = IRQ_NOREQUEST IRQ_NOPROBE; #ifdef CONFIG_SMP bad_irq_desc.affinity = CPU_MASK_ALL; bad_irq_desc.cpu = smp_processor_id(); /* 调用 machine_desc 中定义的机器相关的中断初始化函数 */ init_arch_irq(); 这个函数首先把 irq_desc 数组中的所有元素的 status 设为 IRQ_NOREQUEST IRQ_NOPROBE( 没有请求, 没有检测 ), 然后调用函数指针 init_arch_irq() 指向的函数 init_arch_irq 在 setup_arch() 中被赋值, 指向 machine_desc 中定义的 init_irq 函数 在 AT91SAM9260EK 平台上, 就指向了 arch/arm/mach-at91/board-sam9260ek.c 中定义的函数 ek_init_irq() 而 ek_init_irq() 又调用了 arch/arm/mach-at91/at91sam9260.c 中的 at91sam9260_init_interrupts() 函数 : void init at91sam9260_init_interrupts(unsigned int priority[nr_aic_irqs]) { if (!priority) priority = at91sam9260_default_irq_priority; /* Initialize the AIC interrupt controller */ at91_aic_init(priority); /* Enable GPIO interrupts */ at91_gpio_irq_setup(); 接下来又调用了 arch/arm/mach-at91/irq.c 中的 at91_aic_init() 进行 AIC 初始化, 调用 arch/arm/mach-at91/gpio.c 中的 at91_gpio_irq_setup() 进行 GPIO 的中断初始化 这里忽略 at91_gpio_irq-setup() 的分析, 只关注 at91_aic_init(): [arch/arm/mach-at91/irq.c] static struct irq_chip at91_aic_chip = {.name = "AIC",.ack = at91_aic_mask_irq,.mask = at91_aic_mask_irq,.unmask = at91_aic_unmask_irq,.set_type = at91_aic_set_type,.set_wake = at91_aic_set_wake, 第 6 页共 15 页

7 ; void init at91_aic_init(unsigned int priority[nr_aic_irqs]) { unsigned int i; /* * The IVR is used by macro get_irqnr_and_base to read and verify. * The irq number is NR_AIC_IRQS when a spurious interrupt has occurred. */ for (i = 0; i < NR_AIC_IRQS; i++) { /* Put irq number in Source Vector Register: */ at91_sys_write(at91_aic_svr(i), i); /* Active Low interrupt, with the specified priority */ at91_sys_write(at91_aic_smr(i), AT91_AIC_SRCTYPE_LOW priority[i]); set_irq_chip(i, &at91_aic_chip); set_irq_handler(i, handle_level_irq); set_irq_flags(i, IRQF_VALID IRQF_PROBE); /* Perform 8 End Of Interrupt Command to make sure AIC will not Lock out nirq */ if (i < 8) at91_sys_write(at91_aic_eoicr, 0); /* * Spurious Interrupt ID in Spurious Vector Register is NR_AIC_IRQS * When there is no current interrupt, the IRQ Vector Register reads the value stored in AIC_SPU */ at91_sys_write(at91_aic_spu, NR_AIC_IRQS); /* No debugging in AIC: Debug (Protect) Control Register */ at91_sys_write(at91_aic_dcr, 0); /* Disable and clear all interrupts initially */ at91_sys_write(at91_aic_idcr, 0xFFFFFFFF); at91_sys_write(at91_aic_iccr, 0xFFFFFFFF); 可以看到, 这个函数主要是写了 AIC 的一些寄存器, 还为每个中断线设置了 chip( 指向 at91_aic_chip) 和 handle_irq ( 指向 handle_level_irq ), 然后把中断线的状态修改为 IRQF_VALID IRQF_PROBE( 有效 & 已检测 ) at91_aic_chip 定义的底层操作函数也在 arch/arm/mach-at91/irq.c 中, 不再详述 至此, 中断机制的初始化工作已完成 第 7 页共 15 页

8 3 中断处理过程 (1) 汇编语言部分 当 ARM 处理器发生异常 ( 中断是一种异常 ) 时, 会跳转到异常向量表 ( 起始地址为 0xFFFF_0000 或 0x0000_0000) 如 3.2 节中所述, 在中断机制的初始化过程中, 把在 arch/arm/kernel/entry-armv.s 中的异常向量表及其处理程序的 stub 重定位到了 0xFFFF_0000 处, 这样才使得 ARM 处理器能够正常处理异常, 而且事实上执行的就是 entry-armv.s 中的异常处理程序 entry_armv.s 包含了所有的异常处理程序, 而且定义了一些宏操作, 比较复杂, 这里我们只关注与中断处理相关的部分 为便于理解, 把其中的某些宏展开, 再去掉和中断处理无关的部分, 整理后的代码如下 : 异常向量表 vectors_start: swi SYS_ERROR0 b vector_und + stubs_offset ldr pc,.lcvswi + stubs_offset b vector_pabt + stubs_offset b vector_dabt + stubs_offset b vector_addrexcptn + stubs_offset b vector_irq + 中断入口 :vector_irq b vector_fiq + stubs_offset.globl vectors_end: 中断处理程序的 stub 调整 LR_irq sub lr, lr, 保存 R0, LR_irq( 中断之前的 PC, 断点 ), SPSR_irq( 中断之前的 CPSR) 到 irq 模式的栈中 stmia sp, {r0, save r0, lr mrs lr, spsr str lr, [sp, save SPSR 设置为 SVC 模式 mrs r0, cpsr eor r0, r0, #(\mode ^ SVC_MODE) msr spsr_cxsf, r0 第 8 页共 15 页

9 @ lr 是中断刚开始时的 SPSR, 即被中断代码的 CPSR, 其低 4 位表示中断之前的模式 and lr, lr, #0x0f mov r0, sp ldr lr, [pc, lr, lsl 跳转到相应模式的处理程序, 模式变为 SVC(SPSR 拷贝到 CPSR ) movs pc, 跳转表, 必须紧跟 ldr lr,[pc,lr,lsl #2] 和 movs pc,lr 两条指令 (ARM 流水线机制 ).long 0 (USR).long 1 (FIQ).long 2 (IRQ).long 3 (SVC).long 4.long 5.long 6 (ABT).long 7.long 8.long 9.long a.long b (UND).long c.long d.long e.long f USR 模式中断入口 在内核栈中产生 include/asm-arm/ptrace.h 中 pt_regs 定义的栈帧结构 sub sp, sp, #S_FRAME_SIZE stmib sp, {r1 - r12 ldmia r0, {r1 - r3 add r0, sp, here for interlock avoidance mov r4, "" "" "" "" str r1, save the "real" r0 from the exception We are now ready to fill in the remaining blanks on the r2 - lr_<exception>, already fixed up for correct r3 - r4 - orig_r0 (see pt_regs definition in Also, separately save sp_usr and lr_usr 第 9 页共 15 页

10 stmia r0, {r2 - r4 stmdb r0, {sp, Clear FP to mark the first stack frame 把被中断任务的 preempt_count 增加 1 get_thread_info tsk #ifdef CONFIG_PREEMPT ldr r8, [tsk, get preempt count add r7, r8, increment it str r7, [tsk, 循环调用 asm-do_irq() 1: get_irqnr_and_base r0, r6, r5, lr movne r1, routine called with r0 = irq number, r1 = struct pt_regs * adrne lr, 1b bne asm_do_irq #ifdef CONFIG_PREEMPT ldr r0, [tsk, #TI_PREEMPT] str r8, [tsk, #TI_PREEMPT] teq r0, r7 strne r0, [r0, 返回到 user 模式 mov why, #0 b SVC 模式中断入口 在内核栈中产生 include/asm-arm/ptrace.h 中 pt_regs 定义的栈帧结构 sub sp, sp, #S_FRAME_SIZE tst sp, #4 bicne sp, sp, #4 stmib sp, {r1 - r12 ldmia r0, {r1 - r3 add r5, sp, here for interlock avoidance mov r4, "" "" "" "" add r0, sp, "" "" "" "" addne r0, r0, #4 第 10 页共 15 页

11 str r1, save the "real" r0 copied from the exception stack mov r1, We are now ready to fill in the remaining blanks on the r0 - r1 - r2 - lr_<exception>, already fixed up for correct r3 - r4 - orig_r0 (see pt_regs definition in ptrace.h) stmia r5, {r0 - 把被中断任务的 preempt_count 增加 1 #ifdef CONFIG_PREEMPT get_thread_info tsk ldr r8, [tsk, get preempt count add r7, r8, increment it str r7, [tsk, 循环调用 asm-do_irq() 1: get_irqnr_and_base r0, r6, r5, lr movne r1, routine called with r0 = irq number, r1 = struct pt_regs * adrne lr, 1b bne 如果需要调度, 调用 svc_preempt 进行内核抢占 #ifdef CONFIG_PREEMPT ldr r0, [tsk, get flags tst r0, #_TIF_NEED_RESCHED blne svc_preempt preempt_return: ldr r0, [tsk, read preempt value str r8, [tsk, restore preempt count teq r0, r7 strne r0, [r0, 返回到内核空间 ldr r0, [sp, irqs are already disabled msr spsr_cxsf, r0 ldmia sp, {r0 - load r0 - pc, cpsr 可以看到, 中断的入口点是 vector_irq 此时处理器处于 irq 模式,vector_irq 首先把 R0,LR ( 中断发生之前的 PC) 和 SPSR( 中断发生之前的 CPSR) 保存到 irq 模式的堆栈中, 然后 第 11 页共 15 页

12 根据进入中断之前的处理器模式跳转到不同的入口, 跳转后处理器的模式变成了 svc 如果中断前处于 usr 模式, 跳转到 irq_usr; 如果中断前处于 svc 模式, 则跳转到 irq_svc irq_usr 和 irq_svc 运行流程大致相同 : 都是先在 svc 模式栈 ( 也就是 linux 的内核栈 ) 中生成 /include/asm-arm/ptrace.h 中 struct pt_regs 定义的堆帧结构, 把被中断任务的 preempt_count 增加 1, 然后通过宏 get_irqnr_and_base 读取中断通道号和中断状态寄存器, 调用 adm_do_irq() 函数 只要读取的中断状态寄存器不是 0( 表示有中断发生 ), 就一直循环调用 asm_do_irq() 然后, 对于 usr 模式, 调用 ret_to_usr 返回用户空间 ; 对于 svc 模式, 如果当前进程需要调度, 内核又允许抢占, 则调用 svc_preempt 进行任务切换, 然后从堆栈弹出寄存器, 返回到内核模式 至此, 汇编语言阶段结束 struct pt_regs 定义的堆帧结构共包含 18 个寄存器, 从低地址到高地址依次是 :R0-R15,CPSR, R0_orig( 原先的 R0): [include/asm-arm/ptrace.h] struct pt_regs { long uregs[18]; ; #define ARM_cpsr uregs[16] #define ARM_pc uregs[15] #define ARM_lr uregs[14] #define ARM_sp uregs[13] #define ARM_ip uregs[12] #define ARM_fp uregs[11] #define ARM_r10 uregs[10] #define ARM_r9 uregs[9] #define ARM_r8 uregs[8] #define ARM_r7 uregs[7] #define ARM_r6 uregs[6] #define ARM_r5 uregs[5] #define ARM_r4 uregs[4] #define ARM_r3 uregs[3] #define ARM_r2 uregs[2] #define ARM_r1 uregs[1] #define ARM_r0 uregs[0] #define ARM_ORIG_r0 uregs[17] AT91SAM9260 的 get_irqnr_and_base 宏在 include/asm-arm/arch-at91/entry-macro.s 中定义 :.macro get_irqnr_and_base, irqnr, irqstat, base, tmp ldr \base, =(AT91_VA_BASE_SYS + AT91_AIC) ldr \irqnr, [\base, #(AT91_AIC_IVR - AT91_AIC)] ldr \irqstat, [\base, #(AT91_AIC_ISR - AT91_AIC)] teq \irqstat, #0 streq \tmp, [\base, #(AT91_AIC_EOICR - AT91_AIC)] 第 12 页共 15 页

13 .endm 这个宏通过读取 AIC 的相关寄存器, 来获得中断通道号和中断状态 中断通道号从 IVR 读取, 中断状态从 ISR 读取 只要 ISR 不为 0, 就调用 asm_do_irq(), 否则写一下 EOICR 后结束循环 (2) C 语言部分 前面提到, 汇编代码是通过调用 asm_do_irq() 函数进行中断处理的 这个函数的代码在 arch/arm/kernel/irq.c 中 : asmlinkage void asm_do_irq(unsigned int irq, struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); struct irq_desc *desc = irq_desc + irq; if (irq >= NR_IRQS) desc = &bad_irq_desc; /* 处理不正常的中断 */ irq_enter(); /* desc_handle_irq() 是个宏, 展开后为 : desc->handle_irq(irq,desc) */ desc_handle_irq(irq, desc); /* AT91 specific workaround */ irq_finish(irq); irq_exit(); set_irq_regs(old_regs); 这个函数的主体部分是调用指定中断线的 irq_desc 结构的 handle_irq 成员指向的函数, 可以是 handle_simple_irq(),handle_level_irq(), handle_edge_irq(),handle_fasteoi_irq() 以及 handle_percpu_irq() 中的任何一个, 这些函数都定义在 kernel/irq/chip.c 中, 都是通过调用 handle_irq_event() 函数实现中断处理的 handle_irq_event() 的代码在 kernel/irq/handle.c 中 : irqreturn_t handle_irq_event(unsigned int irq, struct irqaction *action) { irqreturn_t ret, retval = IRQ_NONE; unsigned int status = 0; handle_dynamic_tick(action); /* 如果没有指定 IRQF_DISABLED 标记, 开中断 */ if (!(action->flags & IRQF_DISABLED)) 第 13 页共 15 页

14 local_irq_enable_in_hardirq(); /* 依次调用 action 链表中的中断处理程序 */ do { ret = action->handler(irq, action->dev_id); if (ret == IRQ_HANDLED) status = action->flags; retval = ret; action = action->next; while (action); if (status & IRQF_SAMPLE_RANDOM) /* 随机数机制处理 */ add_interrupt_randomness(irq); local_irq_disable(); /* 关中断 */ return retval; 这个函数的实现很简单, 就是依次调用 action 链表的中断处理程序 至此, 中断处理的全过程结束 主要的函数调用流程如下图所示 : 第 14 页共 15 页

15 4 内核编程接口 kernel/irq/manage.c 和 kernel/irq/chip.c 中定义了一些内核编程经常使用的函数 这些函数都使用 EXPORT_SYMBOL 导出了, 可以在 MODULE 中使用 (1) request_irq() 原型 : int request_irq(unsigned int irq, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id) 功能 : 请求中断参数 :irq--- 中断通道号, 取值范围为 0~NR_IRQS 1 handler--- 中断处理程序, 原型为 irq_return_t isr_func(int irq, void *dev_id) irq_flags--- 标志位 dev_name--- 名称, 将会显示在 /proc/interrupts 中 dev_id--- 区分共享同一个中断通道的不同的处理程序 irq_flags 的取值及含义如下 : IRQF_SHARED: 和其它中断处理程序共享同一个中断通道,dev_id 必须不为 0, 且和其它中断处理程序不一致, 等同于以前的 SA_SHIRQ 标志 IRQF_DISABLED: 中断处理程序执行时需要关中断, 等同于以前的 SA_INTERRUPT 标志 IRQF_SAMPLE_RANDOM: 中断的发生时间可以用来产生随机数, 等同于以前的 SA_SAMPLE_RANDOM 标志 IRQF_TRIGGER_LOW: 指定中断触发类型 : 低电平有效 新增加的标志 IRQF_TRIGGER_HIGH: 指定中断触发类型 : 高电平有效 新增加的标志 IRQF_TRIGGER_RISING: 指定中断触发类型 : 上升沿有效 新增加的标志 IRQF_TRIGGER_FALLING: 指定中断触发类型 : 上升沿有效 新增加的标志 (2) free_irq() 原型 :void free_irq(unsigned int irq, void *dev_id) 功能 : 释放中断参数 :irq--- 中断通道号, 取值范围为 0~NR_IRQS 1 dev_id--- 区分共享同一个中断通道的不同的处理程序 (3) 其它 : int set_irq_chip(unsigned int irq, struct irq_chip *chip) : 设置 chip int set_irq_chip_data(unsigned int irq, void *data): 设置 chip_data int set_irq_handle(unsigned int irq, irq_flow_handler_t handle) : 设置 handle_irq int set_irq_data(unsigned int irq, void *data): 设置 handler_data int set_irq_type(unsigned int irq, unsigned int type): 设置指定通道的触发类型 第 15 页共 15 页

1 CPU interrupt INT trap CPU exception

1 CPU interrupt INT trap CPU exception 1 CPU interrupt INT trap CPU exception 2 X86 CPU gate 64 16 1 2 5 8 16 16 P DPL 00101 TSS 101 DPL P 1 64 16 1 2 1 1 3 3 5 16 16 16 P DPL 0 D 000 16 110 111 100 D 1=32 0=16 DPL P 1 INT DPL1>=CPL>=DPL CPU

More information

uc/os 1

uc/os 1 uc/os 1 uc/os-ii Source Code ANSI C, uc/os-ii 8/16/32 bits microprocessor Preemptive real-time Task 64 Stack Size ROMable (C compiler, assembler and linker/locator) uc/os-ii Mailboxes, Queues, Semaphores,

More information

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows

More information

<4D F736F F D20B5DAC8FDCBC4D5C2D7F7D2B5B4F0B0B82E646F63>

<4D F736F F D20B5DAC8FDCBC4D5C2D7F7D2B5B4F0B0B82E646F63> 第三章 Q3 1 1. 省略了 I/O 操作的复杂逻辑, 易实现, 耗费低 ; 2. 可以利用丰富的内存寻址模式实现灵活的 I/O 操作 Q3 2 假设存储单元 ds1 处寄存器地址为 0x2000, 代码如下 #define ds1 0x2000 while ( *ds1 == 0 ) ; Q3 3 假设设备 (dev1) 中有两个寄存器 ds1 和 dd1,dev1 的地址为 0x1000,ds1

More information

untitled

untitled 8086/8088 CIP /. 2004.8 ISBN 7-03-014239-X.... TP313 CIP 2004 086019 16 100717 http://www.sciencep.com * 2004 8 2004 8 1 5 500 787 1092 1/16 16 1/2 391 000 1 2 ii 1 2 CAI CAI 3 To the teacher To the student

More information

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,

More information

Outline 1 中断信号的作用和处理的一般原则 2 I/O 设备如何引起 CPU 中断 3 x86 CPU 如何在硬件级处理中断信号中断和异常的硬件处理 : 进入中断 / 异常中断和异常的硬件处理 : 从中断 / 异常返回 4 Linux 内核中软件级中断处理及其数据结构初始化中断描述符表低级异

Outline 1 中断信号的作用和处理的一般原则 2 I/O 设备如何引起 CPU 中断 3 x86 CPU 如何在硬件级处理中断信号中断和异常的硬件处理 : 进入中断 / 异常中断和异常的硬件处理 : 从中断 / 异常返回 4 Linux 内核中软件级中断处理及其数据结构初始化中断描述符表低级异 Linux 操作系统分析 Chapter 5 中断和异常 陈香兰 (xlanchen@ustceducn) 计算机应用教研室 @ 计算机学院嵌入式系统实验室 @ 苏州研究院中国科学技术大学 Fall 2014 October 21, 2014 陈香兰 (xlanchen@ustceducn) ( 计算机应用教研室 Linux 操作系统分析 @ 计算机学院嵌入式系统实验室 Chapter 5 中断和异常

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

06721 main() lock pick proc() restart() [2][4] MINIX minix2.0 GDT, IDT irq table[] CPU CPU CPU CPU (IDTR) idt[] CPU _hwint00:! Interrupt

06721 main() lock pick proc() restart() [2][4] MINIX minix2.0 GDT, IDT irq table[] CPU CPU CPU CPU (IDTR) idt[] CPU _hwint00:! Interrupt MINIX ( 730000) ( 730000) MINIX MINIX2.0 MINIX : MINIX TP3 1 MINIX UNIX Tanenbaum UNIX MINIX LINUX MINIX MINIX MINIX1.0 UNIX V7 MINIX2.0[3] POSIX MINIX3 MINIX Gabriel A. Wainer 1994-1995 [5] 1998 I/O 2002

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

学习MSP430单片机推荐参考书

学习MSP430单片机推荐参考书 MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP

More information

Linux内核的移植技术剖析

Linux内核的移植技术剖析 嵌入式培训专家 Linux 内核的移植技术剖析 主讲 : 宋宝华 www.farsight.com.cn 今天的内容 vbsp 的组成部分 vplat/mach 各组件的实现 内核节拍 中断管理 时钟 GPIO DMA IO 内存映射 v 设备与资源 platform device resource 和 plarform data uart/spi/i2c 等设备板级 resource vbsp 作用

More information

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc

More information

Kernel Kernel Kernel Kernel load estimator runqueue kernel/sched.

Kernel Kernel Kernel Kernel load estimator runqueue kernel/sched. Linux Kernel 2.6 20321131 Kernel 2.4...3 Kernel 2.4...3 Kernel 2.4...3 Kernel 2.6...3...3 1....3 2....4 3. load estimator...4 4....4 5....4...4 1....4 2. runqueue kernel/sched.c...4 3. task_struct(include/linux/sched.h)...6...9

More information

Andes Technology PPT Temp

Andes Technology PPT Temp 晶心科技線上技術研討會 AndesCore 便捷的全 C 嵌入式编程 晶心科技市場及技術服務部毛礼杰軟件經理 WWW.ANDESTECH.COM 大纲 系统初始化介绍 异常和中断说明 全 C 语法例子说明 总结 2 CPU 相关特性 1: 中断向量表 系统初始化 (1) 2: 系统寄存器 通常需要用 assembly( 汇编 / 组合 ) 语言来操作 AndesCore 全 C 嵌入式编程 C 扩展语法

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

目录

目录 ALTERA_CPLD... 3 11SY_03091... 3 12SY_03091...4....5 21 5 22...8 23..10 24..12 25..13..17 3 1EPM7128SLC.......17 3 2EPM7032SLC.......18 33HT46R47......19..20 41..20 42. 43..26..27 5151DEMO I/O...27 52A/D89C51...28

More information

ARM中C和汇编混合编程及示例.doc

ARM中C和汇编混合编程及示例.doc ARM 中 C 和汇编混合编程及示例 在嵌入式系统开发中, 目前使用的主要编程语言是 C 和汇编,C++ 已经有相应的编译器, 但是现在使用还是比较少的 在稍大规模的嵌入式软件中, 例如含有 OS, 大部分的代码都是用 C 编写的, 主要是因为 C 语言的结构比较好, 便于人的理解, 而且有大量的支持库 尽管如此, 很多地方还是要用到汇编语言, 例如开机时硬件系统的初始化, 包括 CPU 状态的设定,

More information

华恒家庭网关方案

华恒家庭网关方案 LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU

More information

Microsoft Word - MSP430 Launchpad 指导书.docx

Microsoft Word - MSP430 Launchpad 指导书.docx Contents 3... 9... 14 MSP430 LAUNCHPAD 指导书 3 第一部分第一个工程 New Project File > New > CCS Project Project name: ButtonLED Device>Family: MSP430 Variant: MSP430G2553 Project templates and examples : Empty Project

More information

第6章 信号量,中断和时间

第6章  信号量,中断和时间 6 6 Signal IPC POSIX Unix IPC Ctrl+C 9 IPC Linux Interrupt 5 Linux Linux CPU Linux Linux include/asm-i386/spinlock.h 12582 #ifdef UP SMP UP SMP 10 SMP Linux Nonrealtime SIGSEGVSIGHUP - - 52 6 SIGKILL realtime

More information

1

1 1 2 3 4 5 GNUDebugger 6 7 void main(int argc, char **argv){ vulncpy(argv[1]); return; } void vulncpy(char *a){ char buf[30]; strcpy(buf, a); return; } *argv[1] buf Shellcode *argv[1]... &buf &buf 8 strcpy

More information

目 录

目 录 1 Quick51...1 1.1 SmartSOPC Quick51...1 1.2 Quick51...1 1.3 Quick51...2 2 Keil C51 Quick51...4 2.1 Keil C51...4 2.2 Keil C51...4 2.3 1 Keil C51...4 2.4 Flash Magic...9 2.5 ISP...9 2.6...10 2.7 Keil C51...12

More information

Microsoft Word - Index.doc

Microsoft Word - Index.doc Programmer: B95902048 B95902085 WaveData #include ham // gfx2gba -fsrc -m -pb.pal -t8 water.bmp bg1.bmp bg2.bmp gameover.bmp water_atked.bmp #include "gfx/bg.pal.c" #include "gfx/bg.raw.c"

More information

S3C6410 ARM11开发板Linux BSP构建

S3C6410 ARM11开发板Linux BSP构建 嵌入式培训专家 S3C6410 ARM11 开发板 Linux BSP 构建 主讲 : 宋宝华 www.farsight.com.cn 今天的内容 vbsp 的组成部分 vplat/mach 各组件的实现 内核节拍 中断管理 时钟 GPIO DMA IO 内存映射 v 设备与资源 platform device resource 和 plarform data uart/spi/i2c 等设备板级

More information

untitled

untitled 1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175

More information

untitled

untitled MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

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

ARM JTAG实时仿真器安装使用指南 ARM JTAG Version 1.31 2003. 11. 12 ARM JTAG ARM JTAG.3 ARM 2.1.4 2.2.4 ARM JTAG 3.1 18 3.2 18 3.2.1 Multi-ICE Server.18 3.2.2 ADS..21 ARM JTAG 4.1 Multi-ICE Server 33 4.1.1 Multi-ICE Server..... 33 4.1.2

More information

九江职业大学2015届毕业生就业质量年度报告

九江职业大学2015届毕业生就业质量年度报告 2015 届 毕 业 生 就 业 质 量 年 度 报 告 - 0 - 二 一 五 年 十 二 月 九 江 职 业 大 学 2015 届 毕 业 生 就 业 质 量 年 度 报 告 前 言 九 江 职 业 大 学 是 1985 年 经 教 育 部 批 准 的 公 办 全 日 制 市 属 高 等 职 业 院 校 2006 年 4 月, 经 九 江 市 委 市 政 府 研 究 决 定 并 经 省 人 民

More information

Microsoft Word - 正文.doc

Microsoft Word - 正文.doc 1 2 1 2 3 4 5 6 7 8 9 10 3 1 150 2 150 1 1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.4 1.4.1 CPU 1.4.2 I/O 1.4.3 I/O 1.5 1.5.1 CISC RISC 1.5.2 1.5.3 1.6 1.6.1 1.6.2 N 1.6.3 2 2.1 2.1.1 2.1.2 2.1.3

More information

C/C++ - 函数

C/C++ - 函数 C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

第11章 可调内核参数

第11章 可调内核参数 11 11 Unix BSD 4.4 Linux sysctl Unix Linux /proc window /proc /proc/sys /proc/sys sysctl Unix root /proc/sys/vm root /proc/sys sysctl /proc/sys struct ctl_table 18274 struct ctl_tables /proc/sys struct

More information

C语言的应用.PDF

C语言的应用.PDF AVR C 9 1 AVR C IAR C, *.HEX, C,,! C, > 9.1 AVR C MCU,, AVR?! IAR AVR / IAR 32 ALU 1KBytes - 8MBytes (SPM ) 16 MBytes C C *var1, *var2; *var1++ = *--var2; AVR C 9 2 LD R16,-X ST Z+,R16 Auto (local

More information

Bus Hound 5

Bus Hound 5 Bus Hound 5.0 ( 1.0) 21IC 2007 7 BusHound perisoft PC hound Bus Hound 6.0 5.0 5.0 Bus Hound, IDE SCSI USB 1394 DVD Windows9X,WindowsMe,NT4.0,2000,2003,XP XP IRP Html ZIP SCSI sense USB Bus Hound 1 Bus

More information

C/C++程序设计 - 字符串与格式化输入/输出

C/C++程序设计 - 字符串与格式化输入/输出 C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int

More information

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

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor 1 4.1.1.1 (Load) 14 1.1 1 4.1.1.2 (Save) 14 1.1.1 1 4.1.2 (Buffer) 16 1.1.2 1 4.1.3 (Device) 16 1.1.3 1 4.1.3.1 (Select Device) 16 2 4.1.3.2 (Device Info) 16 2.1 2 4.1.3.3 (Adapter) 17 2.1.1 CD-ROM 2 4.1.4

More information

P4V88+_BIOS_CN.p65

P4V88+_BIOS_CN.p65 1 Main H/W Monitor Boot Security Exit System Overview System Time System Date [ 17:00:09] [Wed 12/22/2004] BIOS Version : P4V88+ BIOS P1.00 Processor Type : Intel (R) Pentium (R) 4 CPU 2.40 GHz Processor

More information

ebook14-4

ebook14-4 4 TINY LL(1) First F o l l o w t o p - d o w n 3 3. 3 backtracking parser predictive parser recursive-descent parsing L L ( 1 ) LL(1) parsing L L ( 1 ) L L ( 1 ) 1 L 2 L 1 L L ( k ) k L L ( 1 ) F i r s

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

More information

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit 6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128

More information

51 C 51 isp 10 C PCB C C C C KEIL

51 C 51 isp 10   C   PCB C C C C KEIL http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

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

PCMCIA Compact Flash GPRS GPS PCMCIA Personal Computer Memory Card International Association CF Compact Flash PCMCIA CF PCMCIA/CF 09 PCMCIA Compact Flash GPRS GPS PCMCIA Personal Computer Memory Card International Association CF Compact Flash PCMCIA CF PCMCIA/CF PCMCIA WiFi Linux PCMCIA PCMCIA/CF 9-1 PCMCIA/CF PCMCIA 16 CF PCMCIA

More information

HCS08微控制器上有关内存分配的几个问题.doc

HCS08微控制器上有关内存分配的几个问题.doc HCS08 shylion@gmail.com HCS08 Tiny Small shylion@gmail.com HCS08...- 1-1.1. HCS08...- 2-1.1...- 2-1.2 RAM...- 5-1.3 FLASH...- 5-1.4 Vectors...- 6-1.2....- 7-1.3. HCS08 Tiny Small...- 9-1.4. heap segment...12

More information

新・解きながら学ぶC言語

新・解きながら学ぶC言語 330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180

More information

中文模板

中文模板 ISSN 1000-9825, CODEN RUXUEW E-mail: jos@iscasaccn Journal of Software, Vol18, No7, July 2007, pp1806 1817 http://wwwjosorgcn DOI: 101360/jos181806 Tel/Fax: +86-10-62562563 2007 by Journal of Software

More information

P4i45GL_GV-R50-CN.p65

P4i45GL_GV-R50-CN.p65 1 Main Advanced Security Power Boot Exit System Date System Time Floppy Drives IDE Devices BIOS Version Processor Type Processor Speed Cache Size Microcode Update Total Memory DDR1 DDR2 Dec 18 2003 Thu

More information

DVK530/531扩展板

DVK530/531扩展板 DVK720 扩展板 驱动移植手册 2014.04.03 V1.0 版权声明 本手册所有权由深圳市微雪电子有限公司独家持有 未经本公司的书 面许可, 不得以任何方式或形式进行修改 分发或复制本文档的任何 部分, 否则一切后果由违者自负 版本更新记录 版本日期说明 V1.0 2014.04.03 初始发布 深圳市微雪电子有限公司 www.waveshare.net I 目录 版权声明... I 版本更新记录...

More information

第4章 系统设置

第4章  系统设置 POST 4.1 POST BIOS POST POST POST POST LOGO LOGO POST BIOS POST POST SCSI SCSI BIOS RAID POST RAID RAID RAID BIOS Operating System not Found BIOS T200 2002 BIOS 4.2 BIOS BIOS

More information

ARM s3c2410 中断问题的解决

ARM s3c2410 中断问题的解决 ARM s3c2410 中 断 问 题 的 解 决 popsonic@126.com QQ:52179095 sonyer 赵 海 涛 一 状 况 7 月 的 某 一 天, 一 时 兴 起 觉 得 ARM 9 应 该 比 较 好 玩 于 是 跑 到 淘 宝 上 去 逛 逛, 搜 了 半 天 发 现 开 发 板 基 本 上 是 44B0 和 2410 2 种 难 道 三 星 的 东 西 最 便 宜?

More information

Microsoft Word - MAN2011A_CH_RTT.doc

Microsoft Word - MAN2011A_CH_RTT.doc 基于 SAM7X EK 和 IAR EWARM 文档编号 文档版本 Rev. A 文档摘要 基于 AT91SAM7X EK 开发板的代码解读,RTT 代码解读 关键词 AT91SAM7X256 SAM7X EK IAR EWARM J LINK RTT 创建日期 2010 06 08 创建人员 Cust126 审核人员 Robin 文档类型 公开发布 / 开发板配套文件 版权信息 Mcuzone 原创文档,

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

新版 明解C言語入門編

新版 明解C言語入門編 328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

幻灯片 1

幻灯片 1 操作系统课程实验 Lab1:bootloader 启动 ucore os 大纲 x86 启动顺序 C 函数调用 gcc 内联汇编 (inline assembly) x86-32 下的中断处理 理解 x86-32 平台的启动过程理解 x86-32 的实模式 保护模式理解段机制 x86 启动顺序 x86 启动顺序 寄存器初始值 摘自 "IA-32 Intel 体系结构软件开发者手册 " x86 启动顺序

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

More information

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1 C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,

More information

untitled

untitled 2006 6 Geoframe Geoframe 4.0.3 Geoframe 1.2 1 Project Manager Project Management Create a new project Create a new project ( ) OK storage setting OK (Create charisma project extension) NO OK 2 Edit project

More information

C/C++ - 字符串与字符串函数

C/C++ - 字符串与字符串函数 C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed

More information

1.ai

1.ai HDMI camera ARTRAY CO,. LTD Introduction Thank you for purchasing the ARTCAM HDMI camera series. This manual shows the direction how to use the viewer software. Please refer other instructions or contact

More information

ebook

ebook 3 3 3.1 3.1.1 ( ) 90 3 1966 B e r n s t e i n P ( i ) R ( i ) W ( i P ( i P ( j ) 1) R( i) W( j)=φ 2) W( i) R( j)=φ 3) W( i) W( j)=φ 3.1.2 ( p r o c e s s ) 91 Wi n d o w s Process Control Bl o c k P C

More information

775i65PE_BIOS_CN.p65

775i65PE_BIOS_CN.p65 1 Main H/W Monitor Boot Security Exit System Overview System Time System Date [ 14:00:09] [Wed 10/20/2004] BIOS Version : 775i65PE BIOS P1.00 Processor Type : Intel (R) CPU 3.20 GHz Processor Speed : 3200

More information

P4VM800_BIOS_CN.p65

P4VM800_BIOS_CN.p65 1 Main H/W Monitor Boot Security Exit System Overview System Time System Date [ 17:00:09] [Fri 02/25/2005] BIOS Version : P4VM800 BIOS P1.00 Processor Type : Intel (R) Pentium (R) 4 CPU 2.40 GHz Processor

More information

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

els0xu_zh_nf_v8.book Page Wednesday, June, 009 9:5 AM ELS-0/0C.8 els0xu_zh_nf_v8.book Page Wednesday, June, 009 9:5 AM ELS-0/0C.8 Yamaha ELS-0/0C..8 LCD ELS-0/0C v. typeu LCD ELS-0/0C typeu / -6 / [SEARCH] / - ZH ELS-0/0C.8 els0xu_zh_nf_v8.book Page Wednesday, June,

More information

JLX

JLX PRODUCT:LCD MODULE. Model No.: JLX177-006 Product Type: 1.77 inch QVGA TFT Modoule. 产品规格书 晶联讯研发研发部 : Written By Checked By Approved By 客户名称 : 结构电子核准 地址 : 深圳市宝安区西乡宝安大道东华工业区 A3 栋 6 楼电话 :0755-29784961 Http://www.jlxlcd.cn

More information

K7VT2_QIG_v3

K7VT2_QIG_v3 ............ 1 2 3 4 5 [R] : Enter Raid setup utility 6 Press[A]keytocreateRAID RAID Type: JBOD RAID 0 RAID 1: 2 7 RAID 0 Auto Create Manual Create: 2 RAID 0 Block Size: 16K 32K

More information

ESP-Jumpstart

ESP-Jumpstart 2016-2019 2019 08 08 Contents 1 3 1.1 ESP32.............................. 3 1.2.................................................. 5 2 7 2.1............................................. 7 2.2 ESP-IDF............................................

More information

Microsoft Word - freeRTOS移椊.docx

Microsoft Word - freeRTOS移椊.docx FREERTOS 在 STM32 的移植 V 1.0 FreeRTOS 作为开源的轻量级实时性操作系统, 不仅实现了基本的实时调度 信号量 队列和存储管理, 而且在商业应用上不需要授权费 FreeRTOS 的实现主要由 list.c queue.c croutine.c 和 tasks.c 4 个文件组成 list.c 是一个链表的实现, 主要供给内核调度器使用 ;queue.c 是一个队列的实现,

More information

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP:  ******************* * 关于 Java 测试试题 ****** ******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);

More information

bingdian001.com

bingdian001.com TSM12M TSM12 STM8L152C6, STM8L152R8 MSP430F5325 whym1987@126.com! /******************************************************************************* * : TSM12.c * : * : 2013/10/21 * : TSM12, STM8L f(sysclk)

More information

WinMDI 28

WinMDI 28 WinMDI WinMDI 2 Region Gate Marker Quadrant Excel FACScan IBM-PC MO WinMDI WinMDI IBM-PC Dr. Joseph Trotter the Scripps Research Institute WinMDI HP PC WinMDI WinMDI PC MS WORD, PowerPoint, Excel, LOTUS

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

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

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666

More information

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

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

Microsoft PowerPoint - C15_LECTURE_NOTE_11

Microsoft PowerPoint - C15_LECTURE_NOTE_11 INTERRUPT INTERFACE OF THE 8088 AND 8086 MICROPROCESSOR INTERRUPT INTERFACE OF THE 8088 AND 8086 MICROPROCESSOR 11.1 Interrupt Mechanism, Types and Priority 11.2 Interrupt Vector Table 11.3 Interrupt Instructions

More information

Ác Åé å Serial ATA ( nvidia nforce4 SLI) 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)

Ác Åé å Serial ATA ( nvidia nforce4 SLI) 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) Serial ATA ( nvidia nforce4 SLI)...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... 11 (6) Microsoft Windows 2000... 14 Ác Åé å Serial ATA ( nvidia nforce4

More information

超级好的移值过程介绍: μC/GUI在MSGl9264液晶上的移植

超级好的移值过程介绍: μC/GUI在MSGl9264液晶上的移植 : C GUI MSGl9264 C GUI MSGl9264 µc GUI Micrium µc OS µc GUI * [1] µc GUI Windows µc GUI VC Windows µc GUI µc GUI µc GUI µc GUI MSGl9264 µc GUI 1 µc GUI MSP430F149 MSP430F149 16 (RISC 125ns ) ( ADC ) 2KB

More information

教育部顧問式嵌入式軟體聯盟

教育部顧問式嵌入式軟體聯盟 Lab 8 Interrupts 實驗目的 利用 Linux 來建立 Embedded system 已經是非常常見的應用 在不同的系統應用上會需要支援不同的硬體如 LCD Key Pad 等, 使用 polling 的方法, 會浪費許多 CPU 時間, 因為外部設備, 通常比 CPU 速度慢很多, 系統通常採用 interrupt 的方式來支援硬體 當硬體中斷發生時,CPU 停止正在執行的指令,

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

<4D6963726F736F667420576F7264202D20C7B6C8EBCABDCFB5CDB3C9E8BCC6CAA6B0B8C0FDB5BCD1A75FD1F9D5C22E646F63>

<4D6963726F736F667420576F7264202D20C7B6C8EBCABDCFB5CDB3C9E8BCC6CAA6B0B8C0FDB5BCD1A75FD1F9D5C22E646F63> 因 为 路 过 你 的 路, 因 为 苦 过 你 的 苦, 所 以 快 乐 着 你 的 快 乐, 追 逐 着 你 的 追 逐 内 容 简 介 本 书 根 据 2005 年 下 半 年 实 施 的 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 嵌 入 式 系 统 设 计 师 级 考 试 大 纲 精 神, 在 深 入 研 究 历 年 计 算 机 技 术 与 软

More information

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

More information

ICD ICD ICD ICD ICD

ICD ICD ICD ICD ICD MPLAB ICD2 MPLAB ICD2 PIC MPLAB-IDE V6.0 ICD2 usb PC RS232 MPLAB IDE PC PC 2.0 5.5V LED EEDATA MPLAB ICD2 Microchip MPLAB-IDE v6.0 Windows 95/98 Windows NT Windows 2000 www.elc-mcu.com 1 ICD2...4 1.1 ICD2...4

More information

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer

More information

ebook50-15

ebook50-15 15 82 C / C + + Developer Studio M F C C C + + 83 C / C + + M F C D L L D L L 84 M F C MFC DLL M F C 85 MFC DLL 15.1 82 C/C++ C C + + D L L M F C M F C 84 Developer Studio S t u d i o 292 C _ c p l u s

More information

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10

Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10 Serial ATA ( Silicon Image SiI3114)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 5 (4) S A T A... 8 (5) S A T A... 10 Ác Åé å Serial ATA ( Silicon Image SiI3114) S A T A (1) SATA (2)

More information

入學考試網上報名指南

入學考試網上報名指南 入 學 考 試 網 上 報 名 指 南 On-line Application Guide for Admission Examination 16/01/2015 University of Macau Table of Contents Table of Contents... 1 A. 新 申 請 網 上 登 記 帳 戶 /Register for New Account... 2 B. 填

More information

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

ebook39-6

ebook39-6 6 first-in-first-out, FIFO L i n e a r L i s t 3-1 C h a i n 3-8 5. 5. 3 F I F O L I F O 5. 5. 6 5. 5. 6.1 [ ] q u e n e ( r e a r ) ( f r o n t 6-1a A 6-1b 6-1b D C D 6-1c a) b) c) 6-1 F I F O L I F ADT

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

Chapter 1 What is Programing Paradigm 1

Chapter 1 What is Programing Paradigm 1 An Introduction to Programing Paradigm Chase Zhang May 8, 2013 Chapter 1 What is Programing Paradigm 1 CHAPTER 1. WHAT IS PROGRAMING PARADIGM 2 Definition from Wikipedia 1. Object-oriented programming/

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def Kaise s 2410 Board setting [1]. Device Driver Device Driver Linux s Kernel ARM s kernel s3c2410_kernel2.4.18_r1.1_change.tar.bz2 /usr/src (1) #cd /usr/src (2) #tar xfj s3c2410_kernel2.4.18_r1.1_change.tar.bz2

More information

EK-STM32F

EK-STM32F STMEVKIT-STM32F10xx8 软 件 开 发 入 门 指 南 目 录 1 EWARM 安 装... 1 1.1 第 一 步 : 在 线 注 册... 1 1.2 第 二 步 : 下 载 软 件... 2 1.3 第 三 步 : 安 装 EWARM... 3 2 基 于 STMEVKIT-STM32F10xx8 的 示 例 代 码 运 行... 6 2.1 GPIO Demo... 6 2.2

More information

正式发文

正式发文 甘 肃 省 国 家 税 务 局 2015 年 政 府 信 息 公 开 工 作 年 度 报 告 本 年 度 报 告 根 据 中 华 人 民 共 和 国 政 府 信 息 公 开 条 例 要 求, 由 甘 肃 省 国 家 税 务 局 编 制 全 文 包 括 基 本 情 况 主 动 公 开 政 府 信 息 情 况 依 申 请 公 开 政 府 信 息 情 况 政 府 信 息 公 开 咨 询 处 理 情 况 政

More information