diff --git a/flop.img b/flop.img new file mode 100644 index 0000000..4c3dbd6 Binary files /dev/null and b/flop.img differ diff --git a/k_defines.h b/k_defines.h index a2c0112..60377cf 100644 --- a/k_defines.h +++ b/k_defines.h @@ -28,8 +28,14 @@ #define YELLOW_TXT 0x0E #define BRWHITE_TXT 0x0F +typedef unsigned char byte; +typedef unsigned short word; +typedef unsigned int dword; + #define UCHAR unsigned char #define USHORT unsigned short #define UINT unsigned int + + diff --git a/kernel.c b/kernel.c index 53b5251..bdc1f85 100644 --- a/kernel.c +++ b/kernel.c @@ -45,7 +45,7 @@ typedef struct{ UCHAR RsvdFieldPosition; UCHAR DirectColorModeInfo; - void *PhysBasePtr; + dword PhysBasePtr; UINT OffScreenMemOffset; USHORT OffScreenMemSize; UCHAR Reserved[206]; @@ -66,16 +66,12 @@ void k_init() UINT *vid = (UINT *) (mib->PhysBasePtr); UINT a; UINT tot = ((mib->XResolution) * (mib->YResolution)); + word step = 0x1000000 / tot; //step to increase color by for each pixel + dword color = 0; for (a = 0; a < tot; a++) { - if (a < (tot / 4)) - vid[a] = 0x00FF0000; - else if (a < (tot / 2)) - vid[a] = 0x0000FF00; - else if (a < ((tot * 3) / 4)) - vid[a] = 0x000000FF; - else - vid[a] = 0x00FFFFFF; + vid[a] = color; + color += step; } }