Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:38:38+00:00 2026-06-17T20:38:38+00:00

In x86 architecture, there are some segment registers such as SS, CS, DS, FS,

  • 0

In x86 architecture, there are some segment registers such as SS, CS, DS, FS, GS.

I know that these 16bit registers indicates the
LDT, GDT entries(as segment selector) and MMU references
this(GDT, LDT) to calculate segment base + offset value. and check permissions
and etc.

What I am curious is: who fills in the segment register contents based on what? The kernel scheduler?

And what happens when application changes the segment register value itself?
I know that only CS can not be changed because it has CPL of current CPU.
but other registers(SS, DS…) can be changed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:38:39+00:00Added an answer on June 17, 2026 at 8:38 pm

    who fills in the segment register contents based on what??(kernel scheduler??)

    The bootloader does. ISRs and exception handlers do. System call handlers do. The scheduler does. Some other parts may need to. The registers are assumed to be private and have to be saved and restored during various context switches. And, of course, they need to be initialized at some prior point too.

    Based on what needs to be in those registers. Their values are not universally shared between different parts of the OS and between different programs.

    and what happens when application changes the segment register value it self? I know that only CS can not be changed because it has CPL of current CPU. but other registers(SS, DS…) can be changed.

    What happens? It either changes it successfully or causes an exception (typically, #GP) and then happens whatever the exception handler does or, if there’s none or it’s buggy, a triple fault, a CPU reset and probably a reboot of the entire computer.

    You can change any segment register if you somehow know what else can be loaded into it at the current privilege level. If your program is at level 3 and there are two code segments with DPL=3 set up for it by the OS, the program can use either of them for the CS register. If you don’t know that, you’re more likely to just crash the program.

    I want to know details of x86 segment registers.

    Get yourself a copy of and read:

    Intel® 64 and IA-32 Architectures Software Developer’s Manual Combined Volumes: 1, 2A, 2B, 3A and 3B.

    You can either go by the relevant chapters (memory management, interrupt/exception handling, task switching) or search for specific registers (e.g. CS or SS or DS) or look at the description of and pseudo-code for specific instructions.

    You’re not going to get any more precise answers to the questions this vague.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read in a tutorial that some 15 instructions in x86 architecture is not
I am curious to know if there exists an architecture that is quicker for
I read the following statement: The x86 architecture includes a specific segment type called
I am optimizing some code for an Intel x86 Nehalem micro-architecture using SSE intrinsics.
I have an application that was developed for Linux x86 32 bits. There are
I'm familiar with X86[-64] architecture & assembly. I want to start develop for an
I would like to learn the x86 Instruction Set Architecture. I don't meaning learning
I heard on Windows x64 architecture, in order to support to run both x86
In x86 GNU Assembler there are different suffixes for memory related operations. E.g.: movb,
I have a C header file (it's a part of some SDK) and there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.