main: inport calls
authorRobin Krens <robin@robinkrens.nl>
Sat, 11 Jun 2022 20:02:44 +0000 (22:02 +0200)
committerRobin Krens <robin@robinkrens.nl>
Sat, 11 Jun 2022 20:02:44 +0000 (22:02 +0200)
src/main.c

index bd4a86b..6558f99 100644 (file)
@@ -45,6 +45,20 @@ void outport(unsigned char portnr, unsigned char val)
                :);
 }
 
+unsigned char inport(unsigned char portnr)
+{
+       unsigned char val;
+       __asm__(
+               "mov %1, %%dl\n\t"
+               "in (%%dx), %%al\n\t"
+               "mov %%al, %0"
+               : "=r"(val)
+               : "r"(portnr)
+               :);
+
+       return val;
+}
+
 __attribute__ ((naked)) void * dummy_isr(void)
 {
        int a = 2;
@@ -70,13 +84,17 @@ void init_video(void)
 
 int main(void)
 {
-       lol[0] = 0xDD;
-       lol[1] = 0xDD;
+       outport(0x15, 0x99);
+       unsigned char ret = inport(0x15);
+       
+       lol[0] = 0xAA;
+       lol[1] = ret;
 
        blaat[0] = 0xEE;
        blaat[1] = 0xEE;
        blaat[32] = 0xEE;
 
+
        setup_ivec();
        init_video();
        outport(IO_VIDEO_MODE, VMODE_16C_CHK | VMODE_CLEANINIT);