All of lore.kernel.org
 help / color / mirror / Atom feed
From: ralf@uni-koblenz.de
To: Amol Mohite <amol@m-net.arbornet.org>
Cc: linux-mm@kvack.org
Subject: Re: Somw questions [ MAYBE OFFTOPIC ]
Date: Tue, 6 Apr 1999 12:55:58 +0200	[thread overview]
Message-ID: <19990406125558.C3742@uni-koblenz.de> (raw)
In-Reply-To: <Pine.BSI.3.96.990405050919.3415A-100000@m-net.arbornet.org>; from Amol Mohite on Mon, Apr 05, 1999 at 05:12:50AM -0400

On Mon, Apr 05, 1999 at 05:12:50AM -0400, Amol Mohite wrote:

> > A NULL pointer is just yet another invalid address.  There is no special
> > test for a NULL pointer.  Most probably for example (char *)0x12345678
> > will be invalid as a pointer as well and treated the same.  The CPU
> > detects this when the TLB doesn't have a translation valid for the
> > access being attempted.
> 
> Yes but how does it know it is a null pointer ?

Again, it doesn't know that it is a *NULL* pointer.  The kernel just knows
that a user program resulted in the CPU throwing an exception for attempting
an illegal access, that is insufficient permissions for the mapping or
no mapping for the address at all.

> On that note, when c does not allow u to dereference a void pointer , is
> this compiler doing the trick ?

Only ANSI/ISO C doesn't allow to dereference void pointers, GCC allows this
as an extension of the language.  Most machines only have untyped pointers,
for them void * or not would only a difference to the compiler, not the
machine - if the compiler allows it.

> Ok , about the expand down attribute, thats how 32 bit windows does it, so
> i was wondering if linux also does the same.
> 
> 16 bit windows accesses a null pointer with a 0: descriptor.
> 
> Apparently intel allows u to load a 0 but not dererence it.

  Ralf
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

  reply	other threads:[~1999-04-06 20:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-01  9:16 Somw questions [ MAYBE OFFTOPIC ] Amol Mohite
1999-04-02  9:35 ` ralf
1999-04-02 18:56   ` Chris Atenasio
1999-04-05  9:12   ` Amol Mohite
1999-04-06 10:55     ` ralf [this message]
1999-04-06 22:51     ` Stephen C. Tweedie

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=19990406125558.C3742@uni-koblenz.de \
    --to=ralf@uni-koblenz.de \
    --cc=amol@m-net.arbornet.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.