0

I'am new on linux and I try to compile this code https://elixir.bootlin.com/linux/v4.0/source/drivers/w1/slaves/w1_ds2433.c (my target is to create a ds2433.ko and if it works a ds28ec20.ko)

When i compile the ds2433.c I get that :

In file included from /usr/include/kernel.h:8:0, from w1_ds2433.c:8:
/usr/include/linux/linkage.h:8:10: fatal error: asm/linkage.h: No such file or directory

The main problem is that I don't know if I need to create the file suppose to be in /asm or if the code will create them.

ignacio
  • 1,181
  • 2
  • 15
  • 28
  • does [that](https://stackoverflow.com/questions/9492559/module-compiling-asm-linkage-h-file-not-found) helps? – ignacio Aug 07 '20 at 21:49

1 Answers1

0

When you compile the code, you should get a file with the extension .s, .asm, or maybe something else. To check if it is assembly, you can go into the terminal, type "ls -l" and if you see a file with an extension you are unfamiliar with, you can type in the terminal "cat filename.ext" and see the contents of it.

jrima12
  • 50
  • 8
  • Because of the absence of asm/linkage.h the compilation failed. And I don't see any file with a strange extension. – Etienne Aug 07 '20 at 14:28
  • Which compiler are you using? make sure you have all dependencies installed for the compiler. Also the error message that you get basically means that the paths you are connecting are not configured properly. When you include the files, the paths get messed up somehow, thats what the error is saying – jrima12 Aug 07 '20 at 23:21
  • I'am using gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3), How can I check my dependencies are correctly installed and how to set them? I 'am new on linux and a little lost on my project. – Etienne Aug 09 '20 at 15:03
  • Take a look at this video: https://youtu.be/y8DQwjbX_V8 for the dependencies. Also, Im not super knowledgeable yet in linux, but if you are doing anything with the kernel, you will need root permissions for most actions, so you may want to take a look at how to run things as root – jrima12 Aug 12 '20 at 17:13