Learn about linux kernel development robert love, we have the largest and most updated linux kernel development robert love information on alibabacloud.com
"Mr. Tao, let's talk about Linux device drivers.ProgramAfter talking about the memory for so long, how can we never talk about the actual device? At most, we talk about the memory. We always feel that the driver is isolated from the device and how can it be associated? "Mr. Wang thought.
"Yes, this is exactly the content of this lecture. I/O port and I/O memory access to the device." I can't help but pat her on the head.
For an actual device, a se
To put it bluntly, let's first introduce several structures related to character devices that must be known, and then combine themCodeDetailed description.
Part 1 necessary device structure
1) in Linux 2.6, The cdev struct is used to represent character devices:StructCdev {StructKobject kobj;// Embedded kobject objectStructModule * owner;// ModuleStructFile_operations * OPS;// File operation structureStructList_head list; dev_t dev;// Device numbe
, so the efficiency is much lower than the kmalloc . However , the address assigned by Vmalloc may be out of high-end memory or low-end memory.
Permanent Memory map Area (Pkmap region)
This area has access to high-end memory. The access method is to use alloc_page (_GFP_HIGHMEM) to allocate high-end memory pages or to map High-end memory allocated to the zone using the Kmap function. Common global variables for the permanent map area:Pkmap_base : The starting address for the per
(mandatory 10m/100m/1g, etc.) and self-negotiation mode. Exactly which mode to choose depends on the current PHY module connected to the peer PHY State, if the peer set is self-negotiation mode, the PHY module on the side also needs to be set to self-negotiation, so that the results can be negotiated is the current link can support the maximum rate. Conversely, if the peer is set to mandatory mode, the local side also needs to be set to mandatory, and the force rate is the same as the mandatory
partsL-Page Directory address:22~31 ( total )L-Page Table address:12~21 ( total )L in-page offset:0~11(total )The system will find the starting address of the page table for each process's page directory location, the highest ten digits of the linear address, and the beginning address of the page through the median, and finally pass the lower 12 The bit finds the offset in the page and finally calculates the physical address. 1.5 Linux Memory
normal scheduling and operation of processes in the kernel, and affects the system performance. In order to find a balance between the shorter interrupt execution time and the large amount of work to be done, Linux splits the interrupt handler into two parts: the top half and the bottom half. The top half is as urgent as possible. The bottom half has almost done everything about the interrupt handler and c
07:10 in the evening ..
"Mr. Tao, this chapter is not called a Linux Device Driver.ProgramThe interruption and clock have been mentioned in front of you, and many templates have been provided to me. I have understood it. Are you going to start talking about the clock this time .."
"It's really smart. I like you more and more about it. That's good. Today we are about to start a new module-kernel clock."
Linux Kernel series-12. B. Operating System Development-jump from Loader to protection mode, 12. bloader
Now, the kernel has been loaded into the memory. It is time to jump into the protection mode.
The first is GDT and the corresponding selector. We only define three descriptors, which are 0 ~ 4 GB executable segment,
(1) Linux hierarchy:(2) The Linux kernel consists of:It consists of 5 subsystems, such as process scheduling (SCHED), memory Management (MM), virtual file system (VFS), network Interface (NET), and interprocess communication (IPC).(3) Differences with UNIX:
Linux supports dynamic loading of
files in Linux?16) What are the system calls that create the process?17) How many different ways to call schedule () for process switching?is the Linux scheduler scheduling processes based on the dynamic or static priority of the process?19) which is the core data structure of the process scheduling?20) such as finer, unload a module?21) What space are the modules and applications running separately?Do flo
Ov511usb camera driver with Linux-2.4.18 kernel transplanted on S3C2410 Development Board
Content1. Driver2. Application writing
1. DriverThe Linux-2.4.18 is a drive with an ov511 camera by default, selected from the USB device, and activated the video option to support ov511.
2. Application writingThis is a program
Linux kernel driver development-Linux general technology-Linux programming and kernel information. For more information, see the following. I. Some General C questions
Question 1: Write the following program results:
Int m [] [3]
of section refers to the $$ here.; Initialize data segment descriptor Xoreax, Eaxmovax, Dsshleax, 4addeax, Label_datamovword [Label_desc_data + 2], axshreax, 16movbyte [label_desc_ DATA + 4], Almovbyte [Label_desc_data + 7], ahRun as follows:The first time you execute call testread , 8 null characters are displayed, and ABCDEFGH is displayed the second time you execute call testread . Because Testread's segment registers point to the contents of the 5MB memory address, there is no data at the b
~31 ( total ) L-Page Table address:12~21 ( total ) L in-page offset:0~11(Total ) The system will find the starting address of the page table for the page directory location of each process, the highest number of linear address, and then find the starting address of the page through the median, and finally find the offset within the page by a low bit, and finally calculate the physical address. 1.5 Linux Memory Management mode
I learned so muchProgramLanguage, always starting with "Hello World", can't help but lament the power of "Hello World. Well, let's talk nonsense. Of course, our story should start with "Hello World.
(1) Linux open-source is of course indispensableSource codeFor more information about the contribution, see the following (as for what is open source, I have not fully understood the tragedy ):
# Include # Include Module_license ("dual BSD/GPL ");
St
(SIGKILL).#define Task_killable (Task_wakekill | task_uninterruptible)#define TASK_STOPPED (Task_wakekill | __task_stopped)#define TASK_TRACED (Task_wakekill | __task_traced)#define TASK_NORMAL (task_interruptible | task_uninterruptible)Data structure of the processIn Linux, processes and threads are described using the TASK_STRUCT data structure, and the following will tell the purpose of the major data structure members.volatile long state; Process
1. Prepare the source code of the Development Board that can be properly guided
2. Create the ledtest folder under the driver directory of the kernel source code kernel folder# Mkdir Drivers/ledtest3. Drive the "LED drive experiment"ProgramCopy to the ledtest directory# Cp/opt/work/lab/led_driver/led_driver.c Drivers/ledtest/4. Create the kconfig and makefile f
Where did the shangji talk about? What is this memory? Speaking of the section "Rain, Mother wants to marry ..
Who are answering the question and talking nonsense? Of course I know here. I mean where the driver is talking about. Forget it ..
Linux open sourceCommunityWhat did developers do? It is very simple:
Use spin_lock ()/spin_unlock () as the basis for spin locks, and break them from the central node local_irq_disable ()/Open interrupt loca
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.