The bootstrapping process is a bit confusing, I hope I understand it correctly. I will try to describe my understandings and hopefully can be corrected. As this is an extremely important and I want to dive into the small details. BIOS: It sets up an interrupt descriptor table and initializes various devices. After initializing all the important devices the BIOS
Tag: operating-system
Linux kernel – Context switch when calling function from other module?
I am curious if calling a function from a different module in the Linux kernel triggers a context switch? Basically, I’m doing something like this. Say I have module A: module B: between the two measurements, I’m seeing a gap of up to 2 microseconds (after dividing through the TSC frequency). Could this gap be due to a context switch?
Irregular result in zombie example
I have problems with understanding the behavior of this code: When running in a Unix shell I get this result: But sometimes its only giving me this result without any shell prompt: I know it can be solved with wait() function in parent process. But I like to know: Why is result irregular? Could someone please explain what happening? Child
Getting the path to a users documents folder on Linux and MacOSX
I’m currently developing a GUI using Matlab and I need to get the directory of the standard document folder of the user. Under windows I use this: and it works perfectly. Now I planned on doing the same for Linux and Mac with the system(command), but I have no idea what the actual command must look like under these OS.
Sending payload with sigaction
how can I use sigaction such that a process can send a payload with the signal that can be retrieved by the receiving process? Answer You use a realtime signal (SIGRTMIN+0 to SIGRTMAX-0), so that the signals are queued, and you have a much lesser chance of missing one. (Standard signals are not queued, so if two signals are sent
How can I write a I/O bound C program?
I must write programs that are I/O Bound and that will make my I/O scheduler work like never done before for a Operating Systems homework, but I have no idea how to do it. I’ve tried writing a simple C program that counts the lines of big text files, but it executes too fast and I can’t measure the effectiveness
PID of infinite loop run in background (&) in bash script
I have simple bash script How can I assign pid of this loop to variable, to kill process in future ? I try trap, but loop has own pid so I should know pid of loop running in background to kill it for example after SIGTERM. Answer The PID of the background-process started can be extracted from this $! variable.
infinite loop malloc in a 32 bit kernel with 4 Gb RAM and 10 Gb Swap Partition
Let’s say I have a 32-bit kernel. 4 Gb RAM, 10 Gb Swap Partition. I have a process which has malloc in an infinite loop. So, eventually system’s OOM would kill the process. Here are two arguments. Argument 1: Since, it’s 32 bit Kernel with a Virtual address split of 3:1 i.e. 3Gb for user space and 1 Gb for
Where are inodes stored at?
I recently started learning about the Linux kernel and I just learned about inodes, which are data-structures containing meta-data of a file. Now, how do the OS find the associated inode of a file? (Let’s say a string of a path). Moreover, where are those inode stored at? I mean, obviously they are stored on the disk but how is
Which segments are affected by a copy-on-write?
My understanding of copy-on-write is that “Everyone has a single, shared copy of the same data until it’s written, and then a copy is made”. Is a shared copy of the same data comprised of a heap and bss segment or only heap? Which memory segments will be shared, and is this dependent on the OS? Answer The OS can