LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2016, 06:35 AM   #1
avish78
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Rep: Reputation: Disabled
getting start and end user space address in c


Hi,
I want to receive the start and end physical address of the user space in Linux. Is there a system function that I can use?
Also is there a system function that I can save a value to those address?
 
Old 01-05-2016, 08:05 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
do you mean the function getrlimit (see man page)?
 
Old 01-05-2016, 09:19 AM   #3
avish78
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,
Thanks for your reply.
No - I did not explain my problem correctly. As I understand there is system call mmap - which map a device to the memory of the program so I can read\write to this memory and it will be written to the device. My problem is that I can not find this device under /sys. Is there a way to get in the program a list of all the devices in the system?
 
Old 01-05-2016, 09:50 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Try again, maybe the third time will be lucky: what do you actually want to achieve?
(A note: mmap works with 'files' (disk files, to be precise), not generally 'devices')

Last edited by NevemTeve; 01-05-2016 at 09:51 AM.
 
Old 01-11-2016, 06:33 AM   #5
genss
Member
 
Registered: Nov 2013
Posts: 741

Rep: Reputation: Disabled
Quote:
Originally Posted by avish78 View Post
Hi,
Thanks for your reply.
No - I did not explain my problem correctly. As I understand there is system call mmap - which map a device to the memory of the program so I can read\write to this memory and it will be written to the device. My problem is that I can not find this device under /sys. Is there a way to get in the program a list of all the devices in the system?
to get the definite list of all devices on your computer, you would go through /sys
this is clearly demonstrated by running
strace -e trace=file -f lsusb
or
strace -e trace=file -f lspci

other way, the one that gets all initialized devices, is to look at all the nodes in /dev
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PCI express driver, map physical bus address to user-space orback Linux - Kernel 0 11-26-2009 03:12 PM
How can I strip white space from the start and end of fields using awk? jonnymorris Programming 7 10-02-2008 10:52 PM
linux driver how to mmap many kernel address to user space soararing Programming 1 05-22-2008 05:32 AM
Kernel and user space address ? ashok449 Linux - Kernel 1 12-29-2007 12:17 PM
Mmap and munmap physical address to user space karttik Linux - Software 0 10-28-2007 02:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration