This a certainly a dumb question, but when I look at the sources of the linux kernel of raspberry pi (here : https://github.com/raspberrypi/linux), this is not the same as the root organisation (that you can find here : http://labor-liber.org/en/gnu-linux/introduction/tree). However, there are some similarities (ex : usr repository).
Do someone know why?
Thank you!
Kernel sources are files for build the kernel. Usually, these files are located in some directory. After building (and installing) sources can be safetly cleaned.
Root directory is the top-level directory for working OS.
Most of subdirectory names common between between kernel sources and root directory are just accidental coincidence.
First link only contains the kernel source code; which you need to compile and then you can replace the kernel image and modules on the target.
While the second link shows the filesystem tree; it means how the files and directories are organised in the linux.
In some cases (depend upon the type of flashed OS ) you can see your kernel source code (which you have mentioned in the first link) in your running OS as well inside the /usr/src/<kerne_path> directory.
Related
I'm creating images for iMX chipsets and had downloaded the sources from NXP, and then created a core-image-minimal using Yocto. I then proceeded to sucessfully boot the image in a board.
After that, my interest was to apply the EVL project on an image. I did the following:
Download the sources from EVL Core. Those sources consist of a Kernel with EVL on top of it.
Created a workspace folder using devtool, and added the folder linux-imx, which contains the code for the kernel.
Completely replaced the contents of the folder for those of EVL. The rest of Yocto files remained unchanged.
Rebuilt the image and flashed it.
However, when booting, I get the following message:
Starting kernel ...
E/TC:0 0 dt_find_ocram_tz_addr:71 Cannot find fsl,optee-lpm-sram node in the dev ice tree
E/TC:0 0 Panic at core/arch/arm/plat-imx/imx_ocram.c:73 <dt_find_ocram_tz_addr>
E/TC:0 0 Call stack:
E/TC:0 0 0x14005411
I checked the EVL kernel code, and in arch/arm it contains no folder named plat-imx. This is rather confusing, since the problem appears in a line of code that doesn't exist in my workspace folder.
I tried checking the defconfig files in order to see where Yocto was taking the kernel code from, but couldn't find anything meaningful.
Any help is greatly appreciated.
Thanks in advance
As said in the comments, the problem was the following:
I couldn't find the folder plat-imx because it was not in the Kernel folder, but rather in the OP-TEE folder.
OP-TEE, which is a safety environment, runs before the boot checking the device tree and updating some memory addresses based on that.
Since the device tree had changed, he was now unable to find some elements and therefore it crashed before boot.
After adding some missing files to the DTS folder, the Bootloader worked correctly. Other problems during boot due to the kernel change appear remain to be solved.
I am working on ZedBoard(having Zync series SoC from Xilinx) and want to create a device tree for the embedded linux which i am planning to boot on this Zedboard. I followed the two links
http://xillybus.com/tutorials/device-tree-zynq-1
http://www.wiki.xilinx.com/Build+Device+Tree+Blob
They both gave me insight of device tree.
Now I have two options:
I got one prebuilt device tree .dts file for the Zedboard. So, can I use this directly without changing anything and only add mine needed drivers in this and it will work?
or
Should i start from scratch and generate mine own device tree .dts file.
What i want to ask/confirm that: device tree(.dts) file is not project specific and the content of .dts file will be unique for the particular board(which is in our case is ZedBoard). So i can take one working .dts file(as in option 1) as a basic platform for mine project and add mine device node in this .dts file (if it is not there) and it will work?
Please suggest and correct me.
I agree with the #sawdust's comment. Please find the pictorial representation of the same.
I have shamelessly copied it from the presentation here.
To answer your question, you should create your own ".dts" file which includes all the necessary parents (i.e. SOC specific and needed) dtsi files. And compile your ".dts" file using DTC compiler (either from linux/scripts/dtc/dtc in Linux Source tree or by using the package like "device-tree-compiler").
In most cases you can modify the existing device tree file and re-compile it for your purpose. For your case, I think you can have to modify this zynq-zed.dts.
I'm trying to add new System Call to Linux Kernel(x86_64). Based on this article which explained how to add System Call to Kernel(x86). The article says I need to define my System Call name in a file called syscall_table_32.S which is located in src/arch/x86/syscall_table_32.S.
But in my case, there is no file named syscall_table_32.S or syscall_table_64.S in the kernel source! There isn't even a directory for x64 System Call table in src/arch/.
So, where is syscall_table_64.S defined in kernel 3.13.0-14-generic (x86_64) ?
Where can I define a new system call?
Version 3.3 onward are different from 2.X that the guide use. You should look for the syscalls directory, in the arch/x86/ directory. So is:
cd /kernel-src/arch/x86/syscalls/syscall_64.tbl
kernel-src being the directory where your kernel sources resides. A good idea would be reading this answer in SO and compare it with your resource.
Hi I noticed that in the Linux file system we have 4 folders
Libraries
/usr/local/lib
/usr/lib
Include files
/usr/local/include
/usr/include
Now I know that while writing a C program the compiler checks these standard folders for libraries and include files in the order mentioned above.
I wanted to know why have two folders for each; 2 for lib and 2 for include. Why not just have one for each? What is the reason for this division?
Thank you.
See this pub (search for /usr/local):
http://www.pathname.com/fhs/pub/fhs-2.3.html
The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr.
For a general overview consult Wikipedia:
http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
Usually because /usr/lib/ and /usr/includes/ are used as the main repository for the system-wide libraries and includes while the more specific /usr/local/lib and /usr/local/includes are filled by users that need to install additional libraries/headers.
This should mean that the latter ones start empty with a new OS installation and ready to be filled by custom libraries while the system ones are already full of standard libraries. In this way when you perform a system update the local folders should be kept untouched while the system-wide one are updated..
I'm trying to make a distribution directory with my application. I've copied several Qt DLLs to that directory, and the program seems to be working, with one exception: it doesn't seem to find SQL plugin for SQLite. Copying qtsqlite.dll to the directory, doesn't allow my application to open or create SQLite files. What must be the direcotry structure or which additional files need to be copied so that the program can read the database?
you can use depends.exe to see exactly what the dependencies of your exe are and make sure they're all included.
Also, read this page about qt plugins. they are supposed to be in a specific directory called "plugins" and not in the main directory with all the other dlls.
Most probably, the qtsqlite.dll itself depends on original SQLite DLL's which you probably need to copy as well.
Don't forget to include an LGP license copy in your distribution as well as pointers to the original download ressources of the libs you include and their sources. To stay with the law :-)
Thanks to the link #shoosh provided, I was able to fix the problem. I needed to create sqldrivers subdirectory in the distribution dir with qsqlite.dll library inside. But that was just step one. Do you have any tips and resources on creating a full-blown Windows installer? I'm mainly a Linux programmer so this area is unknown to me.