That looks like some weird sort of function pointer, not an array. I'm not sure what you're even trying to do.
Even when running as root, your program gets run in user space, with its own private, virtual memory layout. You literally don't have any memory except pages the kernel has given you, every memory access is checked in hardware. Stray outside that range and your process dies with SEGV like any other.
[xander@localhost ~]$ gcc overflow.c -o over
overflow.c: In function ‘main’:
overflow.c:3:8: error: expected identifier or ‘(’ before ‘long’
overflow.c:3:13: error: expected ‘)’ before ‘(’ token
overflow.c:7:2: error: ‘array’ undeclared (first use in this function)
overflow.c:7:2: note: each undeclared identifier is reported only once for each function it appears in
overflow.c:8:1: warning: incompatible implicit declaration of built-in function ‘printf’
You agreed not to bump posts when you registered. If we don't answer instantly, wait!
Your program isn't running in real mode. You can't access physical addresses just by plugging in the right pointer.
The kernel keeps a list of what memory belongs to your process, and what address your process uses them at. It could give you physical memory address 0x0000000 but make it appear in your process at 0x80000000. And using any virtual addresses that haven't been assigned just causes SEGV. This is all handled in hardware by your processor.
If you want to access physical addresses in Linux, you have to actually ask for them. There's special device files you can read from to get it. /dev/kmem will be the kernel memory area and nothing but the kernel memory area. /dev/mem, I think, is raw RAM contents -- not that useful since the real pages could be scrambled in any virtual order inside the processes themselves. There's also things like memory holes for I/O to consider.
How to enable more than 4GB RAM support on Linux 32bit OS?
OS: CentOS release 5.4 (Final)
Kernel version: 2.6.18-53.el5
Arch: 32Bit
I got solution at Innovationframes.com • View topic - How to enable more than 4GB RAM support on Linux 32bit OS? but my question is the steps given... (5 Replies)
Hi
I am very new to Linux, but very keen to learn it.
I am having a desktop of 300 MHz with 128 MB RAM and 30 GB hard drive with Windows XP.
My first question is - Is there any version/flavour of Linux available that can be installed on above system especially Fedora with less compromise... (6 Replies)
Hi Gurus,
Can someone let me know how to find the RAM size,ROM size and Number of processors for a linux server.
Version :Linux 2.4.9-e.57smp
Also what does "e.57smp" stands for?
Thanks in advance gurus.....
cheers. (3 Replies)
I don't know a lot of the world of Linux, but i want to start with an old machine; did someone knows if i can install Linux in a computer with a processor Pentium (not celeron) @ 133 Mhz, 98Mb in RAM (PC100) and 3Gb Hard Drive?
a friend tell me about Ubuntu and openSUSE, but I don't know if... (5 Replies)
Hello all
i own p100 16ram laptop , i would like to run linux on it
i need it for gcc compilation and shell scripting , no gui.
what version of linux should i install , i dont mind to install old one .
tnx allot (5 Replies)
I wish to install Red Hat linux 7.1 on a machine with 16mb of EDO Ram. When I enter the instalation process I am told 'You do not have enough memory'. Is there a way to install RHL with only the 16? Or will I have to upgrade and buy some very expensive EDO.
~ Paul (3 Replies)
Has anyone had any experience with this new processor and its compatability with Linux/Unix? How did it preform comared to regular Athlons and P4's?
I also have one other question. I plan on buying a new dell and fiddling left and right with it. Which type of RAM is better, RDRAM or... (3 Replies)