/* unblink.c has been written by Bisqwit (http://iki.fi/bisqwit/) */ #include #ifdef linux static __inline__ unsigned char inportb(const unsigned short port) { unsigned char _v; __asm__ volatile ("inb %1,%0" :"=a" (_v):"d" ((unsigned short) port)); return _v; } static __inline__ void outportb(const unsigned short port, const unsigned char value) { __asm__ volatile ("outb %0,%1" ::"a" ((char) value),"d" ((unsigned short) port)); } #if 0 #include /* for libc5 */ #else #include /* for glibc */ #endif #else #define ioperm(a,b,c) #include #include #endif int main(void) { puts("Enabling 16 background colors, " "disabling blink and recoloring " "the screen border"); if(ioperm(0x3C0, 0x1B, 1) < 0)return -1; /* Enable 16 background colors and disable blink */ inportb(0x3DA); outportb(0x3C0, 0x10); outportb(0x3C0, 0x04); /* Set border colour to 0xFF */ inportb(0x3DA); outportb(0x3C0, 0x11); outportb(0x3C0, 0xFF); /* Resume AC normal operation */ outportb(0x3C0, 0x20); /* Repalette 0xFF as 000010 */ outportb(0x3C8, 0xFF); outportb(0x3C9, 0); outportb(0x3C9, 0); outportb(0x3C9, 16); return 0; }