5,338 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
40
views
Can I change the output of the disassembly of my bootloader in GDB with QEMU session?
I know that load a flat binary file to GDB is not sufficient when you need the symbols to debug the programs and follow the flow of the program, because it don't have a valid format of GNU/Linux ...
2
votes
0
answers
62
views
Difference between db string and other data sizes in assembly for strings [duplicate]
Assume this code in x86_64 assembly:
section .data
msg db "Hello, world!"
section .text
global _start
_start:
;; system call 1 is sys_write
mov rax, 1
...
1
vote
0
answers
54
views
How to debug data label in bootloader
Here is context of my work how to get IDT handler address in assembly In order to confirm that I am calculating correctly the IDT handler offset high part, I created this simple bootloader and I want ...
5
votes
0
answers
121
views
how to get IDT handler address in assembly
I am experiencing with OS programming I wrote a simple bootloader in assembly and I switched to protected mode. I want just to test interruption (keyboard) I did not want to do it with C but just in ...
0
votes
0
answers
64
views
Bootloader stopped working after I changed the syntax from gas to nasm
I have this bootloader I made a while ago and I would like it to be in nasm:
.intel_syntax noprefix
.code16
.equ STACK_TOP, 0x7C00
.equ SELF_LOAD, 0x7C00
.equ ELF_HDR_LOAD, 0x7E00
.equ SECT_SIZE, ...
2
votes
1
answer
106
views
printf wont work when linking to ucrtbase.dll, but works when linked to msvcrt.dll (Windows, NASM)
I am struggling to get printf to work for me in NASM while linking to ucrt.dll, It works 0 problems when I link to msvcrt.dll for printf, but I am trying to practice with something a little newer.
I ...
-1
votes
0
answers
22
views
Wrong string address when converting nasm bootloader to gas (error : relocation truncated to fit) [duplicate]
I am trying to imitate a simple bootloader written in nasm I want to try a gas version
Here is the code with nasm:
[org 0x7c00]
mov ah, 0x0e
mov al, [var]
int 0x10
jmp $
var:
db "Hello",...
5
votes
1
answer
103
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
97
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: &...
5
votes
1
answer
89
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 ...
2
votes
0
answers
86
views
Where am I wrong with writing transition from protected mode to IA-32e mode?
I try to code the transition from protected mode to IA-32e mode. It's a task in college. The problem that I can't debug 32 bit bootloader. I can only run QEMU and tell based on its output whether this ...
0
votes
1
answer
80
views
How to compare a keyboard input in assemble language NASM
I have code that is comparing a keyboard input which will be a number/ integer.
However when I test it, it doesn't jmp if equal. I am not sure what value it is tested against. For example I have tried ...
3
votes
2
answers
130
views
Is there any way to move a string into a variable?
I was playing around in assembly and noticed that it's possible to overwrite a string in a variable as long as the new string does not exceed the size of the original string:
MESSAGE DB 'Hello World', ...
3
votes
2
answers
393
views
Making an absolute 64-bit jump in x64 assembler which can be copied as a JIT
I am trying to port some code from linux to windows. I need to assemble a jump to an absolute address, using nasm, such that the same bytes will jump to the same address, no matter where the code is ...
2
votes
1
answer
127
views
NASM - empty macro with 2 parameters? What register is represented by parameter_m?
I'm in the process of porting NASM code to MASM, and I'm stuck on a NASM empty macro with 2 parameters and register usage with the _m suffix.
example code:
;register defines
%define arg0 rcx
%define ...