w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to port a linux driver , which is compiled in 2.6 kernel ,without compiling in other new version of kernel
now it's not possible: usually, a "driver" is a binary kernel-module porting will involve code-changes to the kernel module. if you change the code, you need to compile it, in order to get a binary. since kernel modules run in kernel space, it is crucial that they are robust. since parts of the kernel-API change every now and then, trying to use a module compiled for kernel-X with another kernel-Y, might either not load because of missing symbols (if you are lucky) or lead to a kernel panic because semantics have changed. btw, all this is not really related to 2.6.x vs 3.y, but holds true for any kernel version but then: of course in theory it is possible to "write" a kernel-module as binary code in your favourite hex-editor, without resorting to compilers and such. this would allow yo

Categories : Linux

Meaning of version info in .mod.c file in Linux kernel
The __versions section contained in all the individual *.mod.c files CRC Symbol { 0xa6d8dcb5, "module_layout" }, { 0x16c2b958, "register_netdevice" }, ... ... is a list of symbols and their corresponding CRCs. This has 2 main uses : Global list of all exported symbols. Module versioning check when loading ko modules. Rationale behind Module versioning Module versioning is enabled by the CONFIG_MODVERSIONS tag, and is used as a simple ABI consistency check. A CRC value of the full prototype for an exported symbol is created. When a module is loaded/used, the CRC values contained in the kernel are compared with similar values in the module; if they are not equal, the kernel refuses to load the module as it indicates that the module is built with

Categories : C

How to compile ixgbe network drivers on other linux kernel version
Install the kernel-devel rpm for 2.6.39.4 and compile against the new kernel. In Makefile use the Kernel directory as 2.6.39.4. Usually located in /usr/src/kernels/

Categories : Linux

"scripts recordmcount: Syntax error" when I try to build a linux kernel module on a 64-bit 3.9 kernel
This was an issue of cross-compiling. I used a 32-bit Ubuntu system to build a 64-bit kernel and it's been nothing but headaches. Apparently the scripts etc still get built as 32-bit. (They'd have to since my 32-bit system needed to use them to build the kernel.) But then if bring that /usr/src/linux-headers-x.x.x dir over to my 64-bit system I can't use it to build any kernel modules because its /scripts dir is 32-bit. I rebuilt recordmcount on the 64-bit machine and that worked. But then there was another script that was incompatible with 64-bits, that wasn't as easy to build without rebuilding the entire kernel. Anyway, if you cross compile you don't get a /usr/src/linux-header-x.x.x/scripts dir that's usable on your target system.

Categories : Misc

Linux Kernel - stoping a running kernel timer from user space
Have you considered trying netlink? It's a powerful method for user-to-kernel (or process-to-process) communication which both simple and lightweight.

Categories : Linux

Are the services offered by the linux kernel implemented as kernel threads?
Some are, some aren't. The terms "process management" and "memory management" are kind of broad and cover a fair bit of kernel code. For memory management, a call to mmap() will just require changing some data structures and can be done by the current thread, but if pages are swapped out it will be done by kswapd, which is a kernel thread. You might consider the scheduler a special case: since the scheduler is responsible for scheduling all threads, it itself is not a thread and does not execute on any thread (otherwise it would need to schedule itself... but how would it schedule itself, if it had to schedule itself first in order to do that?). You might think of the scheduler as running directly on each processor core when necessary.

Categories : Multithreading

How to release an iOS app as worldwide which was release with Italian as the language in the first version?
The third Question answers my query. https://vpp.itunes.apple.com/faq 3. Can I distribute redemption codes to employees who are not located in my country? No. Apps can only be distributed to employees with Apple IDs located in the same country where the apps were purchased. To distribute redemption codes in other countries, you must enroll your business in the Volume Purchase Program for every eligible country in which you wish to purchase and distribute apps.

Categories : IOS

In linux, all kernel processes share the same kernel stack, each user process has its own stack, correct?
Incorrect. There's one kernel address space, and no kernel processes. There are kernel threads, and there are user space threads that enter the kernel. These run in the kernel address space. Each of these has a separate stack, within the kernel address space.

Categories : Linux

Why isn't maven replacing the environment variable for the maven-release-plugin release version?
you will have to use the arguments attribute: http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#arguments So in your context your cmd line will look like this (Note the double quotes as well): mvn release:clean --batch-mode release:prepare "-Darguments=-Dtag=${env.tag} -Dproject.rel.com.mycompany.project:project-root=${env.project.rel.com.mycompany.project:project-root} -Dproject.dev.com.mycompany.project:project-root=${env.project.dev.com.mycompany.project:project-root}" Furthermore, if i remember right the uses of the tokens ${env.X} requires the usage of the property name in upper case (to be verified)

