title: How to compile kernel module together with file .s GAS Assembly
body: <p>I would like to compile a file .s GAS Assembly together with my kernel module (LKM). My kernel linux version is 5.1.20-200.fc29.x86_64. This is my assembly fileasm.s:</p>
  
  <pre><code> .globl  maxofthree
  
          .text
  maxofthree:
          mov     %rdi, %rax              # result (rax) initially holds x
          cmp     %rsi, %rax              # is x less than y?
          cmovl   %rsi, %rax              # if so, set result to y
          cmp     %rdx, %rax              # is max(x,y) less than z?
          cmovl   %rdx, %rax              # if so, set result to z
          ret                             # the max will be in eax
  
  
  And this is my driver.c:
  
  #include&lt;linux/kernel.h&gt;
  #include&lt;linux/init.h&gt;
  #include&lt;linux/module.h&gt;
  
  int64_t maxofthree(int64_t, int64_t, int64_t);
  
  
  static int __init hello_world_init(void)
  {
      printk(KERN_INFO "Welcome \n");
          printk(KERN_INFO "This is the Simple Module\n");
          printk(KERN_INFO "Kernel Module Inserted Successfully...\n");
          printk("%lld\n", maxofthree(10, 20,30));
      return 0;
  }
  
  void __exit hello_world_exit(void)
  {
      printk(KERN_INFO "Kernel Module Removed Successfully...\n");
  
  }
  
  module_init(hello_world_init);
  module_exit(hello_world_exit);
  
  EXPORT_SYMBOL_GPL(maxofthree);
  MODULE_LICENSE("GPL");
  MODULE_AUTHOR("Max");
  MODULE_DESCRIPTION("Simple driver");
  MODULE_VERSION("2:1.0");
  </code></pre>
  
  <p>In the Makefile I wrote:</p>
  
  <pre><code>obj-m += driver.o
  driver-objs += fileasm.o
  
  KDIR = /lib/modules/$(shell uname -r)/build
  
  all:
          make -C $(KDIR)  M=$(shell pwd) modules
  clean:
          make -C $(KDIR)  M=$(shell pwd) clean
  </code></pre>
  
  <p>When I try to compile I have this warning message:</p>
  
  <pre><code>WARNING: modpost: missing MODULE_LICENSE()
  </code></pre>
  
  <p>And then if I try to do insmod driver.ko I receive:</p>
  
  <pre><code>module verification failed: signature and/or required key missing - tainting kernel
  </code></pre>
  
  <p>How can I do?</p>