kernel

Interrupts in UART 16550 and Linux Kernel

半城伤御伤魂 提交于 2020-01-04 06:57:28
问题 I'm trying to use interrupts to see if there are errors in an UART 16550D and when a character is available to be read. The UART configurations is as follows: #define UART 0x03f8 // Endereço da Porta Serial - I (com1) #define UART_IER 1 #define UART_LCR 3 #define UART_LSR 5 #define UART_DLL 0 /* Out: Divisor Latch Low */ #define UART_DLM 1 /* Out: Divisor Latch High */ #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ #define UART_LSR_DR 0x01 /* Receiver data ready */ #define UART

What Privileges does vfork() child possess ?

岁酱吖の 提交于 2020-01-04 05:41:10
问题 Does the process created with vfork() has same the same level of privileges that of a creator process i.e parent process ? example : If I run a process as root does vfork() child possess the same execution privileges? 回答1: Open Group (POSIX) specification of fork() says: The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below: As there is no mention of UIDs/GIDs below that text, you

How to compile and install Linux Kernel 5.4.1 from source code

两盒软妹~` 提交于 2020-01-04 03:08:04
https://www.cyberciti.biz/tips/compiling-linux-kernel-26.html Compiling a custom kernel has its advantages and disadvantages. However, new Linux user/admin find it difficult to compile Linux kernel. Compiling kernel needs to understand few things and then type a couple of commands. This step by step howto covers compiling Linux kernel version 5.4.1 under an Ubuntu or Debian Linux. The following instructions successfully tested on an RHEL 7/CentOS 7 (and clones), Debian Linux, Ubuntu Linux and Fedora Linux 28/29. However, instructions remain the same for any other Linux distribution. How to

How can I get notifications that a file is being read on OS X?

谁说我不能喝 提交于 2020-01-04 02:40:52
问题 I have a piece of software that works on Windows. The software has two components: file system minifilter driver that works in kernel mode and a user mode component that talks to the driver. Driver receives notifications on IO interrupt requests, such as IRP_MJ_READ. A sample application that does this can be found on github. This works for any user and most file systems supported by Windows. I need to develop similar piece of software for OS X (desktop and server only). Things I looked at:

Docker windows loading kernel modules

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 02:27:09
问题 I'm running Docker for Windows (similar effect described below is observable on MacOSX) I have a Docker Container in which a program tries to access a squashfs image. To access squashfs the kernel has to be either complied with loopdevice support statically or load the relevant kernel module. When I try to mount the image or setup the loop device the kernel that's shared between docker containers cannot find the loopdevice module. I could possibly use unsquashfs tool but the squashfs image is

What does “>>=” mean in Linux kernel source code?

老子叫甜甜 提交于 2020-01-04 01:40:06
问题 in Linux kernel source code, I find below code: h++; pending >>= 1; It is part of __do_softirq(void) . But what does ">>=" mean? Why isn't it ">>" as I remember? Thanks! 回答1: It simply does pending = pending >>1; In short it divides by 2 an unsigned int. That's the same construct than += , /= , etc. It's not just pending >>1 as you remember because that wouldn't store the result of the shift operation in the variable. 回答2: It's equivalent to pending = pending >> 1; Which bitshifts right the

configuring linux kernel with (hard-loaded, built in) currently loaded modules

泪湿孤枕 提交于 2020-01-03 23:10:09
问题 I want to build from source a recent Linux kernel (e.g. 4.13.4 in end of september 2017) on my Debian/Sid/x86-64 with all (or most) currently loaded modules configured as hard-built in the new kernel. (I believe that I have read something like this somewhere, but can't remember where and can't find it) It would be some make configfromloadedmodules (but of course it is not exactly configfromloadedmodules makefile target, but some other target that I did not easily find). That is, for most

configuring linux kernel with (hard-loaded, built in) currently loaded modules

最后都变了- 提交于 2020-01-03 23:08:28
问题 I want to build from source a recent Linux kernel (e.g. 4.13.4 in end of september 2017) on my Debian/Sid/x86-64 with all (or most) currently loaded modules configured as hard-built in the new kernel. (I believe that I have read something like this somewhere, but can't remember where and can't find it) It would be some make configfromloadedmodules (but of course it is not exactly configfromloadedmodules makefile target, but some other target that I did not easily find). That is, for most

Use do_mmap() in Linux device driver

回眸只為那壹抹淺笑 提交于 2020-01-03 18:34:09
问题 The device we work at now need to have a user space virtual memory address, we try to use do_mmap() as below: *uvaddr = (void *)do_mmap(0, 0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS, 0); But we got following error Unable to handle kernel paging request for data at ad8 Is it okay to use "do_mmap()" in a device driver? If not, any correct way to do it? 回答1: It's possible that do_mmap is succeeding, but uvaddr does not point to a valid location to store the result. To check this for sure, do

5-D Kernel density estimation in R using “kde” function

做~自己de王妃 提交于 2020-01-03 17:45:49
问题 I want to perform Kernel density estimate for a 5-dimensional data (x,y,z,time,size) by using "kde" function in "ks" library of R. In it's manual it says it can do Kernel density estimate for 1- to 6-dimensional data (Page 24 of manual: http://cran.r-project.org/web/packages/ks/ks.pdf). My problem is that it says for more than 3 dimensions I need to specify eval.points. I don't know how can I specify the evaluation points because there is no example for more than 3 dimensions. For example if