Categories : Java

update parent version to next release version
I got the same problem as you, but finally understood it was only accepting a range as input, not a single value, so in your case you should put: mvn versions:update-parent -DparentVersion=[1.0,1.1] This should select 1.1 if it exists in your repository. Got the clue reading tickets in plugin bug tracker

Categories : Maven

Which Linux platfrom required for Installation of ingres database version 9.2 and openROAD version 4.0
If you want answers don't use Stackoverflow as its ridiculous policies prevent me supplying the four links that would have been helpful to you. Google for the Actian community, which you will find far more helpful with fewer egos struggling to rule the world.

Categories : Misc

How to get kernel version without arch
Given that regex can be used, you can match the string against ^(.*).[^.]*$ and take the first capture group. ((.*)..* will generally also work, with "greedy" quantifiers, but cf. a reference for your regex engine.)

Categories : Linux

which fuse version in my kernel?
On my system (Slackware 14) the following command shows you which fuse package is installed, thus including its version: $ ls /var/log/packages/ | grep fuse According to which package manager you use, you may find its log file under /var/log/[dpkg,yum,apt].log; you should find there the history of your installations, including versions. An other alternative method: check your installed packages through your package manager GUI.

Categories : Linux

About usb otg driver in linux kernel
I've found the answer to my first question. Checkout this link: http://www.spinics.net/lists/linux-omap/msg87665.html

Categories : Linux

Using TunTap with linux kernel 2.6
The tuntap documentation is outdated. Also, in newer versions of linux, you might need to use tunctl instead of ip tuntap add To install tunctl on debian Squeeze, install the package 'uml-utilities' which provides the tunctl command. You can add a new tunnel using tunctl -t tun1

Categories : Networking

Role of tty in Linux kernel
This file is to support tty on user level interface or console.This also implements echoing. tty: Print file name of terminal on standard input.For more info give info tty command on shell.

Categories : C

what is __ksymtab? in linux kernel
The format is similar to that of the output of nm utility, see also this page. To put it simple, 'T' usually denotes a global (non-static but not necessarily exported) function, 't' - a function local to the compilation unit (i.e. static), 'D' - global data, 'd' - data local to the compilation unit. 'R' and 'r' - same as 'D'/'d' but for read-only data. These are the items from the special sections needed to export symbols so that the symbols could be used by kernel modules. For each exported symbol, al least the following is defined by EXPORT_SYMBOL(): __kstrtab_<symbol_name> - name of the symbol as a string __ksymtab_<symbol_name> - a structure with the information about the symbol: its address, address of __kstrtab_<symbol_name>, etc. __kcrctab_<symbol_name>

Categories : Linux

How can I get the builder name of the linux kernel
dmesg gives the kernel log, so you should be able to grep/sed it from there: dmesg | grep 'Linux version ' | sed 's/[^(]*(([^)]*)).*/1/' (There are smarter ways of doing this.)

Categories : Shell

How do I update my server's kernel version
This is not exactly the kind of question for stackoverflow. Anyway. You have to: download the kernel source from kernel.org configure the kernel with make menuconfig or make xconfig compile the kernel with make -j4 (where the option -j is the number of processor) copy the kernel from /arch/x86/boot/bzImage to your boot directory (/boot/) add a new option in your boot loader to boot the system with the new kernel

Categories : Database

Getting the Windows kernel version in Java?
Did you try : System.getProperty("os.version"); If you want to check the same on Linux or Android you can do so by this statement: Runtime.getRuntime().exec("uname -r");

Categories : Java

Switching into (Linux) Kernel Mode
All switches to kernel mode are made via system calls. In the case of network protocols these system calls are socket, listen, accept, ioctl, read, write, recvmsg, etc. You write a Linux kernel module. There is already a SCTP protocol stack for Linux though. You would likely be better off modifying it to do what you want. Once you have written and compiled your module you can load it into the kernel using insmod and rmmod. In my experience you rarely get a chance to use rmmod because if you made a mistake the system crashes or freezes. So use a virtual machine for your testing. It is faster to reboot, you lose less data, and it is easier to hook up a virtual serial console for debugging. I am sure this question is a duplicate by the way. You can find a lot of questions on this topic.

Categories : Linux

