linux-kernel

Is mode switch occur switching from user thread to kernel thread?

一笑奈何 提交于 2021-02-08 06:07:51
问题 I'm confused of user/kernel thread and mode/context switch (Platform: Linux) I have two linked questions. (1) Is the below sentence right? If I make a system call, then mode switch (user mode to kernel mode) will occur and eventually switching from user thread to kernel thread happens. Since system call can only be executed in kernel thread, I think mode switch must occur the switching from the user thread to kernel thread. (2) Then, what we call the overhead of mode switching is that

Is mode switch occur switching from user thread to kernel thread?

核能气质少年 提交于 2021-02-08 06:07:11
问题 I'm confused of user/kernel thread and mode/context switch (Platform: Linux) I have two linked questions. (1) Is the below sentence right? If I make a system call, then mode switch (user mode to kernel mode) will occur and eventually switching from user thread to kernel thread happens. Since system call can only be executed in kernel thread, I think mode switch must occur the switching from the user thread to kernel thread. (2) Then, what we call the overhead of mode switching is that

How to draw a pixel by changing video memory map directly in a C program (without library functions)

浪尽此生 提交于 2021-02-08 04:11:29
问题 Is it possible to display a black dot by changing values in the screen(video ie monitor) memory map in RAM using a c program? I don't want to use any library functions as my primary aim is to learn how to develop a simple OS. I tried accessing the starting screen memory map ie 0xA0000 (in C). I tried to run the program but got a Segmentation Fault since no direct access is provided. In super user, the program gets executed without any change. Currently I am testing in VirtualBox. 回答1: A "real

How to draw a pixel by changing video memory map directly in a C program (without library functions)

回眸只為那壹抹淺笑 提交于 2021-02-08 04:05:25
问题 Is it possible to display a black dot by changing values in the screen(video ie monitor) memory map in RAM using a c program? I don't want to use any library functions as my primary aim is to learn how to develop a simple OS. I tried accessing the starting screen memory map ie 0xA0000 (in C). I tried to run the program but got a Segmentation Fault since no direct access is provided. In super user, the program gets executed without any change. Currently I am testing in VirtualBox. 回答1: A "real

How to draw a pixel by changing video memory map directly in a C program (without library functions)

霸气de小男生 提交于 2021-02-08 04:05:21
问题 Is it possible to display a black dot by changing values in the screen(video ie monitor) memory map in RAM using a c program? I don't want to use any library functions as my primary aim is to learn how to develop a simple OS. I tried accessing the starting screen memory map ie 0xA0000 (in C). I tried to run the program but got a Segmentation Fault since no direct access is provided. In super user, the program gets executed without any change. Currently I am testing in VirtualBox. 回答1: A "real

USB host mode in Android device supporting OTG

我只是一个虾纸丫 提交于 2021-02-08 03:36:06
问题 I'd like to know in which mode a USB-OTG-supporting Android device is by default, - in the USB host mode or USB slave mode ? I guess, if the device is in slave mode, then there's no point of using API described on link below ? https://developer.android.com/guide/topics/connectivity/usb/host.html Is there a way to programmatically switch from host to slave mode and vice versa ? As you know, a USB OTG (On the go) device automatically switches to host or slave mode, depending on which end of an

Sending realtime signal from a kernel module to user space fails

ぃ、小莉子 提交于 2021-02-08 03:32:28
问题 I found example code on how to send a realtime signal from a kernel module to user space here I implemented it in the kernel module as shown below: static int dmtimer_sendSignal(int val, int id, int sig) { struct siginfo info; struct task_struct *t; int ret; ret = 0; if ((id > 0) && (sig > 0)) { /* send the signal */ memset(&info, 0, sizeof(struct siginfo)); info.si_signo = sig; info.si_code = SI_QUEUE; // this is bit of a trickery: SI_QUEUE is normally used by sigqueue from user space, //

Booting gem5 X86 Ubuntu Full System Simulation

ぃ、小莉子 提交于 2021-02-08 03:14:00
问题 I need to run a relatively newer version of x86 disk image on gem5. Starting from this guide I used Ubuntu 12.04 disk image with Kernel v3.2.1 as that combination was worked for someone else. After some point, simulator just hangs, please share any ideas about the reason and possible solutions. Thank you! You may find the output on the m5term/telnet below. After that, is the process to prepare the disk image and the kernel for reference. The last part of the terminal of gem5 (m5term/telnet):

Booting gem5 X86 Ubuntu Full System Simulation

天涯浪子 提交于 2021-02-08 03:07:09
问题 I need to run a relatively newer version of x86 disk image on gem5. Starting from this guide I used Ubuntu 12.04 disk image with Kernel v3.2.1 as that combination was worked for someone else. After some point, simulator just hangs, please share any ideas about the reason and possible solutions. Thank you! You may find the output on the m5term/telnet below. After that, is the process to prepare the disk image and the kernel for reference. The last part of the terminal of gem5 (m5term/telnet):

Linux kernel headers' organization

随声附和 提交于 2021-02-07 13:47:57
问题 While I was doing some reading on system calls, I did a search for syscalls.h to find the header file in LXR. The search results puzzled me. There is a dozen of syscalls.h files coming from directories under arch/_arch_name_/include/asm . These are ok, they are architecture specific definitions or something else needed. The question is why do we have two different syscalls.h headers under both include/linux and include/asm-generic ? Also, I want to find out that what include/linux headers are