I just started playing around with OS development, however I can't seem to get the writing to video memory to work at all; currently I'm booting up in some asm (grub) and somewhat quickly turning control over to C; where I'm then trying to write to the video memory, alike:
Code: Select all
unsigned char *videoram = (unsigned char *) 0xb8000;
videoram[0] = 65; /* character 'A' */
videoram[1] = 0x07; /* light grey (7) on black (0). */
Code: Select all
MOV AL, 65
MOV AH, 0x0e
MOV BH, 0x00
MOV BL, 0x07
INT 0x10
Code: Select all
void outportb (unsigned short _port, unsigned char _data)
{
__asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data));
}
I'm compiling elf64 (x86-64) using nasm 2.10rc8 for asm, and gcc 4.6.1 cross-compiled for c.
I'm running the linked binary in VMWare's Player, booting from a floppy with my code in bootsector.
I've gotten the idea that the 64 bit code might be the source of the issue, no? - something about far pointers?
Also I do think I read something, about issues with laptops, about some interrupts? - and I'm currently developing on a laptop.
EDIT: Added the laptop thing.