Sram,sdram, Nic

Source: Internet
Author: User

Sram,sdram, Nic has address bus. Unified address by CPU.

NAND Flash does not have an address bus. So there are different ways of addressing the two.


The frame of the character device driver.
Drivers 1. There are led.read,led.write,led.open these functions, 2. Defines a struct fileoperation, which includes a. read function that points to led.read. Includes the. Write function that points to led.write, including the. Open function that points to led.open. 3. The entry function (the function that tells the kernel to the fileoperation struct), through Register_chedev (main,name,fileoperation).




Compile the driver to rely on the kernel.
The IOREMAP maps the physical address to a virtual address.


Originally the main device number can be assigned manually. However, the driver can also allocate the main device number on its own initiative.
The application opens a device open ("/dev/xxx"), where the device comes from.


1. Manually set up,
Mknod/dev/xxx c Primary and secondary
Need to know the main device number at this time
2. Create your own initiative, Mdev (Mdev is Udev's-simplified version number) to create a device node based on system information. So the driver to provide the above required system information in advance, so that the ability to create their own initiative.






Write a driver.

(Use the query mode to light the LED light)
1. Write the framework.
A. Write the fileoperation structure. There are. Open,.read,.write and other members.
B. The structure is registered to the kernel through the entry function. Export function is required at the same time. Modifies the entry function. Modifies the Exit function.
C. Provide system information to the kernel. This allows the UDEV mechanism to proactively create device nodes on its own. Xiang Fine steps. Create a class at the Ingress function and create a CLASD device.

At the same time, unload these things at the exit function.
D. Finally add a lisence.
2. Hardware operation,
A. Look at the schematic to determine which pins are connected to the key.
B. Look at the 2440 manual to determine how these pins are operated. And what registers to manipulate.


C. Programming.
The above three steps are basically the same inside the microcontroller. The difference is that the microcontroller operates the physical address directly, while the driver uses the virtual address.

Va=ioremap (pa,size).
...................................................
Write a driver (use interrupt mode to light the LED light).
1. In the open function, configure the PIN as the interrupt pin, i.e. REQUEST_IRQ ().
2. Add members to the right fileoperation structure. The release () function (used to release the interrupt pin).


That is: Release () =second_drv_close ();
3. Implement function Second_drv_close ()
4. Implement the-BUTTONS_IRQ () in the REQUEST_IRQ () function.
5. Add header file Irq.h and so on.










In the Open function configuration pin, the Read function reads the PIN state (via the Copy_to_user () function to pass the PIN state to the user).

Address mapping is performed in the Ingress function.

The Exit function is de-mapped.


The top command is equivalent to the Task Manager.


Shared interrupts, which have very many sources of interrupts, share the same pin.
Interrupts are abnormal-kind. The interrupt processing process under single chip microcomputer:
1. Identify the interrupt source.
2. Call the corresponding handler,
3. Interruption of clearance.
In the Linux kernel, these three items are implemented by the ASM_DO_IRQ () function.

Sram,sdram, Nic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.