How does the Linux kernel realize reentrancy?
[Edit - the term "reentrant" gets used in a couple of different senses. This answer uses the basic "multiple contexts can be executing the same code at the same time." This usually applies to a single routine, but can be extended to apply to a set of cooperating routines, generally routines which share data. An extreme case of this is when applied to a complete program - a web server, or an operating system. A web-server might be considered non-reentrant if it could only deal with one client at a time. (Ugh!) An operating system kernel might be called non-reentrant if only one process/thread/processor could be executing kernel code at a time. Operating systems like that occurred during the transition to multi-processor systems. Many went through a slow transition from written-for-uniproc

Categories : Linux

How do I know if an address in Linux kernel is readable or not?
The copy_from_user and related functions get the address from some untrusted user space program; they protect against invalid addresses by installing a special exception handler. (See this answer for details.) You could do the same, but this would protect only against addresses that the kernel has marked as invalid in the page tables; accesses to some random device's MMIO range might have unpredictable results. If you want to search for something in some BIOS ROM, remap that memory like any other PCI resource. If you want to search for something in main memory, you could use some function like ioremap or kmap to get a valid virtual address for a specific physical address.

Categories : Linux

Booting a ppc linux kernel in qemu
Dont use nographic use below command , qemu-system-ppc -kernel vmlinux_2 -hda ss1.1.img -append "console=ttyS0 root=/dev/sda1" or qemu-system-ppc -kernel vmlinux_2 -hda ss1.1.img -append "root=/dev/sda1"

Categories : Linux

Macros from linux kernel code
It seems to work the following way: Call the __chk_io_ptr(a) in order to check the memory available Read unsigned int from memory by dereferencing the pointer. I suppose you use this macro the following way: unsigned int data = __raw_readl(a); By preprocessor it is replaced by: unsigned int data = (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)); So as result of the comma operator in data stored unsigned long value pointed by a. EDIT: The __chk_io_ptr(a) seems to be a macro in accordance to this. #define __chk_io_ptr(x) (void)0 That actually does nothing.

Categories : C

page swap in Linux kernel
The best place to start looking is going to be in mm.h: http://lxr.linux.no/linux+v3.10.10/include/linux/mm.h Then take a look at the mm directory, which has files like page_io.c: http://lxr.linux.no/linux+v3.10.10/mm/page_io.c Keep in mind that any architecture specific stuff will likely be defined in the arch directory for the system you are looking at. For example, here is the x86 page table management code: http://lxr.linux.no/linux+v3.10.10/arch/x86/mm/pgtable.c Good luck! Remember, you are likely not going to find a section of code as clean as the example code you gave.

Categories : Linux

how is a memory barrier in linux kernel is used
From the section of the document titled "WHAT MAY NOT BE ASSUMED ABOUT MEMORY BARRIERS?": There is no guarantee that any of the memory accesses specified before a memory barrier will be complete by the completion of a memory barrier instruction; the barrier can be considered to draw a line in that CPU's access queue that accesses of the appropriate type may not cross. and There is no guarantee that a CPU will see the correct order of effects from a second CPU's accesses, even if the second CPU uses a memory barrier, unless the first CPU also uses a matching memory barrier (see the subsection on "SMP Barrier Pairing"). What memory barriers do (in a very simplified way, of course) is make sure neither the compiler nor in-CPU hardware perform any

Categories : Linux

What happens after segmentation fault in linux kernel?
Data abort handler just assigns to the pc the same value as before the data abort handling started, and instruction gets executed again, with right data in place, so data abort won't happen again.

Categories : Linux

Linux Device Drivers 3rd Ed and 3.2 kernel
I like LDD3. The teaching style is outstanding. I see the most references to that text in SO, LWN etc. I tried just reading it, that had limited value. It was better to get the examples built and running, play some e.g. with scull, then study the text hard to see how the code was really working. But, to do that with modern kernels, you need updated code. I found martinezjavier code built OK with 3.1 kernel (I deleted tty from Makefile, and added simple_open() definition) then life was great. Also I found some nice work from cs.fsu, including online cross-reference. Cooperstein text also exists, and has exercise solutions with multiple kernel versions, but I haven't used this text.

Categories : Linux

Cyclictest for RT patched Linux Kernel
There's a lot that must be done to get hard realtime performance under PREEMPT_RT. Here are the things I am aware of. Entries marked with an asterisk apply to your current position. Patch the kernel with PREEMPT_RT (as you already did), and enable CONFIG_PREEMPT_RT_FULL (which used to be called CONFIG_PREEMPT_RT, as you correctly derived). Disable processor frequency scaling (either by removing it from the kernel configuration or by changing the governor or its settings). (*) Reasoning: Changing a core's frequency takes a while, during which the core does no useful work. This causes high latencies. To remove this, look under the ACPI options in the kernel settings. If you don't want to remove this capability from the kernel, you can set the cpufreq governor to "performance" to lock it i

Categories : Linux

