Schindler 4412 Board Linux Driver Tutorial--Write a simple application call driver

Source: Internet
Author: User

Linux Driver Tutorials : Http://pan.baidu.com/s/1c0hljUS


Write a simple application call driver--header file

? Print header File

–include <stdio.h> calling print function printf

? The header file needed to invoke the file in the app

– #include <sys/types.h> basic system data types. The basic data type of the system is compiled in 32

The environment is maintained as a 32-bit value and grows to a 64-bit value in the 64 compilation environment.

– #include <sys/stat.h> system Call function header file. Can call ordinary files, directories, tubes

Tao, socket, character, block properties

– #include <fcntl.h> defines the Open function

– #include <unistd.h> defines the close function

– #include <sys/ioctl.h> defines the IOCTL function

? The header file that was called is the one that was put together with the compiler.

– Using the ARM2009Q3 compiler here, the compiler uses the ARM-NONE-LINUX-GNUEABI-GCC

? Locate the header file by using the Find command in the compiler directory

– e.g. #find./-name Types.h

? Functions that are called

The –open function is a return file descriptor

The –IOCTL function is applied to the drive to pass the value

The –close function is to close open files

? Write code for the application, compile

–arm-none-linux-gnueabi-gcc-o Invoke_hello invoke_hello.c-static

? Load Devicenode_linux_module Drive in the development Board, run the application

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Schindler 4412 Board Linux Driver Tutorial--Write a simple application call driver

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.