kernel

Why linux kernel use trap gate to handle divide_error exception?

只愿长相守 提交于 2020-01-27 20:54:46
问题 In kernel 2.6.11.5, divide zero exception handler is set up as: set_trap_gate(0,&divide_error); According to "Understanding The Linux Kernel", Intel trap gate cannot be accessed by a User Mode process. But it's quite possible that a user mode process also generate a divide_error . So why Linux implement it in this way? [Edit] I think that the question is still open, since set_trap_gate() sets DPL value of IDT entry to 0, which means only CPL=0 (read kernel) code can execute it, so it's

Why linux kernel use trap gate to handle divide_error exception?

会有一股神秘感。 提交于 2020-01-27 20:53:58
问题 In kernel 2.6.11.5, divide zero exception handler is set up as: set_trap_gate(0,&divide_error); According to "Understanding The Linux Kernel", Intel trap gate cannot be accessed by a User Mode process. But it's quite possible that a user mode process also generate a divide_error . So why Linux implement it in this way? [Edit] I think that the question is still open, since set_trap_gate() sets DPL value of IDT entry to 0, which means only CPL=0 (read kernel) code can execute it, so it's

Why linux kernel use trap gate to handle divide_error exception?

这一生的挚爱 提交于 2020-01-27 20:53:24
问题 In kernel 2.6.11.5, divide zero exception handler is set up as: set_trap_gate(0,&divide_error); According to "Understanding The Linux Kernel", Intel trap gate cannot be accessed by a User Mode process. But it's quite possible that a user mode process also generate a divide_error . So why Linux implement it in this way? [Edit] I think that the question is still open, since set_trap_gate() sets DPL value of IDT entry to 0, which means only CPL=0 (read kernel) code can execute it, so it's

cuda 极简学习理解

人盡茶涼 提交于 2020-01-26 13:12:04
遇到cuda程序,开始理解学习cuda概念及使用 Cuda 有硬件概念 SP (streaming processor) , SM(streaming multiprocess or) 有方便编程的软件概念 thread, blocks, grid 各个概念 的解释 : SP :流处理器,最基本的处理单元,也称为 CUDA core ,最后具体的指令和任务都是在 SP 上处理的。 GPU 进行并行处理,是很多个 SP 同时做处理。 SM :多个 SP 加上其他的资源组成的一个 streaming multiprocessor 。其他资源如 warp scheduler, register, shared memory 等。 SM 可以看做 GPU 的心脏, register, shared memory 是 SM 的稀缺资源, CUDA 将这些资源分配给驻留在 SM 中的 threads( 线程 ) 。 以上的硬件结构如下图所示, 图中每一个绿色的小块代表一个 SP 。一个 SM 包含对个 SP 。 Thread : 是操作系统 能够进行运算调度 的最小单位 。一个 CUDA 的并行程序会被多个 threads 来执行。 Blocks :数个 threads 会被群组成一个 block ,同一个 block 中的 threads 可以同步,也就可以通过 shared memory

QEMU - No kernel output after “Booting kernel”

◇◆丶佛笑我妖孽 提交于 2020-01-26 03:57:45
问题 I try to boot precompiled kernel in QEMU self-created machine. Serial peripherial is configured and I sucessfully can boot precompiled U-boot image for this machine. In U-Boot all serial IO works great (memory adressing and UART address is also prepared in machine setup). Using option -nographic i can read and write in UBoot command prompt. I can issue a bootm command in Uboot to load kernel to RAM and boot it. Last string i see is "Uncompressing Linux...done. Booting kernel...". And there i

How kernels recognize sin_zero (sockaddr_in structure) pushed

落爺英雄遲暮 提交于 2020-01-25 17:34:30
问题 According to https://stackoverflow.com/questions/28277079/need-i-push-sin-zero-sockaddr-in, it's my election reserve the space of sin_zero in the stack (sub esp, 8) or not. If I push, ok, I've pushed 16 bytes (sizeof(sockaddr_in)), but if I don't reserve the 8 bytes of sin_zero how kernels know? struct sockaddr_in { short sin_family; // e.g. AF_INET, AF_INET6 unsigned short sin_port; // e.g. htons(3490) struct in_addr sin_addr; // see struct in_addr, below char sin_zero[8]; // zero this if

