arch

linux 中断管理(一)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 07:12:20
一、中断作用 Linux 内核需要对连接到计算机上的所有硬件设备进行管理。如果要管理这些设备,首先得和它们互相通信才行。 一般有两种方案可实现这种功能: 轮询(polling) 让内核定期对设备的状态进行查询,然后做出相应的处理; 中断(interrupt) 让硬件在需要的时候向内核发出信号(变内核主动为硬件主动)。 使用轮询的方式会占用CPU比较多的时间,效率极低。例如:要读取一个按键有没有被按下时,一个进程需要不断地查询按键有没有被按下。这样这个任务就占用CPU大量得时间,使得CPU做了大量的无用功。使用中断提供这样的一个机制。当按键没有被按下的时候,挂起当前进程,将控制权转交给其他进程。当按键按下的时候,操作系统把当前进程设为活动的,从而允许该进程继续执行。 二、linux中断管理 linux 内核将所有的中断统一编号,使用一个 irq_desc 结构体数组描述中断。一个数组项对用一个中断(或者是一组中断,它们共用中断号)。 struct irq_desc 结构体记录了,中断的名称、中断状态,底层硬件访问接口(使能中断,屏蔽中断,清除中断),中断处理函数的入口, 通过它可以调用用户注册的中断处理函数。 1、struct irq_desc struct irq_desc 在 include\linux\irq.h 文件里面定义 struct irq_desc { irq

执行buildman --fetch-arch arm提示\"urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>\"如何处理?

一曲冷凌霜 提交于 2019-12-03 23:26:59
答: 在uboot源码的tools/buildman/toolchain.py中取消证书验证,修改内容如下: diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index a65737fdf8..94877f1047 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -8,6 +8,7 @@ from HTMLParser import HTMLParser import os import sys import tempfile +import ssl import urllib2 import bsettings @@ -566,6 +567,7 @@ class Toolchains: # Fist get the URL for this architecture col = terminal.Color() print col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch) + ssl._create_default_https_context = ssl._create_unverified

(四)Kubernetes 资源清单定义

本秂侑毒 提交于 2019-12-03 13:37:11
Kubernetes常用资源对象 依据资源的主要功能作为分类标准, Kubernetes 的 API 对象大体可分为五个类别,如下: 类型 名称 工作负载(Workload) Pod、ReplicaSet、Deployment、StatefulSet、DaemonSet、Job、Cronjob 负载均衡(Discovery &LB) Service、Ingress 配置和存储(Config&Storage) Volume、CSI、ConfigMap、Secret、DownwardAPI 集群(Cluster) Namespace、Node、Role、ClusterRole、RoleBinding、ClusterRoleBinding 元数据(metadata) HPA、PodTemplate、LimitRange 对象资源格式 Kubernetes API 仅接受及响应 JSON 格式的数据( JSON 对象),同时,为了便于使用,它也允许用户提供 YAML 格式的 POST 对象,但 API Server 需要实现自行将其转换为 JSON 格式后方能提交。 API Server 接受和返回的所有 JSON 对象都遵循同一个模式,它们都具有 kind 和 apiVersion 字段,用于标识对象所属的资源类型、 API 群组及相关的版本。 大多数的对象或列表类型的资源提供元数据信息

关于lm-sensors中i8k.c的研究

六月ゝ 毕业季﹏ 提交于 2019-12-03 10:29:11
由于使用Dell Vostro,在Arch下看不到风扇的转速(当然更没法控制风扇)。 看了一下,发现是i8k的问题,于是拿来代码研究一下(虽然我是小白…… i8 k的代码 在: http://khali.linux-fr.org/devel/lm-sensors/drivers/i8k/ 包括一个Makefile和一个i8k.c。 $make $sudo insmod i8k.ko 当然之后肯定是不能用的(要不然我也不折腾了*_* $dmesg | grep i8k [ 3527.390324] i8k: unable to get SMM BIOS version 原因是没法获取SMM的BIOS版本信息。下面打开i8k.c文件 首先找module_init和module_exit,在最下面 module_init(i8k_init); module_exit(i8k_exit); 然后按照只是看init和exit函数(其实主要是看init) static int __init i8k_init(void) { struct proc_dir_entry *proc_i8k; int err; /* Are we running on an supported laptop? */ if (i8k_probe()) return -ENODEV; /* Register the

arch/x86/include/asm/unistd.h vs. include/asm-generic/unistd.h

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What's the difference between these two files? I can't really get it. I should mention that the first file should be arch/x86/include/asm/unistd_32.h (or and _64.h ). Here is a quick preview of what they contain: arch/x86/include/asm/unistd.h : #ifndef _ASM_X86_UNISTD_32_H #define _ASM_X86_UNISTD_32_H /* * This file contains the system call numbers. */ #define __NR_restart_syscall 0 #define __NR_exit 1 #define __NR_fork 2 #define __NR_read 3 #define __NR_write 4 #define __NR_open 5 #define __NR_close 6 #define __NR_waitpid 7 #define __NR

No OpenGL 3 headers in Arch Linux

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’m trying to compile a very simple “Hello world” OpenGL 3.3 program using FreeGLUT. In all the tutorials I found, they include an header “gl3.h”. The problem is, I don’t have such header file. $ ls -l /usr/include/GL/ total 2164 -rw-r--r-- 1 root root 8797 20 janv. 17:44 freeglut_ext.h -rw-r--r-- 1 root root 681 20 janv. 17:44 freeglut.h -rw-r--r-- 1 root root 26181 20 janv. 17:44 freeglut_std.h -rw-r--r-- 1 root root 837247 27 janv. 12:55 glew.h -rw-r--r-- 1 root root 656589 21 mars 18:07 glext.h -rw-r--r-- 1 root root 84468 21 mars 18:07

Compiling c++ and cuda code with MinGW in QTCreator

匿名 (未验证) 提交于 2019-12-03 08:50:26
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im trying to compile simple cuda program (i took source code from Compiling Cuda code in Qt Creator on Windows ) This is my .pro file: TARGET = Cuda # Define output directories DESTDIR = release OBJECTS_DIR = release/obj CUDA_OBJECTS_DIR = release/cuda # Sourcefiles SOURCES += main.cpp # This makes the .cu files appear in your project OTHER_FILES += vectorAddition.cu # CUDA settings <-- may change depending on your system CUDA_SOURCES += vectorAddition.cu CUDA_SDK = "C:/Cuda/CudaSamples" # Path to cuda SDK install CUDA_DIR = "C:/Cuda

Eclipse not respond when try to configure GIT

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Windows 10 Pro 64 Bit SSD Kingston i5-4690 Eclipse version: ALL Workspace: empty Problem: everytime i try to configure TEAM > GIT > configuration or i try to import/create local/remote git, eclipse freeze until i force to close it with task. I have already tryed a fresh install ( juno/mars/neon/oxygen ) 32/64 bit with and without installer with no good results !SESSION 2017-06-27 00:39:29.113 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader

Implementing a custom hypercall in kvm

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am very new to Virtualization and of late I have been trying to familiarize myself with the way VMMs operate and how hypercalls are made. Talking about which I plan to implement a new hypercall in KVM which is installed on my Ubuntu desktop, and in turn can be callable from the guest environment.With this hypercall I plan to just return a string saying "Hello World". At this point,I am clueless about how to make it happen.It would be really helpful if you could please guide me as to how do I go about implementing such a hypercall.Thank you

3、内核对设备树的处理

a 夏天 提交于 2019-12-03 08:11:44
第01节_从源头分析_内核head.S对dtb的简单处理 bootloader启动内核时,会设置r0,r1,r2三个寄存器, r0一般设置为0; r1一般设置为machine id (在使用设备树时该参数没有被使用); 表示使用哪个单板 r2一般设置ATAGS或DTB的开始地址 bootloader给内核传递的参数时有2种方法: ATAGS 或 DTB 对于ATAGS传参方法, 可以参考我们的"毕业班视频-自己写bootloader" a. __lookup_processor_type : 使用汇编指令读取CPU ID, 根据该ID找到对应的proc_info_list结构体(里面含有这类CPU的初始化函数、信息) b. __vet_atags : 判断是否存在可用的ATAGS或DTB(根据DTB文件的格式或者ATAGS文件的格式来判断r2是存放的那种) c. __create_page_tables : 创建页表, 即创建虚拟地址和物理地址的映射关系 d. __enable_mmu : 使能MMU, 以后就要使用虚拟地址了 e. __mmap_switched : 上述函数里将会调用__mmap_switched f. 把bootloader传入的r2参数, 保存到变量__atags_pointer中 g. 调用C函数start_kernel head.S/head