as I finally tried to enter operating system development I've encountered a weird problem using the following code:
Code: Select all
struct ConsoleCell cell;
for (i = 0; i < (80 * 25); i++)
{
cell.character = '0' + (i % 10);
cell.attributes = 0x07;
videomem[i] = cell;
}
Code: Select all
struct ConsoleCell
{
char character;
unsigned char attributes;
} __attribute__((packed));
Code: Select all
videomem = (ConsoleCell*) 0xb8000;
Additionally, when I try to set a random character using the following code after filling the screen, nothing happens.
Code: Select all
struct ConsoleCell cell;
cell.character = c;
cell.attributes = 0x35;
videomem[y * 80 + x] = cell;
I'm compiling my code on an x86_64 using the following tools:
g++ -m32 -march=i386 -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -Wall -Wextra
nasm -f elf32
ld -melf_i386
Qemu is used for running the resulting floppy image.