12 votes
Accepted

What is the real advantage of Google's new Fuchsia operating system kernel?

From what I understand you are asking what are the technical benefits of zircon over linux? First of all zircon is a micro kernel as opposed to the linux monolithic kernel. So lets look at some of ...
Oxygen's user avatar
  • 136
7 votes

If I write code in machine language, then I have access to the CPU in both modes (user and kernel), since the OS is bypassed, correct?

No. The Operating System is going to use context switching and virtual memory to hide the fact that there are multiple processes running on the computer. Native code does not mean you have full ...
Yuxuan Chen's user avatar
6 votes

What is a file?

According to Wikipedia, a computer file is simply a resource for storing information. The term appears to have originated in the punch card era, where a computer program was literally stored in a file ...
phyrfox's user avatar
  • 171
5 votes
Accepted

Question about Context Switching

What I think is meant by "kernel registers" in this context is any values that are stored in registers within the kernel itself. Note: In what follows, I'm going to talk about what happens ...
Pseudonym's user avatar
  • 22.1k
4 votes

how applications send tcp data to internet?

Applications don't deal with TCP packets at all. The operating system presents an interface somewhat similar to the file system and the application just writes data to that interface. The OS deals ...
David Richerby's user avatar
4 votes
Accepted

Why do we try to maximize Lagrangian in SVMs?

I think the answer to this deals with convex functions and duality. $$L(w, b, \alpha) = \frac{1}{2}\|w\|^2 + \sum_i α_i(y_i(w \bullet x+b)-1).$$ When you minimize this, you are minimizing it over $...
MadhavanRP's user avatar
4 votes

Why doesn't everyone use microkernel-based operating systems?

Yes, you use microkernel operating systems. If you use a modern Intel CPU, it includes a copy of Minix which runs on a separate processor that is embedded in the processor that you think you have. ...
Pseudonym's user avatar
  • 22.1k
4 votes

How are kernels (and operating systems in general) written in C?

There's a lot to unpack here, but I'll try to keep it as Computer Science as I can. Am I right in thinking that fork, malloc, etc. are wrapper methods that call the Kernel? Yes and no, respectively. ...
Pseudonym's user avatar
  • 22.1k
3 votes
Accepted

A microkernel fully hardcoded in hardware?

The key search terms here are FPGA and ASIC, since at this point the OS is no longer running on instructions executed by a CPU in the conventional sense. Here is a relevant result I found with a ...
Aaron Rotenberg's user avatar
3 votes
Accepted

Is it possible for a syscall to pack together different places in memory?

No, that isn't possible in general, because the page tables work at a page granularity. If the length of every buffer is an exact multiple of the page table size, and every buffer starts at a page ...
D.W.'s user avatar
  • 159k
3 votes
Accepted

Can User Level Thread read/write Kernel thread?

No. In most operating systems, kernel memory is protected using virtual memory mechanisms, so a user process cannot read or write to kernel memory. A user thread is part of a user process, and has ...
D.W.'s user avatar
  • 159k
3 votes
Accepted

Paging only for user code. What about kernel code?

Other than the fact that kernels tend to be small, as Yuval points out, you should also consider that they are often not relocatable code (in fact, address binding for kernels is done at compile-time) ...
Acsor's user avatar
  • 342
3 votes
Accepted

How were operating systems even made?

