What is Device Tree?Advantages & Disadvantages? [closed] - linux

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 9 years ago.
Improve this question
what is Device Tree in Linux ?
what is the Advantages and Disadvantages of Device Tree?
If anyone know Device Tree in details ,Please help answering above questions .

The device tree is a description of hardware components in a system, here is the list of device tree files in linux for the arm arch:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts?id=refs/tags/v3.10
From here:
http://devicetree.org/Device_Tree_Usage
The device tree is a simple tree structure of nodes and properties.
Properties are key-value pairs, and node may contain both properties
and child nodes
The nodes of the tree describe parameters that the linux kernel, or other software systems like u-boot, uses to init hardware.
Some of the advantages include:
Simple to change the configuration of the system without having to recompile any source code.
Can easily add support for new hardware (for example if you have a new rev of a board which only changes some minor components, you may be able to run the same software load as previous revs of the board, with only small changes to the .dts file on the new board...)
Can reuse existing .dts files with include statements, and can override previously defined functionality. For example if you include a dtsi (device tree include file) that defines a hardware component, but has it disabled, then you can just create a new node in your higher level dts file that does nothing but enable that component.
They (can) provide easy to read and understand descriptions of the hardware, and can give hardware components descriptive names.
Some of the disadvantages includes:
Not so easy to write a new .dts file, because it requires very detailed knowledge of the hardware.
Even if you know all the details of the hardware it may be hard to figure out the exact syntax to use to express what you want to do... (i.e. the documentation is lacking in many respects)
For me writing a .dts file is almost 100% trial and error, pulling examples from other .dts files and see what it does and if it gets closer to what I want... Often times the examples are all I have to work with, and there isn't much in the way of an explanation of what is going on.

Related

