kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Error in compiling Linux kernel after creating hello world system call
@ 2014-11-29 13:13 Jackson Isaac
  2014-11-29 13:27 ` Paul Bolle
  2014-11-29 21:30 ` Valdis.Kletnieks at vt.edu
  0 siblings, 2 replies; 3+ messages in thread
From: Jackson Isaac @ 2014-11-29 13:13 UTC (permalink / raw)
  To: kernelnewbies

Hi everyone,

I am trying to write hello world system call in linux but I am
encountering the following error when I run 'sudo make':

  ...
  AR      arch/x86/lib/lib.a
  LINK    vmlinux
  LD      vmlinux.o
ld: cannot find hello: File format not recognized
make: *** [vmlinux] Error 1

I have Linux 3.15.6 in my home directory and have created a hello
folder in it. I also made changes to makefile, syscalls.h, and
syscall_64.tbl

in make file I replaced

core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/
with
core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ hello

Can anyone point out where I am going wrong. I have made the changes
first and then I am trying 'sudo make'.

I tried making some minor modifications and running it again 3 4 times
but getting the same error and also it takes 2-3 hours of time.

Jackson Isaac
S5 B.Tech CSE
Amrita Vishwa Vidyapeetham
Jackson Isaac's Blog
Github/JacksonIsaac

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Error in compiling Linux kernel after creating hello world system call
  2014-11-29 13:13 Error in compiling Linux kernel after creating hello world system call Jackson Isaac
@ 2014-11-29 13:27 ` Paul Bolle
  2014-11-29 21:30 ` Valdis.Kletnieks at vt.edu
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Bolle @ 2014-11-29 13:27 UTC (permalink / raw)
  To: kernelnewbies

On Sat, 2014-11-29 at 18:43 +0530, Jackson Isaac wrote:
> I am trying to write hello world system call in linux but I am
> encountering the following error when I run 'sudo make':

Why "sudo"? That can't be right!

>   ...
>   AR      arch/x86/lib/lib.a
>   LINK    vmlinux
>   LD      vmlinux.o
> ld: cannot find hello: File format not recognized
> make: *** [vmlinux] Error 1
> 
> I have Linux 3.15.6 in my home directory and have created a hello
> folder in it. I also made changes to makefile, syscalls.h, and
> syscall_64.tbl
> 
> in make file I replaced

Which Makefile? Don't make us grep the tree, please.

> core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/
> with
> core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ hello

You said hello folder, so I'm _guessing_ you need to add
                                                         hello/

Note the slash.

> Can anyone point out where I am going wrong. I have made the changes
> first and then I am trying 'sudo make'.
> 
> I tried making some minor modifications and running it again 3 4 times
> but getting the same error and also it takes 2-3 hours of time.

Hope this helps,


Paul Bolle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Error in compiling Linux kernel after creating hello world system call
  2014-11-29 13:13 Error in compiling Linux kernel after creating hello world system call Jackson Isaac
  2014-11-29 13:27 ` Paul Bolle
@ 2014-11-29 21:30 ` Valdis.Kletnieks at vt.edu
  1 sibling, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-11-29 21:30 UTC (permalink / raw)
  To: kernelnewbies

On Sat, 29 Nov 2014 18:43:48 +0530, Jackson Isaac said:

> core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ hello

Depending where your .c is, this needs to be either hello/
or hello.o  (And if it's hello/, then hello/Makefile needs to reference
hello.o)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141129/47bb5bf6/attachment.bin 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-29 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-29 13:13 Error in compiling Linux kernel after creating hello world system call Jackson Isaac
2014-11-29 13:27 ` Paul Bolle
2014-11-29 21:30 ` Valdis.Kletnieks at vt.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).