kernel

Viewing the exact memory range that a linker 'uses' for a executable binary

别等时光非礼了梦想. 提交于 2020-04-17 21:45:28
问题 I am doing a bit of OSdev, and I've been trying to implement memory management in my kernel. I have started off with a physical memory manager (this is a 32 bit OS). The idea is to keep a table of bits where we allocate a bit per 4K physical memory block. If the bit is '1', the block is in use and if '0', it isn't. I thought that this table should come after the kernel. So here is my kernel code (minimal): #include<stdint.h> #define PMMAP 0x1000 //This contains information from int 15h/E820

Viewing the exact memory range that a linker 'uses' for a executable binary

假如想象 提交于 2020-04-17 21:41:46
问题 I am doing a bit of OSdev, and I've been trying to implement memory management in my kernel. I have started off with a physical memory manager (this is a 32 bit OS). The idea is to keep a table of bits where we allocate a bit per 4K physical memory block. If the bit is '1', the block is in use and if '0', it isn't. I thought that this table should come after the kernel. So here is my kernel code (minimal): #include<stdint.h> #define PMMAP 0x1000 //This contains information from int 15h/E820

is there any simple code for beginners where i can experiment diff kernels used in gaussian process example in scikit learn to know their functions?

℡╲_俬逩灬. 提交于 2020-04-16 02:33:30
问题 actually i want to understand the kernels used in scikit learn gaussian example but i have zero knowledge about how those kernel behaves and when to use which and i also not getting any sample basic template code where i can use those kernel one by one and understand.The partial code is given below: X, y = load_mauna_loa_atmospheric_co2() Kernel with parameters given in GPML book k1 = 66.0**2 * RBF(length_scale=67.0) # long term smooth rising trend k2 = 2.4**2 * RBF(length_scale=90.0) \ *

Tool to Debug Guest OS in Virtual Box

假装没事ソ 提交于 2020-04-10 07:10:30
问题 I'm just cross posting the same question I did on virtualbox.org. http://forums.virtualbox.org/viewtopic.php?f=9&t=26702&p=119139#p119139 If not breaking any rule, I'd appreciate to kwon more about it since stackoverflow promisses to be more dynamic! "Hi, I did some search and could not find any tool to debug a guest system from the early boot in virtual box. Although, I came across JCP, a x86 emulator in java that is not so powerful and beautyful but has a debug mode where one can view the

Kernel error after updating Spyder in anaconda [duplicate]

荒凉一梦 提交于 2020-04-10 03:37:20
问题 This question already has answers here : Kernel error after updating to Spyder 4.1 (3 answers) Closed 21 days ago . I updated Spyder to version 4.1.0 (together with all other packages in anaconda). Spyder itself works fine however the kernel is not working. I get the following error and can't figure out how to solve it: An error ocurred while starting the kernel The error is: Traceback (most recent call last): File "C:\Users\20172010\AppData\Local\Continuum\anaconda3\lib\site‑packages\spyder

Kernel error after updating Spyder in anaconda [duplicate]

独自空忆成欢 提交于 2020-04-10 03:36:11
问题 This question already has answers here : Kernel error after updating to Spyder 4.1 (3 answers) Closed 21 days ago . I updated Spyder to version 4.1.0 (together with all other packages in anaconda). Spyder itself works fine however the kernel is not working. I get the following error and can't figure out how to solve it: An error ocurred while starting the kernel The error is: Traceback (most recent call last): File "C:\Users\20172010\AppData\Local\Continuum\anaconda3\lib\site‑packages\spyder

随笔之GoldFish Kernel启动过程中arm汇编分析

本秂侑毒 提交于 2020-04-09 09:46:11
随笔之 GoldFish Kernel 启动过程中 arm 汇编分析 一 分析 电子版下载 http://download.csdn.net/detail/innost/4834459 本节介绍 Kernel 启动。此时 Piggy 已经将 vimlinux 解压, BL 将执行权限传给了 Kernel 。 代码在 arch/arm/kernel/head.S 中。相关代码如下: // 将采用 C/C++ 注释语句 /* .section是GNU ASM的语法。格式如下: .section name[,"flags"[,@type]] 其中,name是必须的,flags是可选。 "ax"表示:a为section is allocatable,x为executable。 */ .section ".text.head", "ax" //这个ENTRY(stext)有相当的含义。在kernel/vmlinux.ld.S中,也定义了一个ENTRY。在ld //语法中,ENTRY是一个command,用来定义入口点。所以,这里就是kernel执行的入口点函数。 ENTRY(stext) /* MSR:是ARM汇编指令,用来将数据copy到status register寄存器中。cpsr_c表示要操作 CPSR寄存器的Control标志。 */ msr cpsr_c, #PSR_F_BIT

