FAQ Database Discussion Community


Comparing Files dependent on operative system. JUnit

java,csv,junit,operating-system
I have a simple JUnit test which checks two files have the same content. It works perfectly fine in my Unix laptop. Here it is the test: boolean response = false; try { File got = File.createTempFile("got-", ".csv"); String outputPath = got.getAbsolutePath(); testedObject.createCsvFile(outputPath); got = new File(outputPath); String expectedFilePath =...

What does the User/Supervisor bit in the page table entry mean?

operating-system,paging
I am trying to understand whether: the User/Supervisor bit is used to distinguish pages of kernel memory, from those of the user process the User/Supervisor bit changes when execution moves to the kernel while executing a system call Or perhaps none of them. Can someone clarify?...

Operating Systems - General Process Creation

process,operating-system
Review Question Consider the Program #include <stdio.h> int main(){ putchar('X'); exit(0); } Suppose it is compiled an an a.out file is generated. now suppose that a user in a local console window types a.out and hits the return key. what happens? be sure to describe a plausible but detailed and...

Operating Systems - Organization Questions

multithreading,operating-system,multicore
I am studying for a 3 topic comprehensive exam that decides If I graduate or not, and have some questions on Operating System Organization A) How does a multicore computer with shared memory differ from a distributed or a clustered system with respect to OS? Make specific reference to the...

Multiple pipes and processes

c,operating-system,pipe,fork,child-process
I am trying to communicate with children processes and make them sort a part of a list. My problem is children processes read everything but do nothing after it. int main(int argc, char *argv[]){ int i; int num_children; pid_t pid; num_children= 3; int fd[num_children][2]; //PIPES for (i=0; i<num_children; i++) {...

Trouble outputing file size to a label from a listbox in Python 3

python-3.x,operating-system
I'm using os.path.getsize() to output the size of a file to a label. The file path is stored in a listbox. The function works, but it outputs the file size in bits, so I wrote the following to convert to more appropriate units, and it is now displaying only in...

why library functions should not be used in creating an os?

c,operating-system
I am planning to study about operating systems. I met with 2 doubts. Why we should not use library functions while creating an operating system? What is the drawback in it?

Operating Systems - File system on SSD vs Rotational

operating-system,filesystems,ssd
Solid State Drives (SSD) pose new challenges and opportunities for designers and implementers of file systems. On the one hand, an SSd has no rotational delay and no seek time because no rotational media is involved. On the other hand, space is costlier: SSDs are 10-20 times more expensive per...

Effective use of touch/hover co-ordinates on a View

android,operating-system,screen,coordinate
On Android phone, I get the information of co-ordinates that, user touch on his/her phone screen or device. How do i then, use/pass these X-Y coordinates to run a specific function of mine, and use it in my code

Not checking file size correctly

python,file,python-3.x,file-io,operating-system
I wrote a simple script to move movies in my downloads directory, once they are finished downloading, to the location they need to go and have a simple question regarding it. Maybe I'm not understanding how the os module is working to the current size of the file here, but...

about GDT and processes

c,assembly,operating-system,protected-mode
how does GDT reflected on linear space of process ( if I understand it right, GDTR contains page and offset ) .? or another version of this question : GDTR is unique for each process .?

How to Calculate Effective Access Time

operating-system,paging,tlb,page-tables
Assume TLB hit ratio is 90%, physical memory access takes 100ns, TLB access takes 20 ns, compute the effective access time for a processor that uses two level page tables, and parallel TLB and page table indexing. This was my formula: (H)(TLB access time + mem access time) + (1-H)(TLB...

Operating system kernel and processes in main memory

c,linux,operating-system,kernel,ram
Continuing my endeavors in OS development research, I have constructed an almost complete picture in my head. One thing still eludes me. Here is the basic boot process, from my understanding: 1) BIOS/Bootloader perform necessary checks, initialize everything. 2) The kernel is loaded into RAM. 3) Kernel performs its initializations...

Need suggestions for Android project

android,android-activity,operating-system
I have been assigned one project of Android, but before taking it I need your advice. I have following low level features I need to hide whole operating system in android and only show my application, even device reboot or reset whenever it start it will show only my application....

How many stack memories will be allocated to a program

c++,visual-c++,dll,operating-system,computer-science
I have a program which have 4 projects as dependency for that (that means it has to load 4 dlls to run that program) .Does the OS allocates 4 stack memories or only 1 stack memory will be allocated for whole program and how much stack memory size will be...