Using the Linux kernel in my operating system [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
PREFACE
I tried to put as much effort and work into this question as I reasonably could, so if you could at least read it through, I would highly appreciate it; I, also, have tried researching this question, but I never seemed to find anything useful, in terms of anything that directly answered my question; I do not know if this is right place for this question, even though it is related to programming, it is more related to operating system development and the Linux kernel, and if there is a better place for this question that I am unaware of, please move it there; feel free to do whatever, edit the question if need be, I do not care, I just need an answer to this question, because this is stressing me out.
The following is some background on why I am asking this question; if you are uninterested, and if you just want to see what I am asking, then skip to the 'MY QUESTION' label; I thought that I would put this is here, so that anyone who is reading this question would know why I am asking this question.
BACKGROUND
I have recently begun setting up an operating system development project; and after I get some things ready, it will be only me working on it, as of right now, and I plan to write the whole thing (yes, I know it will take a whole lot of work, but I can try, right? :p), including the bootstrapping, the CLI, and most of what is necessary to have to either my own kernel or Linux kernel function; GUI and much more; granted, eventually I may end up having a team, but that is for the future.
MY QUESTION
My question, which is actually consists of three parts, and I narrowed them down to specifically those thee things, which are the following:
(1) If I were to build everything else, and use the Linux kernel as-is, and if I were to not tie the other parts of the system into the kernel, but use the kernel for I/O and system calls, would I be violating the GPL in any way, and would I think need to open source the rest of my code?
(2) If I were to only use the kernel for I/O and for system calls, but not have the code that I wrote actually interface with any kernel functions, would that still be considered linking?
(3) If I were to do the above, would that be considered a derived work, when I wrote everything else, but used Linux as the system's kernel?
All these legal issues are making my head spin and extremely confusing to me.
No
No
No
The linux kernel considers the system calls a boundary, and code that communicates with the kernel via system calls is not covered by the licensing of the kernel. So, the user space code you write is not a derivative work of the kernel.
There's also a set of header files provided by the kernel, collectively named the UAPI headers which you can use without having your code become a derivative work
This is covered at https://www.kernel.org/doc/html/v4.17/process/license-rules.html and https://github.com/torvalds/linux/blob/master/LICENSES/exceptions/Linux-syscall-note
If you need legal advice though, contact a lawyer.

How are linux filesystems created? [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 5 years ago.
Improve this question
i've been studying the linux operating system for a while now, i understand what file systems are but i'm curious as to how they're made. Is it possible for a programmer to create their own custom made file system in linux, is it possible to combine multiple file systems together and how much control do we have over a file system? Thanks.
Also does anyone know any online sources or books that talk about linux file systems
Certainly a programmer can create a file system, everyone can, you just have to use the command to do that. In addition to that a programmer theoretically can implement logic that creates what you probably refer to as "custom made filesystem", just as a programmer can change, remove or add anything he wants from any part of the system he uses. It is questionable though if many programmers actually are able to create a working and usable file system from scratch, since that is quite a complex thing to do.
Combining multiple filesystems is certainly possible, but maybe you should define in more detail what you actually ask by that. You certainly can use multiple filesystems inside a single system by simply mounting them. You can mount one filesystem inside another. You can even use a loopback device to store a whole filesystem inside a file contained in another filesystem. What you can not do is somehow take two separate file systems, hold a magic wand over them and declare them as one from now on. Well, actually you can do that but it won't work as expected ;-)
About the last question, how much control we have... well, difficult to answer without you giving any metric to do so... We certainly can configure a filesystem, we can use it and its content. We can even destroy or damage it, mount it, check it, examine it, monitor it, repair it, create it, ... I personally would indeed call that some amount of "control" we have over filesystems.

Can some one explain the architecture of GO lang, Is it faster compared to Nodejs & if so what makes it faster [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 8 years ago.
Improve this question
Can some one explain the architecture of GO lang, Is it faster compared to Nodejs & if so what makes it faster and Go is developed using C/C++, So, does GO beats out in performance when compared to C/C++ and is the only difference between C/C++ & Go is all about more functions which makes developer easy to code using GO?
Note that Go 1.5 will feature its compiler, assembler, linker, and runtime written entirely in Go.
The goal is to have Go written entirely in Go and to rid the codebase of any C code. The only exception to the C code is for Cgo.
(See Go 1.5 Bootstrap plan)
The speed is more about about the native code generated, and the simplicity of the language (no genericity means less dynamic data to keep track of)
Go hasn't been always fast: "Why is go language so slow?".
It improves incrementally, notably on the garbage collection side, and stack management side.
Uvelichitel mentions below x64 Ubuntu : Intel® Q6600® one core -- Computer Language Benchmarks Game
As for "Golang Architecture", this doesn't really apply here (as detailed in this answer):
Go has no VM like the Java JVM. It compiles straight to metal like c/c++.
The Go 1.3 Linker overhaul mentions:
The current linker performs two separable tasks.
First, it translates an input stream of pseudo-instructions into executable code and data blocks, along with a list of relocations.
Second, it deletes dead code, merges what’s left into a single image, resolves relocations, and generates a few whole-program data structures such as the runtime symbol table.

Are there any good dependency management tools that aren't language specific? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for dependency management tool that isn't specific to Java or any other language.
We use SystemVerilog, a hardware description language, to create stand-alone modules. We tag releases of those modules at various milestones. Higher level designs frequently pull in other modules using Subversion tags.
We attempted to use Subversion externals to automate things, so that when you check out a module you get its dependencies as well. But by the time you get to the system level, there are so many nested externals that it takes an hour to run svn update. Clearly that approach isn't working.
Basically, I want to be able to say, "My module depends on this version of module A, this version of module B, and this version of module C." The tool would do the work of checking out the dependencies, checking out the dependencies of the dependencies, and making sure that there are no conflicting dependencies (e.g. two versions of the same module).
Are there any tools out there that work well with an arbitrary language and Subversion?
I'm not feeling the pain of dependency tracking that you are describing, which means I probably don't fully understand your problem.
One approach is to keep all versions of modules in separate files in the same library. For example, you can have adder_0_0.sv for the first version of a full adder HDL module, which would describe a module called adder_0. If you find a bug in the module, you can create a file called adder_0_1.sv also describing adder_0. You will be able to use adder_0_1.sv instead of adder_0_0.sv. If you want to change the interface, either by adding or removing ports, or changing the semantics of the ports, then you can create a file called adder_1_0.sv describing a module called adder_1. Note that adder_0 and adder_1 cannot be used interchangeably.
The philosophy behind this approach is that all of these files are write once. You just keep adding new files to your library. Any project that uses this library just checks out the whole library and uses whatever files they want. Dependency management is only as complicated as putting the right filenames in the right project description file for whatever simulation or synthesis tool you use. No special dependency management tool is required. The fewer separate libraries you have, the easier it will be to manage them.
Once I had a tool flow that looked for source files in two places. First, it looked in the local directory. Second, it looked in the "master" area which was shared, read-only directory with all the code checked out for everyone to use. If I needed to modify the code, I only checked out the module I needed. Then, the script would pick up that module from my local workspace. The rest of the code it read from the master area. This was all custom scripting, no off the shelf tools, but it wasn't too hard.
If you get this working, you might be able to go further and compile the master area code into shared, master libraries. This could really speed up compile time.

How do viruses function from a programming point of view? [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 7 years ago.
Improve this question
I have always been fascinated by computer viruses. For years I have tired to learn about them, but due to their nature people are unwilling to give many details.
For what it is worth I'm not a hacker and am not trying to build a virus.
If anyone is willing to answer this question I want to know what makes a virus a virus and how they are different from spyware.
How can they install themselves onto a computer without you noticing?
And how do worms work? How can a program replicate and move on its own? Does it contain its source code within it? And does it interface with other programs or just assess the hardware directly to spread ?
EDIT: What language would they be written in? Would you use assembly/C++ types of languages or create them as scripts in lua?
Well, a worm is simply a self-replicating piece of software. Imagine a program that copies its executeable over some link to another computer and launches it there. That's not that much magic.
A virus is simply a worm which infects other executeables, i.e. it does not replicate its own image, but it "backpacks" it to a different application's image and uses that application's execution flow to get initiated.
The user does not notice anything if there are no side-effects, and no UI interaction.
If the user is a technically more competent than the average end-user, this is very hard to achieve. Some malwares host the target system in a virtual machine so you as the user have a hard time to see anything suspicious as long as you don't figure you look at a virtual machine. Like Neo, awaking from the Matrix.
As there is no limit to what you can implement in what language, there is no language of choice. Naturally, a low-level and natively-compiled language is more versatile to do what a virus/worm must do to stay low-profile. However, there are worms and viruses written in assembly language, Basic, C, Delphi, JavaScript, whatever -- there is nothing you can not imagine here.
Spyware has similar requirements, but different goals. While a virus, and a worm, usually spreads around, either for no reason or to drop some kind of payload at some point, spyware wants to either "phone home" or open the target system so it can be attacked, i.e. inspected, easier, usually in order to get hold of a victim's data that is secret, personal, or otherwise interesting.
Hope this quick answer helps a bit. You can google more details easily at bing :)

Resources