operating-system

IPC in Message-Passing Systems - Direct Communication

ぃ、小莉子 提交于 2021-01-29 17:25:23
问题 According to the book 'operating systems concepts', it says: With direct communication, each process that wants to communicate must explicitly name the recipient or sender of the communication. This scheme exhibits symmetry in addressing. In this scheme, the send and receive primitives are defined as: Send(P, message): Send a message to process P receive (Q, message)-Receive a message from process Q. In asymmetry only the sender names the recipient; the recipient is not required to name the

what is the Java equivalent of Pythons's subprocess shell=True property?

↘锁芯ラ 提交于 2021-01-29 17:14:38
问题 I've been using python for a long time. python's system and subprocess methods can take shell=True attibute to spawn an intermediate process setting up env vars. before the command runs. I've be using Java back and forth and using Runtime.exec() to execute shell command. Runtime rt = Runtime.getRuntime(); Process process; String line; try { process = rt.exec(command); process.waitFor(); int exitStatus = process.exitValue(); } I find difficulty to run some commands in java with success like

How to programmatically set Desktop Background to solid colors in os x?

血红的双手。 提交于 2021-01-29 09:18:43
问题 How to set a solid color as background in os x desktops programmatically? Have found the way to change it programmatically using the image. [[NSWorkspace sharedWorkspace]setDesktopImageURL:url forScreen:screen options:nil error:&error]; URL - image file url, screen - nsscreen object, error - nserror object. Would like to avoid the use of an external resource such as image files. Please help 回答1: fwiw I've often wanted to set my bg to white but that specific color is missing, the code below

Which part of the computer manages cache replacement?

人走茶凉 提交于 2021-01-29 08:20:40
问题 I haven't found a clear answer: does the control unit itself fetch pre-defined instructions to execute a cache eviction, or does the operating system intervene? If so, how? 回答1: Which part of the computer manages cache replacement? Typically; a cache manages cache replacement itself (its not done by a separate part). There are many types of caches where some are implemented by software (DNS cache, web page cache, file data cache) and some are implemented in hardware (instruction caches, data

User-level threads for threading

半世苍凉 提交于 2021-01-29 03:11:04
问题 From the Tanenbaum OS book it is mentioned the following: "in user level threads, if a thread starts running, no other thread in that process will ever run unless the first thread voluntarily gives up the CPU". That means threads are going to run one after the other (sequently) not in parallel. So what is the advantage of the user-level threads? 回答1: There are two concepts of multitasking in a single process multiple thread environment. A single thread execute in time slice of the process.

What are techniques for determining running OS in assembly language at runtime?

一个人想着一个人 提交于 2021-01-28 09:18:14
问题 What are techniques for determining running OS in assembly language at runtime? If there are direct ways to determine this, that'd be awesome. I was also thinking of how there are tricks in Javascript to determine what browser you're running in... Are there similar techniques for determining OS or even CPU arch in a low level language like Intel assembly? Thanks, Chenz 回答1: CPU architecture will be next-to-impossible to determine. Machine code differs greatly between CPU architectures, and so

Weird behavior when writing to 0xB8000 / corrupted pointer

扶醉桌前 提交于 2021-01-28 08:12:12
问题 I'm currently developing an OS kernel from scratch. I want to use a function to write characters on the screen , using the 0xB8000 memory location. the problem is the following : I use : void video_write(const unsigned char *string , char color ){ unsigned char *p = (unsigned char*) string ; char *c = (char*) (VIDEO_MEMORY ); //VIDEO_MEMORY is 0XB8000 while(*p != '\0') { *c = p[0] ; c++ ; *c = color ; c++ ; p++ ; } } void clear_screen(){ char *c = (char*) VIDEO_MEMORY ; int i = 0 ; for(i ; i

How to add the two variations of the open syscall in OS161?

℡╲_俬逩灬. 提交于 2021-01-28 07:52:23
问题 From the man pages of OS161 : Synopsis #include <unistd.h> #include <fcntl.h> int open(const char *filename, int flags); int open(const char *filename, int flags, mode_t mode); How the standard c library function open is defined: int open(const char *filename, int flags, ...); The declaration: /* * Definition for each syscall. * All we do is load the syscall number into v0, the register the * kernel expects to find it in, and jump to the shared syscall code. * (Note that the addiu instruction

How to check whether specific software is installed or not using javascript in client system?

江枫思渺然 提交于 2021-01-28 03:02:21
问题 Is it possible to detect, whether client system has specific windows application installed or not using Javascript? I developed one website, which would have to detect the application, which was developed by us only. But I want to let you know, the website name and windows application names are different. I mean consider my web application name is X and windows application name is Y not like same as Skype webapplication and Skype windows application Consider Skype, it has web application as

Limiting the heap area's Virtual address range

时光总嘲笑我的痴心妄想 提交于 2021-01-28 02:06:12
问题 I need to do some brute-force searching in process VA space for my study and hence would like limit my heap area's virtual address range. OS course told me that heap is anywhere between data and stack pages. So I want to shrink my process VA range by doing the following: Have a custom linker script that gave start and end of data somewhere very high in address range (0x7f45f88a6000) Tweak fs/binfmt_elf.c to have stack top as (0x8f45f88a6000) instead of randomly picking. Assume my program uses