There is some great mysticism around Operating Systems. They are sometimes treated like this dark wizardry that only a handful of the initiated are allowed to understand. (Compilers are treated like ...
Jörg W Mittag's user avatar
3 votes

Isn't a small monolithic kernel a micro-kernel, and a big micro-kernal a monolithic kernel?

The distinction between monolithic kernels and microkernels has nothing to do with the size. In a monolithic kernel, all services are provided by a single piece of code running in a single, flat, ...
Jörg W Mittag's user avatar
3 votes

OS: Why is it necessary to have hardware support for implementing Preemptive Scheduling Strategies?

A preemptive scheduler must stop a program that is looping and not calling any operating system function. The program is not triggering any fault as division by zero. We are assuming that the ...
Christian Gingras's user avatar
3 votes

How are kernels (and operating systems in general) written in C?

Today, you can definitely write an OS in C because you have compilers readily available on some OSes. You just have to decide with what executable format you are going to go and then parse it from a ...
user123's user avatar
  • 1,112
3 votes
Accepted

(reference) Where can I learn more about I/O operations in OS?

It is pretty complex because there are several layers between the actual hard-disk and the software implementation of sockets. In today's x86 computers, the actual hard-disk is read using the Intel's ...
user123's user avatar
  • 1,112
3 votes
Accepted

What happens if there is context switch while executing system call?

If the kernel decides to do a context switch, it's in response to some event which caused the processor to enter kernel mode. This can be either a system call or an interrupt (which can be a timer ...
Gilles 'SO- stop being evil''s user avatar
3 votes
Accepted

How does caching, paging, virtual memory, and OS all tie together for UNIX copy-on-write?

It seems like your understanding of the matter is pretty good. You are just missing one tiny trick: Make the pages read-only. When the OS forks the process, it maps ...
Jörg W Mittag's user avatar
2 votes
Accepted

Are process-safe mutexes shared between OSes?

For most implementations of a mutex it won't work, but in principle it depends on how the mutex is implemented. If the mutex was implemented using files, perhaps it could be made to work. Usually ...
D.W.'s user avatar
  • 159k
2 votes

Are Kernel Codes (which are written in C) compiled during boot time?

MacOS does a very, very small portion of this: During boot time, it determines which exact processor model is used by your computer, and then for a very small number of important functions, processor ...
gnasher729's user avatar
2 votes
Accepted

Are Kernel Codes (which are written in C) compiled during boot time?

Usually, everything is compiled in advance: the kernel and userland applications. Roughly, the kernel is written in a special place on the disk (or other permanent memory), which the hardware will ...
chi's user avatar
  • 14.6k
2 votes

In a kernel, what are "global constructors"?

The link you provided has a clear definition: This tutorial discusses how to correctly invoke global constructors, such as those on global C++ objects. These are supposed to have run before your ...
Cort Ammon's user avatar
  • 3,351
2 votes

What is a file?

I think of a file as a sequence of bytes. Even after it loses its name (usually caused by a call to rm, which unlinks it), it still exists on the disk until its chunks get overwritten by other stuff. ...
ncmathsadist's user avatar
2 votes
Accepted

Does FreeRTOS replace linux or run ontop?

As per ghellquist, in product FreeRTOS is designed to run directly on hardware, it is the kernel, it doesn't run on a kernel. What may be confusing is that there are also Windows and Linux ports of ...
Richard's user avatar
  • 136
2 votes

Why doesn't everyone use distributed operating systems?

I followed your link to the “Inferno” Wikipedia page. And there it says this OS is maintained by some group as “open source”. There are two problems: The group that maintains it doesn’t even have a ...
gnasher729's user avatar
2 votes

Why doesn't everyone use distributed operating systems?

This is part of an answer. Others will probably be able to add other points. A chess platform has to do a limited number of things, while an OS has to be able to do everything that OSes do, which is ...
Mars's user avatar
  • 716
2 votes
Accepted

How can the initial "booting" state of a computer be different at different time points?

Can anything change in a computer without the user modifying something, also while not having internet connection? Yes, definitely - computers update their own states all the time, and some of these ...
gandalf61's user avatar
  • 1,589
2 votes

Why do operating systems freeze?

A "system freeze" is normally due to the system running out of some resource and spending it's limited resources left trying frantically to fix up the mess. I.e., too much CPU load, has no processing ...
vonbrand's user avatar
  • 14k
2 votes

How could i create a multi-threading system in a kernel?

In a multiprocessing system the other cores of the CPU are initiated with boot code like UEFI or legacy bootloader just like the first core of the computer. The CPU is manufactured to use a "core ...
user123's user avatar
  • 1,112

Only top scored, non community-wiki answers of a minimum length are eligible