17,990 questions
Advice
2
votes
2
replies
39
views
Using EMMS defensively to clear dirty FPU stack before fild sequence?
Our memory manager uses x87 FPU for 32-64 byte copies on legacy 32-bit x86:
fild qword ptr [eax] ; push 8 bytes
fild qword ptr [eax+8] ; push 8 more...
; 4 total fild, then fistp in ...
1
vote
0
answers
98
views
interrupt(): gate descriptor is not valid sys seg (vector=0x0X)
I am making my own UNIX like OS called Connor's UNIX and I am implementing kernel and userspace separation and I have been all day and this is as far as I can get it to work and if you need any more ...
Tooling
4
votes
3
replies
95
views
An alternative software to Visual Studio for x86 Assembly programming on Windows 10
I'm starting to learn x86 Assembly but Visual Studio refuses to be installed ("Sorry, something went wrong. The install operation failed") on my (Windows 10) machine; I've researched and ...
Advice
0
votes
4
replies
191
views
Why does GCC transform a >= 4 into a > 3 at -O0? JG seems to be more complex than JGE
Title: Why does GCC transform a >= 4 into a > 3 at -O0? JG seems more complex than JGE
I'm analyzing a simple C code on godbolt and found GCC's code generation puzzling:
long a;
a = a >= 4;
...
2
votes
2
answers
119
views
Printing to VGA in protected mode crashes system
As you can see down at bottom on my stage 2 boot loader, I have a VGA write thing (Prints out "Starting kernel...", but when I use it, the system starts to boot loop, I have no idea why this ...
1
vote
0
answers
77
views
Can't assemble bare-metal i586 protected mode no paging code using openwatcom1.9
I'm trying to compile code in OpenWatcom 1.9 written in assembly.
On Windows, utils in use:
wasm
msys2
command:
/d/Maksym/WATCOM/binnt/wasm.exe -5p kstart.asm -fo=kstart.obj
output:
Open Watcom ...
5
votes
1
answer
79
views
Bootloader crashing when jumping to 0x100000
I am having a problem with a bootloader I made. Mostly used code snippets from wiki.osdev.org, and screeck (on Github and Youtube) . The issue is: the bootloader cannot jump farther than 0xFFFFF, and ...
2
votes
1
answer
86
views
How and why does my program change its input buffer? Using GDB to find out where. (Converting string to int in NASM x86 32bit)
%macro mov_dd 2
push eax
push ebx
mov dword eax, [%1]
mov ebx, [eax]
mov dword [%2], ebx
pop ebx
pop eax
%endmacro
section .data
text db "Enter first Number: &...
1
vote
1
answer
112
views
Does Intel CPU have instruction for paging translation result
I wonder if Intel (and Intel compatible) CPUs have an instruction (for diagnostic/debugging purposes) which, for a given linear address, returns the result of paging translation (i.e. the ...
4
votes
1
answer
111
views
nasm bios int 13h read sector issue [duplicate]
im trying to make a simple bootloader that loads a simple kernel and the problem is that the kernel code doesnt run i do see prints from the bootloader but not from the kernel here is my code:
boot....
0
votes
1
answer
60
views
Paging in x86: what exactly is divided into pages, and why does the linear address behave differently depending on paging?
I'm trying to fully understand how paging works in the x86 architecture when segmentation is also enabled.
I have a couple of questions:
Does paging divide the logical memory (the selector + offset ...
2
votes
1
answer
146
views
Why std::atomic<uint64_t>{}.is_lock_free() is true when targets for x86 (32 bits platform) in Visual Studio? [duplicate]
I noticed std::atomic<uint64_t>{}.is_lock_free() returns true even if I switch the target platform to x86 in Visual Studio. I also checked the disassembly of an uint64_t assignment like below.
...
3
votes
0
answers
157
views
The cost of non contiguous reads and writes (naive matrix transpose, power-of-2 and other sizes)
I was benchmarking a naive transposition and noticed a very large performance discrepancy in performance between:
a naive operation where we read data contiguously and write with a large stride;
the ...
5
votes
1
answer
82
views
write(2) syscall returns EFAULT for string in .rodata on OpenBSD 7.3--7.8
I'm writing a hello-world program in i386 assembly for OpenBSD 7.8. The program works if the string (buf argument of write(2)) is in .data or on the stack, but write(2) returns EFAULT (== 14) if the ...
Advice
0
votes
2
replies
90
views
Determine used micro architecture level in executable linkable format (ELF) on x86
I have some troubles with prebuilt development tools (compiler, linker, ...) on my very old workstation. Because the CPU from my old system only supports the micro architecture level x86-64-v1 it ...