Implementating command interpreter in kernel [closed] - operating-system

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I was reading operating system concepts by Silberschatz and i came across
"Some operating systems include the command interpreter in the kernel"
statement.
I cannot understand how such an arrangement will be implemented. also if you cn give some examples of os which provide such arrangement.
Thank you for taking time to help.

Some operating systems do this, like vxWorks. It's just taking the shell itself, and packing it into the kernel. If you can do something in user space (ie: shell as a user space application), you can do it (with some difficulty) in the kernel. The usual caveats apply, such as not being able to link user space libraries into kernel code, etc.
It's easy, on Linux for example, to write directly to a PTY from a kernel module. You can just as easily get the stdin for a process by hijacking system calls, among other methods. Now you have your I/O mechanisms, and just need a parser to handle all the internal logic.

Related

Do libraries exist for building operating systems? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I'm curious about this. I assume the building of operating systems is a monumental task, especially with all the back end stuff that an os involves. I was curious if I wanted to rework the front end of an operating system, but take advantage of existing architecture/backend, what would be the best resources to use? Also, can you guys point to any examples of well designed front ends of operating systems that aren't really mainstream? It seems like everyone uses pretty large well known OS.
Yes, you can. But like you said, it's a huge, huge task. I am not sure of windows or mac, but in Linux you have options to do so. You can download a Kernel from https://www.kernel.org/ and write applications around it.
If your goal is to make applications around the kernel, then look at linux application development resources. Check out linux desktop environments https://en.wikipedia.org/wiki/Desktop_environment#History_and_common_use to see which one is good.

Difference between Privileged mode ,kernel mode and super user mode [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
In the MCQ of UGC net examinations computer science i found these answer options see the attachmentQuestions number 57 confused with the modes
A processor can execute in various modes as a protection mechanism. Every processor I am aware of has at least User (lowest protection) and Kernel (highest protection) modes. Some processors have additional modes in between those two. For example, the VAX processor has Supervisor Mode (where command interpreters reside) and Executive Mode (where the record management services reside).
A signal handler executes in User Mode. You should go right to that.
Kernel mode is the most possible alternative answer. However, signal handlers do not execute in kernel mode.If they did, users could write programs that could compromise security and system integrity.
Privileged Mode and Superuser Mode are fillers; pure inventions that cannot possibly be correct.

What are the benefits of using a tool like Chef vs. using a makefile/shell script for deployment? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have heard good things about Chef, was curious about all of the benefits before I devote time to learning a new tool. Not looking to turn this into opinion thread, looking for a list of additional features it has over makefile/shell script.
Chef, and Ansible/Puppet/Salt too (collectively called CAPS), are all based on the structure of "describe the desired state of the system and the tool will make it happen".
A script or Makefile is generally a procedural system, run this, then run that, etc. That means you need to keep a mental model of system from each step to the next, and if that ever deviates from the real system (ex, a directory you are trying to set the owner of doesn't exist) your script usually breaks.
With some stuff this is easy, like yum/apt-get install as they are internally idempotent, you can run them every time and if the package is already installed, it just does nothing.
CAPS systems take that principle (idempotence) and apply it to all management tasks. This has for the most part resulted in less brittle configuration management as you only need to tell the tool what the end result should look like and it will take care of figuring out the delta from the current state.

Should I write a cross-platform service in Go? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm looking into writing a cross-platform (Windows/Debian/Darwin/Red Hat) service and am comparing language options. I really appreciate Go's cross-platform threading abilities and easy cross-compiling, but I want to make sure I'll be able to easily reach any native (eg. Windows Service) APIs when needed.
What sort of things should I be considering to drive my language decision?
Go has full support for calling into arbitrary Win32 API's via its core syscall package.
While calling out to raw Win32 via syscall is not exactly pretty to write (mostly because you're crossing the managed/unmanaged boundary, and back) and has no support from the compiler (akin to, say, that of Delphi), this works just OK, and generation of wrapper functions for such API calls can be automated—the Go core packages use this facility for themselves, other popular examples include the odbc package.
Note that there already exists winsvc—a library which interfaces Go with the Windows SCM and event log.
Also look at service which provides unified API for turning your program into a daemon/service using platform-native tools (it uses winsvc on Windows, IIRC).

What is the difference between chroot command and chroot() system call [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Can anyone help in making me understand, what's the real difference between chroot command and chroot() system call.
A system call is a means for a program to interact with the kernel.
A unix tool command is either a small stand alone program (in this case) or else a shell built in (in some other cases). This allows a user or a script to perform operations without having to provide low level program code for doing so.
Where a command and a system call have the same name, typically the command provides a way to accomplish the functionality of the system call, or something similar.
System calls are documented in section 2 of the manual, while commands may be elsewhere such as page 8. So if you type
man 2 chroot you will get the documentation for the system call
and if you type
man 8 chroot (or in many cases simply fail to specify a page) you will get the documentation for the command.
if you type
which chroot you will find the location of the executable which implements the command, assuming it is in your search path as it usually would be.