0

i am planning to develop a device driver for a custom board.

as my research went on , I encounter two main ways to develop a driver . the device file which uses structures and another one was using pro which i can work with registers directly , since i am an electronics engineer I prefer the register way but i am not familiar with possible issues.

now i have 3 questions

1- which way is newer and more acceptable in embedded driver developing ?

2- which one has more flexibility?

3- what is the advantages of each way 

P.S : I am quite new to Linux world

S2G
  • 121
  • 7
  • 1
    It’s visible that you are new to the software :) the way you described the access to the hardware is not on register level, it’s against the Linux kernel design, but rather abstract to its function. Since you are not telling details about hardware, it’s quite hard to advise anything particular. And no, procfs should not be used in new drivers. – 0andriy Jan 08 '22 at 21:40
  • Yes i am pretty nobie in linux world and driver development (i am an electronics engineer working with microcontroller all of my life , so the register way is all i know) , well at first i am planning to get result in raspberry pi , which has more sources , but i don't want to use any library to achieve the goal , there are tutorials about i2C and SPI , there are good tutorials and PDFs but DMA Ethernet LCD and other parts which must be even controlled by the kernel , i don't have any idea how to implement it , i am kind of looking for reference too , thanks – S2G Jan 09 '22 at 06:21
  • 1
    Then choose one particular hardware and ask properly a new question with explanation of what you have done and what the issues you experience. Currently the question is too broad and too cryptic at the same time. – 0andriy Jan 09 '22 at 20:24
  • 1
    Ah, and in responding to _”i don't want to use any library to achieve the goal”_ I can say that you need to drop Linux and use bare metal approaches as you did for uCs. Strictly speaking in General Purpose OS it is almost impossible to do what you are asking for. – 0andriy Jan 09 '22 at 20:26

0 Answers0