Unexpected output when printing to text video memory
Posted: Sat Apr 06, 2019 9:20 pm
Hello everyone . I develop a kernel in C and I created something that displays a message in the video memory.
But I had two cases: The first is that, when I do not make a link with a C file and the assembly kernel, the characters are displayed normally.
The second case, normally when I make a link with a C file, nothing happens.
In a way, I work on KAli linux. I have a C file, and two asm files. The C file is called screen.c which contains the character display functions. ASM files: a boot.asm for bootsectorwhich load PMODE and kernel.asm file (to use C code functions).
Here are the command lines I used to test my code:
gcc -m32 -c screen.c -o screen.o
nasm -f elf32 -o kernel.o kernel.asm
ld -m elf_i386 -Ttext 1000 kernel.o screen.o -o kernel
nasm -f bin -o boot boot.asm
cat boot kernel.o /dev/zero | dd of=floppyA bs=512 count=2880
Where is the problem ?
Can I give you my codes for more readability?
But I had two cases: The first is that, when I do not make a link with a C file and the assembly kernel, the characters are displayed normally.
The second case, normally when I make a link with a C file, nothing happens.
In a way, I work on KAli linux. I have a C file, and two asm files. The C file is called screen.c which contains the character display functions. ASM files: a boot.asm for bootsectorwhich load PMODE and kernel.asm file (to use C code functions).
Here are the command lines I used to test my code:
gcc -m32 -c screen.c -o screen.o
nasm -f elf32 -o kernel.o kernel.asm
ld -m elf_i386 -Ttext 1000 kernel.o screen.o -o kernel
nasm -f bin -o boot boot.asm
cat boot kernel.o /dev/zero | dd of=floppyA bs=512 count=2880
Where is the problem ?
Can I give you my codes for more readability?