LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2021, 07:31 AM   #1
RobotMan
LQ Newbie
 
Registered: Aug 2021
Posts: 1

Rep: Reputation: Disabled
Does a segment descriptor type represent a segments READ/WRITE/EXECUTE permissions?


I'm am reading understanding the linux kernel, third edition and I was reading the section about segment descriptors. Page: 70, http://gauss.ececs.uc.edu/Courses/c4...erstanding.pdf of all the fields for the segment descriptor I could not find any permission fields for READING, WRITING, and EXECUTING. I read that from this source, http://www.cs.cmu.edu/~410/doc/segments/segments.html that the READ, WRITE, and EXECUTE segment permissions are derived from the (type) field of the segment descriptor.

Code:
"It turns out that while the segment descriptor TYPE field allows us to specify a wide variety of segment permissions, there is no bit pattern which grants both EXEC and READ/WRITE permissions. Thus we need one READ,EXEC segment for code and one READ,WRITE segment for data and stack. So we will need two segment descriptors and two segment selectors, one for %CS and one for %SS, %DS, %ES, %FS, and %GS."
So are the READ, WRITE, and EXECUTE permissions derived from the type of the segment? Also is the quote stated above true about why there are separate segments for code and data(even though linux uses a flat memory model so no matter what segment you use it will all resolve to the same linear/virtual address)?

I know that the page table entries are responsible for saying if the page is either READ/WRITE or only READ, but I'm just wondering if the above quote is the reason for the code and data segments being separate(even though linux uses a flat memory model so no matter what segment you use it will all resolve to the same linear/virtual address).
 
Old 08-11-2021, 06:37 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,707
Blog Entries: 4

Rep: Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949Reputation: 3949
This has directly to do with the architecture of the CPU in question, and not every CPU is the same.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) sachinmm Programming 2 05-05-2016 11:57 PM
[SOLVED] calculating average segment after segment using AWK vjramana Programming 2 03-21-2012 01:08 AM
Help needed in removing intermediate segments from a pipe delimited segment file naren_0101bits Programming 12 12-03-2007 10:47 AM
Bridging the Wired Segment (Ethernet) & Wireless Segments (Access Point) Paris Heng Linux - Wireless Networking 0 07-14-2007 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:20 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