快,学会 shell

故事扮演 提交于 2020-04-07 23:47:04
本文分成入门篇和基础篇。基础篇包括变量、字符串处理、数学运算三部分。基础篇包括流控制、函数和函数库三部分。主要是基于例子进行讲解,其中有 4 个复杂一点的脚本,看懂了也就入门了。 我们先来聊一聊 shell 和 shell script 的概念。计算机的运行离不开硬件,我们通过操作系统(OS,Operating System)操作硬件,而我们所说的 linux 严格来说是操作系统(OS)的核心部分——内核(Kernel)。我们无法直接操作 kernel,需要借助于 kernel 外的一层壳 shell 才能与 kernel 进行交互。如果把操作系统(OS)看做是一家公司,shell 就是前台,kernel 就是董事会。当我们访问公司的时候,先和前台(shell)打个招呼,前台通知董事会(kernel),董事会来控制公司(OS)。 俗话说“铁打的营盘流水的兵”,就是公司人来人往,都不会影响公司的运转。对于操作系统也一样,我们可以替换操作系统的前台(shell),甚至董事会(kernel)。如果你想知道你的系统中用到的是什么 shell 可以访问 /etc/shells 文件。,我的电脑上就有下面几种 shell: # /etc/shells: valid login shells /bin/sh /bin/dash /bin/bash /bin/rbash /bin/zsh /usr

使用qemu和kgdb调试内核源码

人走茶凉 提交于 2020-04-07 11:34:51
kgdb文档: http://kernel.org/doc/htmldocs/kgdb.html 修改.config # CONFIG_DEBUG_RODATA is not set CONFIG_FRAME_POINTER=y CONFIG_KGDB=y CONFIG_KGDB_SERIAL_CONSOLE=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y #! /bin/sh #qemu-system-x86_64 -kernel kernel/bzImage -append "root=/dev/sda" -boot c -hda busybox.img -k en-us -s -S qemu-system-x86_64 -kernel kernel/bzImage -append "root=/dev/sda kgdboc=kms,kbd,ttyS0,115200 kgdbwait kgdbcon" -boot c -hda busybox.img -k en-us -serial tcp::1234,server gdb设置 gdb vmlinux set debug remote 1 开启远程调试 set architecture i386:x86-64:intel set remotebaud 115200 target remote

OS实现流程草稿

放肆的年华 提交于 2020-04-05 15:50:43
实现一个OS需要现在网上搜索 不要在Windows环境下写 nasm等汇编编译器的语法 bois中断函数使用 内存分布 描述符 实模式与保护模式 从实模式到保护模式比较难,可以从网上找一些代码能运行自己理解就行了 页表 硬盘与软盘的结构 制作软盘:高级语言编写工具或者直接只用Linux下的命令行工具 系统算法 与硬件有关的操作(端口,相应中断等)都用汇编写了,逻辑在C中写,必要时调用汇编中的函数,接着再调用C语言封装好的函数 汇编应该实现的操作(被C语言调用) 端口的读入读出 流程 先写一个Hello world=》测试 将Hello world改写为bootloader和kernel=》测试 在kernel中实现实模式到保护模式-》测试 可以用C语言了(因为C语言需要堆栈,所以需要在kernel中配置堆栈的描述符和内存空间(定义512或者其他),关于GDT的修改都是在进入保护模式之前) 将显卡从字符模式切换到图形模式(调用BIOS函数)=》测试 界面 将显卡的图形模式再转为调色板模式=》测试绘制背景图形 绘制字体和字符串(Windows NT的内核就是通过将调试信息绘制在屏幕上实现Windows NT内核的调试的,又因为画字体不方便,于是写了GDI相关的API,Windows NT的GUI就是在内核态的,Linux没有这样子使用,它使用的还是文本模式) 绘制鼠标 图像分层