memory-segmentation

Linux memory segmentation

ⅰ亾dé卋堺 提交于 2021-02-18 10:48:06
问题 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 mapping a linear virtual address space to the physical address space. This linear address space constituted of pages, is split into four segments for the process flat memory model, namely: The kernel code segment ( __KERNEL_CS ); The kernel data segment ( __KERNEL_DS ); The user code segment ( _

What does the D flag in the code segment descriptor do for x86-64 instructions?

谁说我不能喝 提交于 2021-02-10 18:14:50
问题 I'm trying to understand the workings of the D flag in the code segment descriptor when used in the x86-64 code. It's set in the D/B bit 22 of the code segment descriptor as shown on this diagram: The Intel documentation (from section 3.4.5 Segment Descriptors) states the following: D/B (default operation size/default stack pointer size and/or upper bound) flag Performs different functions depending on whether the segment descriptor is an executable code segment, an expand-down data segment,

Is segmentation completely not used in x64?

我怕爱的太早我们不能终老 提交于 2021-01-19 06:15:15
问题 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 also used in x64? (I think it is not used, but I am not sure if it is not used in all cases, or are there some cases where it is used). 回答1: For the purpose of the picture you posted, segmentation is only used when the addressing mode uses the registers fs or gs (because these were being actively

Assembly Segments in opcodes

强颜欢笑 提交于 2020-08-21 05:29:31
问题 I noticed that in Assembly segments are used in opcodes. Example: MOV DWORD PTR SS:[EBP-30],30 I think that "PTR SS:" is used to specify that EBP-30 comes from the stack? (SS: stack segment) Am I right or am I completely wrong? :) And, could you please tell me the difference between the example above and MOV DWORD PTR[EBP-30],30 And what about DS (data segment) used in opcodes? 回答1: MOV DWORD PTR SS:[EBP-30],30 There are two separate modifiers here, DWORD PTR and SS: . The first one tells us

Assembly Segments in opcodes

偶尔善良 提交于 2020-08-21 05:28:59
问题 I noticed that in Assembly segments are used in opcodes. Example: MOV DWORD PTR SS:[EBP-30],30 I think that "PTR SS:" is used to specify that EBP-30 comes from the stack? (SS: stack segment) Am I right or am I completely wrong? :) And, could you please tell me the difference between the example above and MOV DWORD PTR[EBP-30],30 And what about DS (data segment) used in opcodes? 回答1: MOV DWORD PTR SS:[EBP-30],30 There are two separate modifiers here, DWORD PTR and SS: . The first one tells us

What do ds:si and es:di mean in assembly?

こ雲淡風輕ζ 提交于 2020-07-18 04:19:19
问题 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 edi,di registers, but not ds:si and es:di , what do they mean? 回答1: ds:si and es:di mean the segment:offset referred to by the registers in question. This is primarily important when you're working in real mode (where offsets are a maximum of 64K apiece). In real mode, the segment are offset are combined