install operating system image on sd card mac error

image,osx,installation,operating-system
I try to install an operating system image on sd card from mac and i got an error. First I list all my partitions: diskutil list I got: /dev/disk2 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *4.0 GB disk2 1: DOS_FAT_32 MONITOR-IOS 4.0 GB disk2s1 and i run: sudo dd...

^M behind operating system version?

linux,windows,unix,operating-system
I am currently writing a perl script to extract data from a log file and create statements using the data in a new file. In this new file, one particular data that I've extracted and used here is the operating system's version. It shows Windows XP Service Pack 3^M. I...

Microcontroller specific codes in OS (Contiki)

operating-system,contiki
I am working on creating a port for LPC1347 to contiki-os. I have 2 questions: 1: What i do not understand is how would the os know what architecture the hardware follows ie, whether is Harvard architecture or Neumann architecture. The microcontroller has 2 srams, so does the compiler or...

Implementing a simple spin lock given some instruction

c,operating-system
For instance if have the following code which is some If set then clear and performs atomic in following manner. This is simple C code. int IfSetThenClear(int * ptr) { int actual = *ptr; if(actual== 1) *ptr = 0; return actual; } Now i want to use this given instruction...

Interrupt Descriptor Table Gate

assembly,x86,operating-system,interrupt-handling,protected-mode
I've written this code to create a sample IDT and load it in to the proper register. I've checked Intel System programming guides for proper structures, and yet I can't get interrupts working. While running kernel code in Bochs, and triggering interrupt (using __asm__ ("int $32"); I get a log...

os.walk missing out certain subdirectories

python,operating-system,os.walk
for dirname, dirnames, filenames in os.walk("C:\\",followlinks=True,topdown=True): for subdirname in dirnames: os.chdir(os.path.join(subdirname, dirname)) if os.getcwd()!="C:\Windows\winsxs": print(os.getcwd()) As you can see, this code is supposed to search the entire C drive for all subdirectories and change Python's working directory and display the result. I can't help but notice for whatever reason, os.walk...

can paging be slower/faster than swapping on a machine?

memory,operating-system
This is a very naive question, but I wonder if there is any comparison that can be made on paging or swapping speed? They are offering the same functionality (moving from memory to disk, etc) but with different strategies (writing frames, or writing down the whole memory). Now the problem...

How can I know which type of process of linux will use for these?

linux,linux-kernel,operating-system,scheduled-tasks
if I am listening to an audio file, creating a presentation, and downloading something from the internet...while we know that: an audio file will use real-time creating a presentation will use interactive and downloading will use background but what I cannot know is for example: when an audio file will...

Determining which request can be granted as edge of hold,wait and illegal

graph,resources,operating-system,deadlock,cycle
Consider the resource allocation graph :- Assume the sequence of requests is given as: P4 → R3 P1 → R4 P3 → R1 P2 → R3 P4 → R2 P5 → R4 Which requests can be granted such that there should be no deadlock? I tried solving it but just...

Memory Management (Allocating Pages/Frames to Logical Addresses)

memory,memory-management,operating-system,paging,virtual-memory
I am new to Operating Systems and I was following this handbook which I am reading to get a better grasp on how computers really work. However having stumbled upon Memory Management I found it somewhat confusing when allocating Frames to Pages using Page tables. Say Page/Frame size is 4K...

C Kernel - Works fine on VM but not actual computer?

