From: Wolfgang Denk <wd@denx.de>
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Cross compiling : problem linking
Date: Thu, 02 Oct 2003 17:01:44 +0200 [thread overview]
Message-ID: <20031002150149.4E451C59E4@atlas.denx.de> (raw)
In-Reply-To: Your message of "Thu, 02 Oct 2003 16:24:07 +0200." <1065104646.13376.8.camel@toni>
In message <1065104646.13376.8.camel@toni> you wrote:
>
> > Without more information (i. e. what sort of code this is and how you
> > intend it to run - stdandalone, in kernel or in user context) nobody
> > can help you.
>
> Final goal is a kernel module, but now I'm writing a test program in
> user space (standalone, dynamic compiled).
These are two completely different issues.
> Code is quite simple (but I'm unsure about the correctness, due to the
> fact that my C knowledge has collapsed since I didn't use it anymore
> last 2 years):
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <asm/io.h>
You're including a kernel header file here. You must not do this. The
functions / macros you're looking for are not available in user space
(for example, outb is #defined only when __KERNEL__ is defined which
is never the case for user space applications.)
> So somewhere, there is a linker problem.
No, it's a misunderstanding on your side. You cannot run kernel code
in user space or vice versa.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
I have yet to add the ESP-driver to the kernel to read the mind of
the user... - Linus Torvalds in
<Pine.LNX.3.91.960426110644.24860I-100000@linux.cs.Helsinki.FI>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next parent reply other threads:[~2003-10-02 15:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1065104646.13376.8.camel@toni>
2003-10-02 15:01 ` Wolfgang Denk [this message]
2003-10-06 13:09 Cross compiling : problem linking Fillod Stephane
-- strict thread matches above, loose matches on Subject: below --
2003-10-02 16:34 Fillod Stephane
2003-10-02 21:26 ` Wolfgang Denk
2003-10-03 8:26 ` Toni Van Remortel
2003-10-02 12:56 Toni Van Remortel
2003-10-02 13:26 ` Toni Van Remortel
2003-10-02 13:37 ` Wolfgang Denk
2003-10-02 13:35 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031002150149.4E451C59E4@atlas.denx.de \
--to=wd@denx.de \
--cc=linuxppc-embedded@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).