Embedded board for experimenting Linux proting and DD
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I want to know
how a normal Linux system differs from embedded Linux?
when designing for any RTOS(OSE or VxWorks etc.,) there will be a startup code or "initializing code" which is initially loaded and executed by the kernel.Then that startup code executes main application or(process or thread) which will be an infinite loop keeps executing until any other (process or thread or ISR) interrupts it to perform some other task. similarly I want to know, when I write a application for Linux, how can I initiate and then execute?
My product is a data acquisition system. where the loaded RTOS should initiate a main process(LCD driver) which displays the product name and executes continuously until an ISR interrupts it to start acquiring data.
any guidance or references will be a great help.
thanks in advance
regards
kiran
There are a few different ways, but probably the easiest would be to start it as a service, or from rc.local. Those two methods would be best if the application relies on other standard services being initialized a priori. If your application is fully self contained, you might want to start it from the init process, in lieu of say, a shell or getty type of process. If you are familiar with vxWorks, the Linux inittab file is somewhat conceptually close to the behavior of the startup script used in vxWorks. There are some significant differences, just as there are significant differences in the two OS's as a whole.
Some component of your application might benefit from running as a kernel driver (you mentioned ISR), either a loadable module or built into the kernel. It would not be uncommon to use a kernel that has been trimmed down to the least amount of features to support the application.
--- rod.
Hi rod,
How r u doing?
I have another query for u.
How can I test wheather a ethernet driver? as an end user I see its available in computer but not able to connect to internet. Similarly a USB driver. when i connect a USB pen drive its not recognized by the system.
thanks in advace.
kiran
Most desktop Linux systems use a script that parses one or more configuration files, and starts the networking device. Often this is called 'ifup' or a name similar to that. On a desktop system, these scripts may be quite complex. Your embedded system may also use a similar arrangement and you can read it to understand how the network gets started. This is one area where an embedded device may be significantly customized and it would be difficult to generalize about what it might include.
You could start by checking whether there is an ethernet driver for your ethernet hardware loaded (lsmod). If yes, then the usual first step would be to run ifconfig. If no, then loading and configuring the driver would be your next step (modprobe or insmod).
You may be able to glean information about the state of hardware initialization from dmesg. I am mostly unfamiliar with the processes involved with starting a USB subsystem, although it is likely conceptually similar to the networking setup.
When you say 'USB pen drive its not recognized by the system', what have you done to determine this?
--- rod.
Hi,
In desktop systems I saw a temporary drive is mounted when I plug in a USB device. I read few of the documents and basics from http://www.usb.org. USB driver too like PCI driver do a "plug and play" to check if any new device is connected or not.whenever a new device is inserted to a PCI slot the PCI driver tries to identify the device, then registers it with a driver. similar is the case with USB . If its USB mouse, it is registered as Human Interface Device and a usb interface is shown in /sys/devices/pci---/usb2/. If its pen drive it should mounted a temporary drive.
So when I connected the pen drive to my hardware board I thought it should be recognized and a temporary file system should be mounted, but its not happening. I tried to find if any interface is created or not in "/sys/devices/pci---/usb2/". I didn't find any.
thanks in advance
regards
kiran
A tool which will give you some useful information is lsusb (man lsusb). This should tell you whether the thumbdrive is seen at the USB level. After that, fdisk -l may show that a filesystem on the device is recognizable. If so, you can try mounting it manually.
There is a system utility called udev (plus hotplug) which uses a set of configuration files for creating device files when a device is plugged in or enabled in some way. This is likely to be part of the solution to automatically mounting the device in your filesystem.
--- rod.
Hi rod,
our previous mails really helped me alot to understand the linux internels.
I came up with few more queries while exploring the linux booting process....
I want to know what is a Board support package is?
what it contains? how to create such a package for embedded linux?
are there any tools in open source to develop and debug BSP?
How this BSP is different from Boot programs such as Uboot or LILO?
can we debug bootloader too using GNU tools or any other open source tools?
A board support package (BSP) is the collection of drivers, kernel mod's, and tools that allow the OS to run on a particular hardware platform, and provide access to the facilities that the hardware provides. Since Linux was originally targeted to the Intel PC platform, that target naturally has the greatest degree of support. Others that have ported Linux to other platforms have written what amounts to BSPs for those platforms. BSPs may be provided by hardware vendors, OS vendors (other OS's also use the term 'BSP' to describe the same customizations), or may be developed by third parties.
In order to write a BSP, you should have thorough documentation of the target hardware, especially including chip data sheets, and an understanding of the target compiler toolchain. The boot process is one customization that may be part of a BSP. In a protected mode OS like Linux, most of the BSP will be running in kernel mode, so debugging aid is largely limited to messaging that you snd to system log files for post-mortem examination. Sometimes, it can be useful to write the skeleton of a driver as a user-mode program, in order to gain an understanding of how a particular chip or sub-system works, and then move the functionality into a proper kernel driver. In an embedded systems environment, a common aid is the JTAG interface. This a more or less industry standard interface that is used for communicating with the hardware, and for downloading code to the target. This is particularly useful when there is no console on which to display diagnostic output. Cross-debuggers may be able to use the JTAG interface to assist in target debugging. I do not know the details of how this is implemented, and if another reader can add some information about it, I would be interested to read it. If your target has an RS-232 port, it can be a valuable aid as a way of sending diagnostic output to a terminal for inspection and logging. If the BSP you are developing requires you to write support for the RS-232 interface, I would make it a high priority, so you can leverage it to assist in further development.
Writing a BSP is not an easy task. If your target platform is a commonly used product, it has probably already been done. It would be worthwhile to find out if such is the case. It may be that a package has been written for a similar hardware platform, and simply needs a few additions or modifications. Do you have some particular target hardware in mind?
I am using ARM AT9200 which is already having all the tools and BSP's including JTAG and RS-232 drivers to interact with the target board. The BSP queries I asked is becasue, while browzing different features and tools of each RTOS, I found Windows CE has tools to develop and debug BSP and bootloader. When I am working on RTOS like OSE, the bootloader and the BSP are provided by the Target board vender. So gave a thought if embedded linux to might have had such tools for its supporting target boards. Moreover thought how, if any error occurs in bootloader or BSP it is debugged in linux environment.
Can any one give an idea on linux device file modal?
I am facing a weird problem with one of the device driver. I compiled and build the driver successfully and got *.ko file. I used "mknod /dev/filename type majornumber" command and created a device file in /dev directory. then i wrote an application to open the device file and executed it.
I get an error message "No device or file with "filename". in /dev
can any one suggest where i am going wrong. I read about udev and hotplugging etc., but i want this device driver to load statically. when i try to open some other device driver like "Console" using the same application it is executing successfully.
Hi rod,
How are doing?
When I call mknod /dev/filename major minor to instantiate the device file is successfully created in /dev
when I do ls -l /dev/filename it returns the filename with major and minor numbers too.
I feel there is some problem in my driver code while registering. actually i am calling register method with major = 0, so that kernel assigns major number dynamically.
when i do insmod the device driver module is successfully loaded and in /proc/modules i could see the dd module name.
then i am using the major number and minor number displayed in that /proc/modules and doing mknod.
after that i am trying to open the driver using the application.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.