Questions tagged [architecture]

General questions about (UNIX) OS architecture

Questions about generic terms and properties of UNIX operating systems and relations among the different parts that form an OS (kernel, user space) and the hardware that it runs on.

146 questions
132
votes
7 answers

Why do we need to fork to create new processes?

In Unix whenever we want to create a new process, we fork the current process, creating a new child process which is exactly the same as the parent process; then we do an exec system call to replace all the data from the parent process with that…
sarthak
  • 1,442
  • 2
  • 10
  • 8
117
votes
2 answers

How do keyboard input and text output work?

Suppose I press the A key in a text editor and this inserts the character a in the document and displays it on the screen. I know the editor application isn't directly communicating with the hardware (there's a kernel and stuff in between), so what…
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
88
votes
1 answer

Easy command line method to determine specific ARM architecture string?

I'm trying to write a script which will determine actions based on the architecture of the machine. I already use uname -m to gather the architecture line, however I do not know how many ARM architectures there are, nor do I know whether one is…
Thomas Ward
  • 2,600
  • 2
  • 18
  • 31
82
votes
3 answers

Why doesn't cp have a progress bar like wget?

Please note that I don't ask how. I already know options like pv and rsync -P. I want to ask why doesn't cp implement a progress bar, at least as a flag ?
Lamnk
  • 1,450
  • 1
  • 11
  • 10
69
votes
6 answers

Will a Linux executable compiled on one "flavor" of Linux run on a different one?

Will the executable of a small, extremely simple program, such as the one shown below, that is compiled on one flavor of Linux run on a different flavor? Or would it need to be recompiled? Does machine architecture matter in a case such as this? int…
JCDeen
  • 765
  • 1
  • 5
  • 9
54
votes
3 answers

A layman's explanation for "Everything is a file" — what differs from Windows?

I know that "Everything is a file" means that even devices have their filename and path in Unix and Unix-like systems, and that this allows for common tools to be used on a variety of resources regardless of their nature. But I can't contrast that…
Mohamed Ahmed
  • 1,363
  • 6
  • 17
  • 23
53
votes
3 answers

Why is rm allowed to delete a file under ownership of a different user?

From the post Why can rm remove read-only files? I understand that rm just needs write permission on directory to remove the file. But I find it hard to digest the behaviour where we can easily delete a file who owner and group different. I tried…
mtk
  • 26,802
  • 35
  • 91
  • 130
51
votes
8 answers

On Unix systems, why do we have to explicitly `open()` and `close()` files to be able to `read()` or `write()` them?

Why do open() and close() exist in the Unix filesystem design? Couldn't the OS just detect the first time read() or write() was called and do whatever open() would normally do?
user5977637
  • 645
  • 5
  • 7
47
votes
1 answer

What are software and hardware interrupts, and how are they processed?

I am not sure if I understand the concept of hardware and software interrupts. If I understand correctly, the purpose of a hardware interrupt is to get some attention of the CPU, part of implementing CPU multitasking. Then what issues a hardware…
Tim
  • 98,580
  • 191
  • 570
  • 977
43
votes
15 answers

Object-oriented shell for *nix

Preface: I love bash and have no intention of starting any sort of argument or holy-war, and hopefully this is not an extremely naive question. This question is somewhat related to this post on superuser, but I don't think the OP really knew what he…
Robert S Ciaccio
  • 658
  • 1
  • 6
  • 11
41
votes
3 answers

How signals work internally?

In general, to kill processes we generate signals like SIGKILL,SIGTSTP etc. But how is it known who ordered that particular signal, who has sent it to a particular process, and in general how do signals perform their operations? How do signals…
Varun Chhangani
  • 581
  • 2
  • 6
  • 7
37
votes
2 answers

How does a Linux terminal work?

If you fire up a terminal and call an executable (assuming one that's line oriented for simplicity) you get a reply to the command from the executable. How does this get printed to you (the user)? Does the terminal do something like pexpect? (poll…
mike
  • 473
  • 1
  • 5
  • 6
37
votes
6 answers

How does a unix or linux system work?

I would like to know how the OS works in a nutshell: The basic components it's built upon How those components work together What makes unix UNIX What makes it so different from other OSs like Windows
Sander Versluys
  • 489
  • 1
  • 5
  • 6
36
votes
2 answers

Interruption of system calls when a signal is caught

From reading the man pages on the read() and write() calls it appears that these calls get interrupted by signals regardless of whether they have to block or not. In particular, assume a process establishes a handler for some signal. a device is…
darbehdar
  • 847
  • 2
  • 8
  • 9
31
votes
2 answers

dpkg: error: cannot remove architecture 'i386' currently in use by the database

I used this command to add i386 arch: sudo dpkg --add-architecture i386 And then immediately after without installing any packages I tried to remove the i386 arch like so: sudo dpkg --remove-architecture i386 And i got the error: dpkg: error:…
olfek
  • 711
  • 3
  • 7
  • 20
1
2 3
9 10