memory-segmentation Questions

3

I'm reading the intel manual, and I see mentions of "Linear Address Space of the processor". I'm confused as to where or what the linear address space actually is. Where in the processor ...
Xiphoid asked 25/6, 2020 at 23:24

1

I debug a program with gdb for fun, with stack guard so it writes the canary to the stack from fs:28h. Out of curiosity, I trying to find the memory address that fs:28h points to. I encounter two p...
Branum asked 22/7, 2023 at 20:10

1

Solved

I have stumbled upon this kernel page: https://www.kernel.org/doc/html/v5.9/x86/x86_64/fsgs.html and wanted to play around with LD_PRELOAD to see whether I can allocate a value at a load-time and r...
Wafd asked 8/7, 2023 at 22:36

3

Solved

Specifically is: mov %eax, %ds Slower than mov %eax, %ebx Or are they the same speed. I've researched online, but have been unable to find a definitive answer. I'm not sure if this is a sill...

2

Solved

In what I've learned so far about segmentation: A virtual address contains a segment selector and an offset The segment selector is used in conjunction with the GDTR to find the linear address of...

4

Solved

I was recently answering a question on the undefined behaviour of doing p < q in C when p and q are pointers into different objects/arrays. That got me thinking: C++ has the same (undefined) beh...

3

Solved

gdb provides functionality to read or write to a specific linear address, for example: (gdb) x/1wx 0x080483e4 0x80483e4 <main>: 0x83e58955 (gdb) but how do you specify a logical address ?...
Stephanus asked 27/4, 2012 at 16:6

1

Solved

I am studying the issue of alignment check. But I don't know whether the processor is checking on effective addresses, linear addresses or physical addresses, or all checks. For example, the effect...
Narrows asked 16/6, 2021 at 10:38

6

Solved

So I know what the following registers and their uses are supposed to be: CS = Code Segment (used for IP) DS = Data Segment (used for MOV) ES = Destination Segment (used for MOVS, etc.) SS = Stac...

1

Solved

I am attempting to code a simple stack canary in 64-bit assembly using NASM version 2.15.04 on Ubuntu 20.10. Executing the code below results in a segmentation fault when assembling and linking wit...

1

Solved

I read a number of articles and S/O answers saying that (on linux x86_64) FS (or GS in some variants) references a thread-specific page table entry, which then gives an array of pointers to the act...
Sturgis asked 16/12, 2020 at 12:12

3

Solved

I am writing my own OS for 64bit processors and I am stuck with the problem of general protection. My OS will not rely on page fault to implement user space protection mechanism, so I found there i...
Barimah asked 22/10, 2011 at 17:20

1

Solved

In x86_64, fs and gs registers involve in a limited form of segmentation. Just taking, fs as an example, how does fs register, FSBase MSR work together to generate the effective address? What happ...

3

Solved

Is there some way to read the x86-64 model-specific registers, specifically IA32_FS_BASE and IA32_GS_BASE, while debugging a program using GDB? Less preferable would be a solution using a dynamic ...
Yarkand asked 15/4, 2014 at 22:24

1

Solved

What are the differences among all these things : flat addresses ,base address , linear addresses , effective addresses, physical address , effective address calculations ???

2

Solved

I have learned about compilers and assembly language, so I'd like to write my own assembler as an exercise. But there I have some questions; How can I compute the address for segments such as @DAT...

1

Solved

This question is inspired by a Reddit question in r/osdev except that this question focuses on the SS register. One may say RTFM (ISA entry for MOV), but when this question comes up it can get vary...
Alchemy asked 9/8, 2019 at 19:33

1

In x86, when you want to access a memory address, you would specify an address that would be translated into a memory address through two stages: segmentation, and paging: But is segmentation al...
Spiny asked 26/7, 2019 at 15:5

2

The movsb (move string, bytes) instruction fetches the byte at address ds:si, stores it at address es:di, and then increments or decrements the si and di registers by one. I know esi,si and e...

2

Solved

Looking into the internals of Linux and memory management, I just stumbled upon the segmented paging model that Linux uses. Correct me if I am wrong, but Linux (protected mode) does use paging for...
Meow asked 20/5, 2019 at 2:4

2

Solved

What is linear address? How is it different from physical address?

2

Solved

In studying operating systems (primarily with Linux as reference), there are a few points that I don't find well explained in the material that I have studied. Programs loaded into memory are ofte...
Sauerbraten asked 26/2, 2012 at 23:45

1

Solved

According to AMD manual segmentation can not be disabled. My question is why, why it's impossible? Another question, it says that 64-bit disables it, what does that mean? Is segmentation completly ...
Coagulate asked 13/4, 2018 at 7:22

3

Solved

void return_input (void) { char array[30]; gets (array); printf("%s\n", array); } After compiling it in gcc, this function is converted to the following Assembly code: push %ebp mov %e...

2

I have one doubt regarding the size of segments in real mode as they can't be more than 64K but can be less than that. My question is how these segment size and base address is initialized? Like th...
Adagio asked 22/7, 2013 at 11:24

© 2022 - 2024 — McMap. All rights reserved.