一、安卓系统架构全面分析

社会主义新天地 提交于 2020-01-25 15:32:44
一、引言 Android系统非常庞大,横跨了多个领域,但整体架构设计清晰。 底层内核空间:以Linux Kernel作为基础。 上层用户空间:由Native系统库、虚拟机运行环境、Framework框架层组成。 通过系统调用( Syscall )连通系统的内核空间与用户空间。对于用户空间主要采用C++和Java代码编写,通过 JNI技术 打通用户空间的Java层和Native层(C++/C),从而连通整个系统。 为了能让大家整体上大致了解Android系统涉及的知识层面,先来看一张Google官方提供的经典分层架构图,从下往上依次分为Linux内核、HAL、系统Native库和Android运行时环境、Java框架层以及应用层这5层架构,其中每一层都包含大量的子模块或子系统。 二、Android架构 android的本质是一个基于Linux上运行的java虚拟机。 首先为了理解安卓系统是怎么工作的,就先来看一下android的系统架构。 其架构大至可以分为五层:linux内核层、HAL层、系统运行库层、应用框架层和应用层,那就先说说这几层。 1.linux kernel层 Android系统是基于Linux内核的,这一层为Android设备的各种硬件提供了底层的驱动(如显示,音频,照相机,蓝牙,WI-FI,电源管理等等),而linux内核作为一个抽象层存在硬件和软件之间

Unable to debug the kernel driver using Serial cable

那年仲夏 提交于 2020-01-25 12:55:07
问题 I am new to driver stuff. I have tried to debug the kernel driver using serial COM port without success. Could someone show me proper direction how to fix the problem? I am seeing the following messages on kd console. ERROR: DavReadRegistryValues/RegQueryValueExW(4). WStatus = 127 ERROR: DavReadRegistryValues/RegQueryValueExW(5). WStatus = 127 ERROR: DavReadRegistryValues/RegQueryValueExW(6). WStatus = 127 At this time, I pressed Ctl^D and kd console and I am seeing READ: Timeout. READ: Wait

Android版本与Linux内核的关系及代码获取

♀尐吖头ヾ 提交于 2020-01-25 10:10:53
一.Android版本与Linux内核的关系 英文名 中文名 Android版本 Linux内核版本 No 无 1.1 Cupcake 纸杯蛋糕 1.5 2.6.27 Donut 甜甜圈 1.6 2.6.29 Eclair 松饼 2.0 2.6.29 Eclair 松饼 2.1 2.6.29 Froyo 冻酸奶 2.2 2.6.32 Gingerbread 姜饼 2.3 2.6.35 Honeycomb 蜂巢 3.0 ? 二.下载源码分为2大部分 1.Android源码; 2.Android内核(Android Linux Kernel); 三.如何下载Android内核 git clone git://android.git.kernel.org/kernel/common.git 四.如何查看Android内核的版本(代码级查看) 在内核代码目录: 运行命令:git branch –a 运行实例 [root@localhost common]# git branch -a (查看版本) * android-2.6.36 remotes/origin/HEAD -> origin/android-2.6.36 remotes/origin/android-2.6.35 remotes/origin/android-2.6.36 remotes/origin/archive

trouble using python 3 because of kernel error

末鹿安然 提交于 2020-01-25 09:27:06
问题 I just installed anaconda 3 and tried to use Jupyter Notebook for Python 3. However, it did not work because of the kernel error on the top right coner and the error message was Traceback (most recent call last): File "C:\Users\jiyoon\Anaconda3\lib\site-packages\tornado\web.py", line 1699, in _execute result = await result File "C:\Users\jiyoon\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Users\jiyoon\Anaconda3\lib