Linux Kernel Check VID / PID Number?
Your program would be querying the serial number via the operating system. And you know what, your client has the ability to alter the operating system, so your program would not be able to completely trust the information provided by the OS. If you're willing to trust the client (not to alter the OS), see how the hdparm program in Linux obtains its HDD detail information (including the serial number), or alternatively crawl through the /sys/devices/ hierarchy to find out the hard disks and their detail data (couldn't find it for the moment, but I think the serial info would be there as well). If, on the other hand, you would like to expect your clients to cheat, then you would better not let them use your application at all.

Categories : Linux

linux kernel head file
This struct is for kernel internal use only. It's definition is pretty long and largely varies depending on kernel configuration. So, the struct size also varies depending on kernel configuration, and you can't get it from user-space. Unless, you extract kernel config, which is bad idea, as for me. The better one is to write a kernel module.

Categories : Linux

How are percpu pointers implemented in the Linux kernel?
Normal global variables are not per CPU. Automatic variables are on the stack, and different CPUs use different stack, so naturally they get separate variables. I guess you're referring to Linux's per-CPU variable infrastructure. Most of the magic is here (asm-generic/percpu.h): extern unsigned long __per_cpu_offset[NR_CPUS]; #define per_cpu_offset(x) (__per_cpu_offset[x]) /* Separate out the type, so (int[3], foo) works. */ #define DEFINE_PER_CPU(type, name) __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name /* var is in discarded region: offset to particular copy we want */ #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) #define __get_cpu_var(var) per_cpu(var, smp_processor_id()) The macro RELOC_HIDE(ptr, offset)

Categories : Linux

Critical Timing in an ARM Linux Kernel Driver
One possible workaround to the problem Chris mentioned (in addition to problems with paging of kernel module code) is to use a PWM peripheral where the duration of the pulse is pre-programmed and the timing is implemented in hardware. Fancy processors with caches are not suitable for hard realtime work. Execution time varies if cache misses are non-deterministic (and designs where cache misses are completely deterministic aren't complicated enough to justify a fancy processor). You can try to avoid memory controller latency during critical sections by aligning the critical section so that it doesn't straddle cache lines. Or prefetch the code you will need. But this is going to be very non-portable and create a nightmare for future maintenance. And still doesn't protect the access to

Categories : Linux

Entry and Exit prints in Linux Kernel
You can compile the source files you want with -finstrument-functions. Then you can implement these two functions yourself, in some file of the kernel. Note that: You must not compile the file containing __cyg_profile_func_enter/exit with -finstrument-functions (or, you should use __attribute__((no_instrument_function))). The functions __cyg_profile_func_enter/exit must not call code compiled with -finstrument-functions - this will lead to infinite recursion. If all they do is printk, and printk and the low-level drivers it calls are not compiled this way, you're OK.

Categories : C

Understanding exception inside linux kernel
All the OOPS/panic information show the exception happened in udevd context, I think it may be triggered by "/sbin/modprobe -bv of:NioctlTCfsl,mpc5125-ioctl". To verify this, you can remove the "/sbin/modprobe -bv of:NioctlTCfsl,mpc5125-ioctl" entry in your root file system to see whether the system can boot up successfully. I guess your platform CPU is PowerPC architecture. If so, the exception vector is 0x700, it means the instruction fetch exception. CPU tried to fetch one instruction from invalid address. The instruction flow is incremented if there are no jump/branch instructions. If option 1 is verified that it is related to "/sbin/modprobe", please check the kernel module to analysis the instruction fetch exception. Good luck!

Categories : Linux

How to get notified by the Linux kernel if a new interface has been attached?
While you can use udev, the underlying mechanism is netlink. Interfaces themselves are not normally in /dev, but do show up under /sys/class/net as sub-directories. However, the hotplug.txt gives a good start to inspecting kernel events. Run the sample code and examine the netlink data when an interface is connected. The text is ASCII that any user space application can parse and use.

Categories : Linux

How Linux kernel function (bitmap_set ..) works
Not having more context makes answering difficult, but as these are defined as functions in the Linux kernel I suspect this is a fragment of an initializer somewhere defining an array of function addresses. http://lxr.free-electrons.com/source/lib/bitmap.c#L276 http://lxr.free-electrons.com/source/lib/bitmap.c#L330

Categories : C

reading linux kernel source code
You could try some source navigator, or use ctags (or etags with emacs), or cscope etc... You could consider also coccinelle. You could extend the GCC compiler, e.g. using MELT, to suit your needs. Most importantly, read some good books and tutorials about the kernel internals. Ask also on kernelnewbies.org

Categories : Linux

Where is the system call table in linux kernel?
A similar question on SO where the OP seems to have solved it: New syscall not found (linux kernel 3.0.0) where should I start looking? The file seems to be arch/x86/kernel/syscall_table_32.c.

Categories : Linux



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.