x86-64

When to do or not do INVLPG, MOV to CR3 to minimize TLB flushing

北城余情 提交于 2019-12-02 20:27:11
Prologue I am an operating system hobbyist, and my kernel runs on 80486+, and already supports virtual memory. Starting from 80386, the x86 processor family by Intel and various clones thereof has supported virtual memory with paging. It is well known that when the PG bit in CR0 is set, the processor uses virtual address translation. Then, the CR3 register points to the top-level page directory, that is the root for 2-4 levels of page table structures that map the virtual addresses to physical addresses. The processor does not consult these tables for each virtual address generated, instead

Intel x86 0x2E/0x3E Prefix Branch Prediction actually used?

被刻印的时光 ゝ 提交于 2019-12-02 20:16:04
In the latest Intel software dev manual it describes two opcode prefixes: Group 2 > Branch Hints 0x2E: Branch Not Taken 0x3E: Branch Taken These allow for explicit branch prediction of Jump instructions (opcodes like Jxx ) I remember reading a couple of years ago that on x86 explicit branch prediction was essentially a no-op in the context of gccs branch prediciton intrinsics. I am now unclear if these x86 branch hints are a new feature or whether they are essentially no-ops in practice. Can anyone clear this up? (That is: Does gccs branch prediction functions generate these x86 branch hints?

I want to create a simple assembler in C. Where should I begin? [duplicate]

半世苍凉 提交于 2019-12-02 19:38:28
This question already has an answer here: Building an assembler 4 answers How Do You Make An Assembler? [closed] 4 answers I've recently been trying to immerse myself in the world of assembly programming with the eventual goal of creating my own programming language. I want my first real project to be a simple assembler written in C that will be able to assemble a very small portion of the x86 machine language and create a Windows executable. No macros, no linkers. Just assembly. On paper, it seems simple enough. Assembly code comes in, machine code comes out. But as soon as I thinking about

Installing pyaudio on AMD64 from .exe

你。 提交于 2019-12-02 19:17:53
问题 I want to install pyaudio on my Windows 8 x64 machine. I have Python 2.7 x64 installed. Building from source is not an option for me, and anyway I have seen that it failed for others. The Python 2.7 x64 .exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/ is not working. Is there another way to install? Are there any other places to download from? Thanks! 回答1: A very quick Google search yeieded the developers page with downloads. You can try the binary provided there. http://people.csail.mit

Are atomic variables lock-free?

偶尔善良 提交于 2019-12-02 18:46:44
When we talk about atomic variables, such as C++11's atomic<> , is it lock free? Or is lock-freeness something different? If I manage a queue with atomic variables, will it be slower than a lock-free queue? The standard does not specify if atomic objects are lock-free. On a platform that doesn't provide lock-free atomic operations for a type T, atomic<T> objects may be implemented using a mutex, which wouldn't be lock-free. In that case, any containers using these objects in their implementation would not be lock-free either. The standard does provide a way to check if an atomic<T> variable is

What are _mm_prefetch() locality hints?

故事扮演 提交于 2019-12-02 18:44:53
The intrinsics guide says only this much about void _mm_prefetch (char const* p, int i) : Fetch the line of data from memory that contains address p to a location in the cache heirarchy specified by the locality hint i. Could you list the possible values for int i parameter and explain their meanings? I've found _MM_HINT_T0 , _MM_HINT_T1 , _MM_HINT_T2 , _MM_HINT_NTA and _MM_HINT_ENTA , but I don't know whether this is an exhaustive list and what they mean. If processor-specific, I would like to know what they do on Ryzen and latest Intel Core processors. Sometimes intrinsics are better

OL7.7安装Oracle 11.2.0.4

血红的双手。 提交于 2019-12-02 18:18:20
安装环境准备工具 yum –y install oracle-rdbms-server-11gR2-preinstall 创建目录 mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1 mkdir -p /u02/oradata chown -R oracle:oinstall /u01 /u02 chmod -R 775 /u01 /u02 解压安装介质 unzip -q p13390677_112040_Linux-x86-64_1of7.zip -d ~ unzip -q p13390677_112040_Linux-x86-64_2of7.zip -d ~ 安装 export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 export DISPLAY=192.168.168.1:0.0 ~/database/runInstaller 然后一路图形点点点就好,检查告警交换空间不够 mount -o remount,size=4G /dev/shm 即可 来源: https://www.cnblogs.com/yongestcat/p/11757248.html

How to intercept a hot key in Cocoa when the application window is not active

南楼画角 提交于 2019-12-02 17:47:33
I am trying to create a utility that doesn't open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn't have a function for that, and that I should use a deprecated Carbon function. Isn't there really a way to use global hot keys in Cocoa? What should I do: wait for Cocoa to introduce a function for that, or use the carbon function until a similar function is not introduced in Cocoa? Use the Carbon Event Manager's RegisterEventHotKey function . This function is supported in 64-bit (notice that it lacks the “not available in 64-bit” availability

Comparing 16 bit numbers in nasm produces wrong results

☆樱花仙子☆ 提交于 2019-12-02 17:04:17
问题 I have just started learning assembly. I am coding nasm in 32 bit mode. I am trying to compare 3 numbers inputted by the user and print the largest number. However, I cannot seem to correctly compare the numbers if I only reserve 16 bits for each number using resb 2. I do, however, get correct results when I reserved 32 bits for the numbers using resw 2. I cannot understand why this is the case. Here is my code: SYS_EXIT equ 1 SYS_WRITE equ 4 SYS_READ equ 3 STD_IN equ 0 STD_OUT equ 1 segment

Why “mov rcx, rax” is required when calling printf in x64 assembler?

牧云@^-^@ 提交于 2019-12-02 17:04:10
问题 I am trying to learn x64 assembler. I wrote "hello world" and tried to call printf using the following code: EXTERN printf: PROC PUBLIC hello_world_asm .data hello_msg db "Hello world", 0 .code hello_world_asm PROC push rbp ; save frame pointer mov rbp, rsp ; fix stack pointer sub rsp, 8 * (4 + 2) ; shadow space (32bytes) lea rax, offset hello_msg mov rcx, rax ; <---- QUESTION ABOUT THIS LINE call printf ; epilog. restore stack pointer mov rsp, rbp pop rbp ret hello_world_asm ENDP END At the