Write to a specific memory space.


 
Thread Tools Search this Thread
Operating Systems BSD Write to a specific memory space.
# 1  
Old 11-29-2011
Tools Write to a specific memory space.

Hello all. I need a simple way to write to a specific memory space (/dev/mem). In a bash script if possible. (I am using dd to read the changes) Thanks in advace.

Last edited by Scott; 11-29-2011 at 01:24 PM.. Reason: Double post. Closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to write a space with sed?

Hi, I wish insert a line into a file, I created it with : #-------------------------------------------------------------- # The loopback network interface #-------------------------------------------------------------- auto lo iface lo inet loopback ... (7 Replies)
Discussion started by: Arnaudh78
7 Replies

2. Shell Programming and Scripting

Memory space

It would be great if you tell me how to check the ram memory size in unix machine RAM memory size check (10 Replies)
Discussion started by: arun888
10 Replies

3. Programming

Write to a specific memory space.

Hello all. I need a simple way to write to a specific memory space (/dev/mem). In a bash script if possible. (I am using dd to read the changes) Thanks in advace. (4 Replies)
Discussion started by: King_Richee
4 Replies

4. Programming

Linux read and write external memory.

Hi everyone. I asked once here and it went well, so I'm very happy with this community. I have a new question to ask. I would like to read&write specify memory of a process which is not the process I'm doing it from, nor a child nor a parent. So, I want to do a program similar to Cheat... (3 Replies)
Discussion started by: lilezek
3 Replies

5. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

6. UNIX for Dummies Questions & Answers

Write/Read in Shared memory

I have created and attached a shared memory segment. However I do not know how am I supposed to write and read data from it. I want to save various different data on this segment such as process IDs and other. Do you know how am I supposed to write these and be able to read such data in the correct... (1 Reply)
Discussion started by: tyron
1 Replies

7. Programming

Urgent!!!! - Write/read to/from shared memory

I created a shared memory and attached it. I also created the appropriate semaphores to sync. my read/write operations. However I do not know how am I supposed to do so. Anyone has got any ideas? I want to write int the form of 1234:23:444:... where each number between : means something to the... (0 Replies)
Discussion started by: tyron
0 Replies

8. Programming

Write into shared memory segments

I have created a shared memory segment (which size is 64 bytes) using shmget, shmat e.t.c and i want to divide it into 2 areas. One area for input data and one area for output? How can i do that? Furthermore, When i have to write my input data into the shared memory segment i want to write... (3 Replies)
Discussion started by: mae4
3 Replies

9. Programming

shared memory read/write using threads

I am looking for C program source code. Could you please help me in finding the source code required mentioned below. program to create multiple threads (one master thread and rest worker threads) and using the threads write into and read from shared memory Restrictions: Only one thread... (2 Replies)
Discussion started by: kumars
2 Replies

10. Shell Programming and Scripting

Memory/virtual space

HP UNIX version 10.20 I have been using system variable names in some shell scripts in order to automate execution of some test software. I have recently found that there appears to be a restriction with the 'ls' command when listing specific files (e.g. ls *.c). If I pipe the output into wc, I... (5 Replies)
Discussion started by: degwright
5 Replies
Login or Register to Ask a Question
mem(7D) 							      Devices								   mem(7D)

NAME
mem, kmem, allkmem - physical or virtual memory access SYNOPSIS
/dev/mem /dev/kmem /dev/allkmem DESCRIPTION
The file /dev/mem is a special file that provides access to the physical memory of the computer. The file /dev/kmem is a special file that provides access to the virtual address space of the operating system kernel, excluding memory that is associated with an I/O device. The file /dev/allkmem is a special file that provides access to the virtual address space of the operating system kernel, including memory that is associated with an I/O device. You can use any of these devices to examine and modify the system. Byte addresses in /dev/mem are interpreted as physical memory addresses. Byte addresses in /dev/kmem and /dev/allkmem are interpreted as kernel virtual memory addresses. A reference to a non-existent location returns an error. See ERRORS for more information. The file /dev/mem accesses physical memory; the size of the file is equal to the amount of physical memory in the computer. This size may be larger than 4GB on a system running the 32-bit operating environment. In this case, you can access memory beyond 4GB using a series of read(2) and write(2) calls, a pread64() or pwrite64() call, or a combination of llseek(2) and read(2) or write(2). ERRORS
EFAULT Occurs when trying to write(2) a read-only location (allkmem), read(2) a write-only location (allkmem), or read(2) or write(2) a non-existent or unimplemented location (mem, kmem, allkmem). EIO Occurs when trying to read(2) or write(2) a memory location that is associated with an I/O device using the /dev/kmem special file. ENXIO Results from attempting to mmap(2) a non-existent physical (mem) or virtual (kmem, allkmem) memory address. FILES
/dev/mem Provides access to the computer's physical memory. /dev/kmem Provides access to the virtual address space of the operating system kernel, excluding memory that is associated with an I/O device. /dev/allkmem Provides access to the virtual address space of the operating system kernel, including memory that is associated with an I/O device. SEE ALSO
llseek(2), mmap(2), read(2), write(2) WARNINGS
Using these devices to modify (that is, write to) the address space of a live running operating system or to modify the state of a hardware device is extremely dangerous and may result in a system panic if kernel data structures are damaged or if device state is changed. SunOS 5.11 18 Feb 2002 mem(7D)