I'm GNU to this board. I've been trying to work on writing a toy os, just to play around with and learn about the x86 architechture. That being said, I'm having issues with some inline assembly. Here is the portion of assembly:
Code: Select all
/*reads a character*/
#define getchar() ({ \
char data = 0; \
asm volatile( \
"sti\n\t" \
"mov $0x00, %%ah\n\t" \
"int $0x16\n\t" \
"mov %%al,%0" \
:"=r" (data) \
); \
data;})
char whatever = getchar();
And it doesn't work. Please note that I've been able to write to the VGA, and I've gotten text to the string without any of the bios interrupts.
What's wrong with this? Why aren't my bios interrupts working? Please help!