My goal is to port this driver on current Linux Kernel.
Things which I did till now....
1) Downloaded the source code of the current kernel version.
2) Downloaded the dev_parallel.c, Makefile, Kconfig for reworking on the code.
3) Using "make" command I was able to compile the driver with no errors.
4) Using "make modules" command I was able to generate a .o file.
5) Using "make modules_install" command I was able to get the .ko file.
6) Using "modprobe" command I was able to successfully load the module without any kernel panics.
But I see that there is a DTS file for this driver located here. I know that dts files are compiled to dtb files which are read by the kernel during boot time and it automatically loads the module.
But is it necessary to have this DTS file or just modprobe command will do the job for me?
The driver which I am talking about is for an Electronic paper display (EPD).
So If I connect EPD and then do modprobe for loading the driver, will it work or do I need to have DTS file for making it work correctly?
It is not necessary to use DTS file in a driver but for some reasons like defining pins, setting configurations, etc. It should get parameters from DTS file to prevent user to modify the driver and recompile it.
It seems that your example doesn't get any parameters from the DTS file but on the other side, it hardcoded some pin definitions so you need to take care of them.
If you want to force it to read parameters from DTS file you should rewrite the driver. You can use this for driver and this for GPIO. Then you must include the new driver in your current DTS file and recompile it.
For the driver compilation, you can create a kernel module. You can use this tutorial for the basics.
Related
I have a perf.data file generated on another system that I am trying to read on my own machine using perf report -i [file]. Doing this, generates the following error
file uses a more recent and unsupported ABI (bytes extra)
How can I work around this issue and open the profiling data file?
I'm getting started with imx6 processors and the procedure involved to bring up the board is to flash u-boot kernel dtb and rootfs which is taken care of by mfg tools provided by nxp.
For creating a rootfs partition the command run is
mkfs.ext3 -F -E nodiscard /dev/mmcblk1p2
and for untaring the rootfs into this partition it is.
pipe tar -jxv -C /mnt/mmcblk1p2
I'd like to know the working of this, which kernel driver is being called for executing these commands?
My kernel version is 4.9.88.
I did find a few driver files related to mmc in the path
/drivers/mmc/core
but there is nothing related to filesystem reading or writing here.
Can anyone explain which driver files are used to create filesystems?
Creating the filesystem is done by the userspace program mke2fs (of which mkfs.ext3 is an alias) which is part of the e2fsprogs package. The kernel and drivers have no way of creating filesystems. Therefore, only the block driver for accessing the MMC device is involved, but no file system driver.
I've been building my own kernel (4.19.37) and have no issues during build (make) or install (make install_modules + make install). Everything seems to go fine until I execute grub2-mkconfig -o /boot/grub2/grub.cfg. When executing this command, grub finds both my existing and new vmlinuz-* kernels in /boot/ as well as their corresponding initramfs-*.img. However, at that point the system hangs indefinitely (> several hours). Ctrl+C does not seem to stop it and I must reboot. I have looked into this issue and all I have found that could be a problem is the probing of removal disks for bootable OS's, which I have eliminated by both removing them and by adding GRUB_DISABLE_OS_PROBER=true to /etc/default/grub per this SE post. Neither has helped.
Upon reboot, I end up at the grub> command line, presumably because the grub2-mkconfig never finished and corrupted the grub configuration file. Here I can load both the old and new kernel without any issue, as well as initramfs, but when I execute boot I get a kernel panic:
end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Naturally, it is my assumption that there is something wrong with my initramfs-4.19.37.img that was created by my build process. As an experiment, I tested if I could load the new kernel, but use the old initramfs (4.19.10), and indeed it does boot into emergency mode. I however cannot do the opposite, old kernel with new initramfs. So something is fishy with my new initramfs image.
Getting smarter, my last experiment was mounting the old and new initramfs image with mount. They both mount successfully with no errors, and seem to have identical file structures. I have also compared both my new and old .config files for the kernel builds, and the differences are trivial.
A few other notes/observations:
In the image above, you can see List of all partions: produces nothing, so I am wondering if there is an issue with the file system type? My hard drive is xfs, what is the file system for the initramfs? CPIO?
At the grub> command line, ls / produces what I expect to see in /boot. It contains all my vmlinuz-* and initramfs-*.img files
My file system is xfs
I've tried various other kernel versions with same results
I have twice had successful builds and installs, once was the existing kernel (4.19.10), it was an upgrade, and a second time with the same kernel with a low-latency pre-emption model. I can't for the life of me figure out what I did differently then.
So the final question(s) are - What's wrong with the initramfs form these builds? What else can I do to validate it's integrity? Are there any .config changes I should make when building the kernel for the xfs file system?
Disclaimer: So this actually an continuation of [this question][3], but I've simplified the problem a bit. Some background info there might be relevant.
After updating the kernel using yum update, reboot the VM using the new kernel you get a kernel panic error.
Following commands will fix this problem.
yum remove kernel
yum update
I am running xillinux on my microzed board. I need to define a new serial port on the board using vivado. I was able to add this to the IP core and the device is ready. But,how do I make this port visible on ubuntu (xillinux) like ttyPS0. DO I need to add this port to the device tree and generate the dtb file and boot.bin file ? IF so, how do I modify the device tree ?
1.) Now again, instead of vivado if I use ISE, then would I be able to update the device tree source file in the ISE software itself and generate the device tree .dtb file ? If so, where can I find and edit this dts file ?
2.) And for building the new boot.bin file in ISE, I can use http://xillybus.com/downloads/u-boot...ux-1.3.elf.zip for the microzed or can I use the bin file for microzed from xillybus.com/downloads/xillin...rozed-1.3c.zip ?
3.) Even after using the ISE and creating the new .dtb (if possible in ISE), do I have to edit dtc files on the xillinux OS in the micozed board ?
4.) If I need to follow step 3 above to get everything working, based on this link, http://xillybus.com/tutorials/device-tree-zynq-1
I can go only upto to cd /usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc/
If I type cd /dtc again, it says dtc not a directory.
How do I access the device tree script and add the address mapping to the bus in the peripheral section ?
How do I compile this and make the new device tree start on every boot ?
I can go only upto to cd
/usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc/
If I type cd /dtc again, it says dtc not a directory.
Sure, /usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc/dtc is a binary executable. It has been compiled with the Linux kernel. It is the Device Tree Compiler (thus its name) that turns a Device Tree Source foo.dts into a binary Device Tree Blob foo.dtb. The DTS is a text file describing the available hardware and how to access it. The DTB is the same information but in a binary format that the Linux kernel parses at boot time to discover the hardware it is running on and to attach software drivers to the hardware peripherals (among other things).
So, to use the dtc just add /usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc to your path and use it:
$ export PATH=$PATH:/usr/src/kernels/3.12.0-xillinux-1.3/scripts/dtc
$ dtc -I dts -O dtb -o foo.dtb foo.dts
I am new to GWAS analysis and I've been trying to run the PLINK tutorial sample datasets (hapmap 80K loci) on gPLINK to do some exclusions. I am currently working on a Mac OSX 10.10. I've applied the threshold settings (high missing rate, low MAF etc.) to my file "hapmap1.ped" and prepared to execute the command through gPLINK, however it keeps giving me the error prompt "can not execute command locally".
Is there something wrong with my library or directory settings?
gPlink runs in two modes a remote mode and a local one. It seems you are running the local one. Please check if you are specifying the correct path where PLINK is installed when cofiguring gPlink. For more details refer to gPlink configuration