c,assembly,operating-system,kernel,hex
I am making a basic C kernel. (Loaded by an assembly program) I am compiling it with an i686-elf cross compiler for windows. My C code is as follows: void cls(); void drawhappy(); void main(){ char *vidptr = (char *)0xb8000; cls(); drawhappy(); } void cls(){ char *vidptr = (char *)0xb8000;...

Why is the size of a page table entry determined only by main memory size?

memory,operating-system
Excluding the valid, dirty and reference bits, considering only actual "mapping" from virtual address space to physical address space, why is it said that the size of a page table entry is determined by the number of bits required to reference a page from the main memory (Like here: http://stackoverflow.com/a/14770650/3684931)...

C: Trying to restore signal handlers with sigaction but not succeeding.

c,linux,ubuntu,operating-system
I'm writing a small program in C, (running on ubuntu). The first time the program receives Ctrl+C, I want the signal to be ignored, but the second time (after 10 seconds of waiting), I want the original action to be restored (and the signal not be ignored). So I have...

What is the Best Linux OS for Samsung 900x? [closed]

linux,operating-system
I was just wondering if you can recommend me a Linux OS for my Samsung 900x laptop. I just want to familiarize myself with the Linux OS and I know companies like people who uses Linux. Thanks!

Bare bones OS kernel programming

c,linux,assembly,operating-system,kernel
I have recently started to take an interest in the topics of operating systems. I have a couple of things that are weighing on my mind, but I have decided to split the questions. Let's assume we're designing a kernel for a new instruction set architecture that's out on the...

c - loading raw binaries

c,operating-system,elf
Is it possible to execute a raw binary stored in a char array? I tried doing it like so: #include "stdio.h" int main(int argc, char **argv) { FILE *f = fopen(argv[1],"r"); if(!f) return 1; fseek(f,0,SEEK_END); long l=ftell(f); rewind(f); char *buf = malloc(l+1); fread(buf,1,l,f); fclose(f); void (*func)() = (void(*))buf; func(); }...

Protected mode, setting segment registers

assembly,operating-system,gas,protected-mode
I'm recently playing with gnu-assembler in simple os development. I'm using code below to switch CPU to protected mode. In order to do this I set GDT as follow and performed far jump to given label wit 0x08 as GDT offset (to set CS). CPU did not reset itself after...

Java remote interactions

java,operating-system,remote-server,interaction
I'm in internship, and my mission is to build a deployment program in Java. My approach was based on a "tasks to do for a deployment" model with dynamic instanciation (but this is not the point). Every task does something locally or on the remote server (sometimes both). For example,...

How to tell the difference between linux and mac

python-3.x,operating-system,cross-platform
I am creating a setup file for a tarball, and I need a way to determine the exact name of the system. I tried os.name, but it returns 'posix' regardless of whether the system is mac or linux. Is there a way to get a more specific OS name?...

Accessing file path in the os

python,file,file-io,operating-system
The following line, unless I'm mistaken, will grab the absolute path to your directory so you can access files PATH = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))) This is what I've been using typically access files in my current directory when I need to use images etc in the programs i've been writing. Now, say...

About Idle tasks in operating systems

operating-system
Every system has IDLE task which will be running if no other tasks are ready to run.So my question is , can IDLE task sleep?. My understanding is if idle task sleep then there is a chance of no task is available for the cpu to run. Is my understanding...

C Static and Auto allocation

c,memory,memory-management,operating-system,allocation
When a C program is started how does it ask the operating system enough memory space for static variables? And while running how does it ask the operating system memory space for automatic variables? I would also like to know how it releases these memory spaces after execution. Please try...

Processes sharing a CPU (scheduler)

process,operating-system,scheduler,round-robin
Question A scheduler attempts to share the CPU between multiple processes. Two processes, P1 and P2, are running. P1 does many I/O operation, while P2 does very few. Explain what happens if a simple ‘round robin’ pre-emptive scheduling algorithm is used to schedule P1 and P2. My Attempt From my...

How to track memory usage of the networking subsystem in the Linux kernel?

linux,performance,networking,linux-kernel,operating-system
Is there a way to determine how much physical memory is being used by the network subsystem in the Linux kernel at any given point in time? I understand the per-connection memory limits can be specified via sysctl. But is there a tool to peek inside the TCP/IP stack and...

Determine addresses and page table size

operating-system,size,memory-address,virtual-address-space,page-tables
I know that this question has been asked many times but I still feel I struggle with it. Given: physical memory: 2^20 32-bit system page size: 2^10 I need to determine what a physical and virtual addresses would look like as well as calculate the page table size. I am...

Where is TCB located on FreeBSD?

multithreading,process,operating-system,freebsd,netbsd
Where is the kernel thread control block (TCB) located On FreeBSD? (After the thread is interrupted, where is the context (containing %RIP/%EIP) saved?) Is it on the kernel stack or somewhere else? In FreeBSD, are process and thread quite similar, like on Linux, or totally different abstractions?...

How does abspath determine if a path is relative?

python,operating-system
I know that abspath can take either a file or a relative set of files and make a full path for them by prepending the current directory, as shown in these examples: >>> os.path.abspath('toaster.txt.') 'C:\\Python27\\Lib\\idlelib\\toaster.txt' >>> os.path.abspath('i\\am\\a\\toaster.txt.') 'C:\\Python27\\Lib\\idlelib\\i\\am\\a\\toaster.txt' And a full path provided will be recognised as absolute and not...

How to change ubuntu to root?

linux,permissions,operating-system
I am new to linux. when i list the files under folder 1, i see below result -rwxrwxrwx 1 root root 920 Jun 3 10:36 file1.xsd -rwxrwxrwx 1 root root 920 Jun 3 10:36 file2.xsd drwxrwxrwx 2 ubuntu ubuntu 4096 Jun 12 11:10 temp -rwxrwxrwx 1 ubuntu ubuntu 1853 Jun...

What is system app [closed]

android,operating-system
I have few questions, What is a system application? How do you go about developing system applications? What is the difference between user and system applications? How is it possible for Android devices to have default system applications without having them installed by the user? ...

How do I fork an external process in java

java,process,operating-system,fork
I'm trying to fork a new external process (such as Calculator) in Java. I'm new to operating systems but I learned that it's possible using something like : Runtime.getRuntime ().exec ("C:\\Windows\\system32\\calc.exe");. However that doesn't actually fork a new process. Is there anyway I can fork an external process using java?

Automate MySQL backup @localhost with mysqldump in Windows 8

mysql,windows,operating-system,scheduled-tasks,mysqldump
I'm trying to set up a task in Windows 8 to automate my localhost db dump. I've created the task to run daily with the following command line: C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe and parameters: --user=root --password=donttellya --result-file=dumped.sql mydb It works but doesn't terminate (running in the tasks list). Also, I'd...

Flush TLB on a context swtich

operating-system,virtual-memory,context-switch,tlb,page-tables
This may depends on the OS, but in general as I understand that when there a page fault (the desired page is not in main memory) occurs OS will instruct CPU to read the page from disk, and I am wondering does OS dispatch to another process while the disk...

C runtime library : what for?

c,operating-system,runtime,libraries
Context: Creating a toy OS, written in assembly and C. X86. 32-bits first, 64-bits then. Currently read how to make a C library and try to understand the underlyings. My question comes from the reading on this page. I read the other SO questions concerning runtime libraries but still don't...

difference between one CPU and multiple CPU in schedule routine - Linux kernel

linux-kernel,operating-system,kernel
In Linux kernel (2.6) is there a difference between the performance of the "schedule()" routine in a system that has only one processor than in a system with multiple processors? I have tried to find the answer in the book "Understanding the Linux kernel (3rd ed.)" but no luck finding...

Why does main function differ from other function from stack point of view

c,assembly,operating-system,stack-trace
I'm studying to use gdb and i got little confused. Here is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> void g(char *password) { } int main(int argc, char *argv[]) { if(argc > 1) { g(argv[1]); } } So with the regular function (g() in this example) if I want...

How to detect that music play in background

android,operating-system,music,background-music
I want help in detecting if there is a music play in background on the phone or not because I play more than one music sequentially in my app but they are intersection thank you

Embox compilation and flashing

c,linker,operating-system,real-time
I am interested in attempting to compile, package and flash Embox to an MCU, from either a Windows or Mac machine (cross-compilation), via JTAG, and I have a number of concerns. Observe what I believe to be the normal way of writing Embox apps and deploying/flashing them to an MCU:...

SCAN and C-SCAN disk scheduling

operating-system,scheduling,disk
http://www.slideshare.net/myrajendra/scan-scheduling-50-1 http://www.slideshare.net/myrajendra/c-scan-scheduling-50-2 In the above links both SCAN and C-SCAN was explained with a same example but why does SCAN moves towards left and C_SCAN moves towards right?...

Coding of Admin-Guest login section in an OS

linux,authentication,cmd,linux-kernel,operating-system
I developed an authentication algorithm for user authentication as part of my masters thesis and implemented it in PHP. I intend to know how can I implement the algorithm for operating system login, in which language (for linux)? also where the code will reside because it will not be click...

What is the difference between demand paging and page replacement?

memory-management,operating-system,paging,page-replacement,demand-paging
From what I understand, demand paging is basically paging with swapping, so you can swap in a page when it is needed. But page replacement seems like more or less the same thing, where you bring in a page is needed and switching it with an existing page in physical...

Bound wait to solve race condition

algorithm,process,operating-system,synchronization,race-condition
I am trying to Give a race condition example , then write an algorithm to impose synchronization and write an algorithm that implement the Bounded wait solution?! I tried the case of when two admins A and B in the school receive 2 students to register them if they hit...

Doesn't fragmentation in FAT file system lead to space wastage?

memory-management,operating-system,computer-science,fragmentation,fat
The wikipedia for article for fragmentation states: In many cases, fragmentation leads to storage space being "wasted", and in that case the term also refers to the wasted space itself. For other systems (e.g. the FAT file system) the space used to store given data (e.g. files) is the same...

Why not use a ‘block table’ for file systems (in analogy to a page table)?

memory-management,operating-system,filesystems,virtual-memory
File system structure seems similar to memory management structure: Mapping non-contiguous physical frames to contiguous virtual memory Mapping non-contiguous physical disk blocks to contiguous file. Why not use a ‘block table’ for file systems (in analogy to a page table)?...

Not Used Recently (NUR) Page Replacement Algorithm [closed]

java,c++,c,operating-system
How to implement NUR (Not used recently page replacement algorithm) using any high level programming language (c, c++ or java)

What is a kernel stack used for?

process,operating-system,stack,kernel,context-switch
The following is a description I read of a context switch between process A and process B. I don't understand what a kernel stack is used for. There is suppose to be a per process kernel stack. And the description I am reading speaks of saving registers of A onto...

text section in process memory map

unix,process,operating-system,kernel
Normally, the process memory map consists of stack, text, data+bss and heap. The memory address is independent to other processes except text section. My question is about in text section, is there only child process could share the same text section with its parent process? or other processes could share...

Chrome under Windows 7 and 8 cannot connect to embedded Jetty 9.2.x over HTTPS

google-chrome,https,operating-system,restlet,embedded-jetty
We're using Jetty 9.2.x in the embedded mode in conjunction with Restlet 2.3.1 to develop our application sever. Recently we've enabled support for HTTPS, which utilises a certificated signed by a self-established CA. Everything seemed to be working correctly when connecting to this server from various web browsers under Linux...

Hardware Support for Paging

operating-system,paging
"The address consists of 16 bits, and the page size is 8KB. The page table thus consists of eight entries that are kept in fast registers." How do we get the total entries in the page table as 8? According to the calculation it should be 1. Total Entries in...

Bind multiple threads to multiple CPU?

multithreading,process,operating-system,scheduler
I have multiple threads that are accessing the same data and it is too painful to make them thread safe. Therefore, they are now forced to run only on one CPU core using CPU affinity and only one thread can be running at the same time. I was wondering if...

OS- How to properly print a spacebar in the video memory in a kernel?

c,keyboard,operating-system,keyboard-events
I know this the title is weird (I don't know how to explain it :| )but if u see my problem u will get it. I am making an os in assembly and c i have made a kernel and i have text input and output but i am having...

Not Getting keyboard input in c kernel protected mode

c,operating-system,protected-mode,keyboardinterrupt
I am making an OS in C and 32bit Assembly following James Molloy's tutorial till IRQs and PIT step and i am trying to get keyboard input i tried this code added to the tutorials' code but i am not able to get things right. Keyboard.c: #include "keyboard.h" #include "common.h"...

how delete a file completely from a Windows System

c#,c++,c,operating-system
I have tried to search but I didn't found any good answer to my query. I wanted to know how to delete a file completely from a Windows System, so that it cannot be recovered in any way. I know there are some software's available on the internet which delete...

Difference between switch & bus architecture?

architecture,operating-system
I was just going through a operating systems textbook but I got stuck at switch architecture . Please explain what it is and how it is different from bus architecture ?...

Implementing LRU with timestamp: How expensive is memory store and load?

performance,memory-management,operating-system,kernel,lru
I'm talking about LRU memory page replacement algorithm implement in C, NOT in Java or C++. According to the OS course notes: OK, so how do we actually implement a LRU? Idea 1): mark everything we touch with a timestamp. Whenever we need to evict a page, we select the...

How to on/off an electric bulb via computer's usb port using C language program

c,operating-system,kernel,hardware-interface
I want to write code in C language to switch on/off an electric bulb via USB port. USB port gives 5 volts, so I want that bulb can take power from computer's USB port. Is it possible?...

The job queue and the ready queue

operating-system,scheduling,scheduler
What is the difference between the job queue and the ready queue and are they mutually exclusive? The ready queue contains all the process stored in main memory, awaiting execution or simply all the processes that are ready to execute - which can be in the job queue? When a...

Calculating the size of a 2-level page table

memory,operating-system,paging,page-tables
So I have page sizes of 4kb, 32 bit address CPU and an implemented 2-level page table. I want to store 1081 pages, so I need: 1024 entries in the 2-nd level page-table 57 entries in another 2-nd level page table A top level page table holding 2 entries. Now,...

shuting down an OS without using API's

c,api,operating-system,shutdown
i was trying to add a shutdown feature to my home-made OS , but i don't really have such API yet . i was wondering how does the OS's terminates the power ? i'd be appreciate it if somebody could give me some guidelines for start .

How does the OS decide data that goes in each page?

operating-system,disk
I have a comma separated data file, lets assume each record is of fixed length. How does the OS(Linux) determine, which data parts are kept in one page in the hard disk? Does it simply look at the file, organize the records one after the other(sequentially) in one page? Is...

Processor Multi-threading

multithreading,operating-system,processor
If a program or application does not contain any threads; does the operating system automatically divide the job/process into multiple threads? Example: if an application performs a simple task of completing random calculations and this specific application does not explicitly create its own threads to perform this calculation. Will the...

Visually where is the Deadlock? Why? How to avoid/fix?

operating-system,mutex,semaphore
I am trying to understand and solve the following problem. The following program attempts to use a pair of semaphores t and s for mutual exclusion. Initially: s = 1, t = 0. Thread 1 Thread 2 -------- -------- 1. P(s); P(s); 2. V(s); V(s); 3. P(t); P(t); 4. V(t);...

Multi-level page tables

memory-management,operating-system,paging,cpu-architecture
An x86 with 32 bit addressing and 4K pages would need a page table with 2ˆ20 entries to map an entire address space. Since each page table entry is usually four bytes, this would make the page tables an impractical 4 megabytes long. As a result, paged architectures page...

How to open Windows Settings Pages from code in C#?

c#,windows,operating-system
How do I open Windows settings like the ones below from code in C#? I'm not trying to manipulate them, but to just open them for the user. Sorry, I don't even know the right keywords for this question. (Screenshots are in German.) Edit: (in addition to the answers) Search...

Doubly linked list of process control block in Operating Systems

operating-system,scheduling,doubly-linked-list,rtos
What is the reasoning behind maintaining doubly linked lists of PCB's(process control blocks) in an OS for scheduling. I have seen this mentioned multiple times for Real time operating systems. I would ideally go for a circular singly linked list , so that you could do a round robin and...

Switch to user space

assembly,x86,operating-system,kernel
this is part of code which demonstrates basic functions of os kernel. After flushing GTD and setting up IDT I want to switch to ring 3 run some int and context switch. However I cannot jump to user mode. I want to use trick with iret instruction. As far I...

modification of program counter is not privileged instruction. why?

operating-system,instructions,privilege,program-counter
why modifying program counter is not a privileged instruction ? program counter is stored in the PCB and that is in the kernel space. but modifying program counter is not privilege instruction ? why is that?

why shell uses 0 as success?

shell,operating-system
In C and many other languages, 0 means false and 1 ( or non-zero ) means true. In the shell 0 for the status of a process means success and non-zero means an error. Shell if statements essentially use 0 for true. Why did the writer of the first shell...

qemu request for a disc image

operating-system,qemu,xv6
I am trying to get qemu up and running with xv6 but I am having some trouble with compiling xv6. what are the types of disc images that qemu accepts. for instance does Qemu accept .ISO files? I tried loading FreeBSD but I am getting the error from QEMU that...

How is cache conscious B+tree stored?

database,caching,memory,operating-system,b-tree
I am new to database and wish to implement a cache conscious B+tree. A lot of reading suggest storing nodes and leaves as continuous memory. Is this assuming that when B+tree is created, nodes and leaves are stored in the heap, and then copied into disk by read write operation?...

How to translate these logical addresses into physical addresses?

memory-management,operating-system
Given that: Logical addresss space=64 bits Physical address space=32 bits Page size=4K How will the logical addresses 20, 4100 and 8300 be mapped to physical address for the following page table? ...

ImageMagick code in Python script

python,operating-system,imagemagick
I need to convert an image so as it only shows the color blue as a blob, is there any way I can run this code in a python script? Or how could I go about it? The following code does the job but I don't know how to link...

What happens when Binary Semaphore is Signalled twice? ie. s=1;wait(s); signal(s)signal(s); Does s becomes 0 or it remains 1?

operating-system,semaphore
What happens when Binary Semaphore is Signalled twice? i.e. Suppose s is binary semaphore variable with s=1 Now we do following-- wait(s),signal(s),signal(s) Does s becomes 0 or it remains 1?...

Why not to double number of registers for fast syscalls?

operating-system,cpu-architecture
We are facing two facts: 1. Syscalls are expensive. Program should save its state on stack, trap to kernel, which causes cache and TLB invalidation, etc etc. 2. With new technologies(like 14nm) we have plenty of space on chips. Why not to have two sets of registers and two TLBs?...

Random access alternative to named pipes

operating-system,filesystems
Is there a way to create a "file" (i.e. some point in the file system) that can then be opened by any program as a regular file, but reading/writing to it will go to a program instead of to disk? Named pipe seems to meet all the requirements, except it...

Will OS provide virtual address space?

operating-system,virtual-memory
This is an interview question. I am writing all the details the interviewer gave me. The question is:- A system has a memory of 1GB. A process requires only 1MB of memory. Assuming no other processes are running in memory, will the OS provide virtual address translation for this process...

Append file name to list comprehension

python-3.x,operating-system
Here is my code which finds .c files in directory. I want to append them to cfiles list comprehension. So I could access to them like cfiles[1], cfiles[2]... for files in os.listdir(input_arg): if files.endswith(".c"): cfiles= [((os.path.abspath(input_arg)+"/"+files))] This will just add first found item to cfiles. How should look the for...

When one thread blocks in C, why doesn't the entire process block

c,multithreading,process,operating-system,kernel
I'm in a course on operating systems and we're talking about threading. On Wikipedia here it says that for 1:N kernel threads: If one of the threads needs to execute an I/O request, the whole process is blocked and the threading advantage cannot be utilized However this got me thinking....

NSUserDefaults not working on Xcode beta with Watch OS2

swift,operating-system,nsuserdefaults,watchkit
I just installed the latest beta of Xcode to try Swift 2 and the improvements made to the Apple Watch development section. I'm actually having an hard time figuring out WHY this basic NSUserDefaults method to share informations between iOS and Watch OS2 isn't working. I followed this step-by-step tutorial...

Why do we need to install a C++ compiler? [closed]

c++,c,compilation,operating-system
I have heard that all the popular OSes (Windows, Linux, Mac OS X) are built from C++ or C. Why, then, do we need to install GCC or any C++ compiler? Shouldn't programs be compiled by the computer itself as these operating systems support C++ and C?

How do you programmatically reboot Ubuntu while logged in as a guest user?

linux,ubuntu,operating-system
I want to write a script that reboots the computer while logged in as a guest user. I know this is possible because the guest user can shutdown from the settings button in the top right corner. However, when I try run reboot from a script or terminal, I get...

reserved keywords like CON, PRN, NUL in URL in ASP.net MVC

asp.net-mvc,operating-system
I tried to hit URL with id as CON in ASP.net MVC. Routing routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional }// Parameter defaults ); Its giving following error 2015-04-29 08:25:22,325 [8] FATAL Myapplication.Global - Application ERROR...

What does a valid idle thread implementation look like?

operating-system
It is well known that a busy waiting is bad because it wastes CPU time. But what is done in modern operating systems to make the OS idle thread work well? Is it just a busy wait? If so, what is done to conserve power? What is the best approach?...

Stopping a process by sending SIGUSR1 and waking up by sending SIGUSR2

operating-system,ipc
How do I stop a process by sending SIGUSR1 and wake that up by sending SIGUSR2? Is it possible? Please help me out.

How my computer knows a char corresponds to which character?

fonts,operating-system
Does my OS load a font file which maps the UTF-8 codes to characters(the way to render it ) when I start up my computer? Since there are a lot of different fonts, the font files will consume a lot of memory? Or the font files are stored in hard-disk...

Android - What is the difference between a foreground and background service?

android,operating-system
From android.com it says that a foreground service is something that the user is aware of and a foreground service is unlikely to be killed if memory is needed. It says a background service may be killed if memory is needed. Is this the only difference or can one service...