Re: C and Low-level Storage (was: I need a new compiler...
- From: Paul <paul-nospamatall.raulerson@xxxxxxx>
- Date: Tue, 16 Dec 2008 21:41:34 -0600
On 2008-12-16 17:02:31 -0600, "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxxxxx> said:
<much debate snipped>
Michael Wojick,
I can't tell. Have you been debating a "real-world" issue or a philosophical
one?
In other words, are there existing implementations of C that (as required)
support "pointers" but do NOT allow (or support) pointers that "get the
program" to system-level storage?
I am NOT a C programmer, but when I have interacted with those that do use it,
it seems to me that all implementations that they use DO allow the C program to
access (at least "read") data at "system controlled" (low-level?) storage.
It is also true, that some "systems" do NOT allow the "average" C (or Assembler
or whatever) program to MODIFY "system-controlled" storage, but that is a
different question (to me) than accessing such storage.
If there are C implementations that do not allow programmers to "read" the
storage where "system control blocks, etc" reside, I would be interested in
which C and on what platforms these exist.
If you are just stating that the C Standard does not REQUIRE this, then that may
be "nice to know" - but is different from what actual implementations DO.
If I understand what you are saying Bill, you are asking if C the language can access "system memory."
Technically, C can access any address the machine can provide access to, including any system storage.
Practially speaking, the Operating System, and sometimes the hardware, protects some areas of memory. This is especially true in all our modern systems like z/OS, Linux, z/VM, and even Windows, since applications run in a designed application space.
For example, on my zLinux systems, every application in the system loads and run from address X'400000'. Of couse, that is a *virtual* address, which means there may be a thousand applcations running from the virtual address, but from 1000 different real addresses. It gets complex, because sometimes text (code) sections are designated read-only in memory, and only one copy of them is loaded. (This is Linux,
drives z/OS programmers crazy because they cannot store variable in the code section - at least if they ever intend to change those variable's values... :)
And then you get into shared memory segments. Take the same chunk of real memory, attach it to one or more applications - at different virtual addresses.
Like I said, it gets complex. Fun though. :)
Another point to consider, most of Unix, including the kernel level code (which by the way, usually *does* have access to every real memory address, system and application....) is written in plain old C. Just a couple or three thousand lines of assembler, and the rest, millions of lines of code, in C.
Just out of curiousity - are there any OS's written in Cobol?
I don't know of any, but I bet there are one or two out there. :)
.
- Follow-Ups:
- Re: C and Low-level Storage
- From: Michael Wojcik
- Re: C and Low-level Storage (was: I need a new compiler...
- From: Richard
- Re: C and Low-level Storage (was: I need a new compiler...
- From: Richard
- Re: C and Low-level Storage
- References:
- I need a new compiler...
- From: Paul H
- Re: I need a new compiler...
- From: Paul
- Re: I need a new compiler...
- From:
- Re: I need a new compiler...
- From: Michael Wojcik
- Re: I need a new compiler...
- From:
- Re: I need a new compiler...
- From: Michael Wojcik
- Re: I need a new compiler...
- From:
- Re: I need a new compiler...
- From: Howard Brazee
- Re: I need a new compiler...
- From:
- Re: I need a new compiler...
- From: Michael Wojcik
- C and Low-level Storage (was: I need a new compiler...
- From: William M. Klein
- I need a new compiler...
- Prev by Date: Re: I need a new compiler...
- Next by Date: Re: C and Low-level Storage (was: I need a new compiler...
- Previous by thread: Re: C and Low-level Storage
- Next by thread: Re: C and Low-level Storage (was: I need a new compiler...
- Index(es):
Relevant Pages
|