From aedc1bd8d39b24c8323d63e09e37f9dfadad9cf9 Mon Sep 17 00:00:00 2001 From: pnv6942az <1296263419@qq.com> Date: Sun, 3 Jul 2022 18:37:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init_graphics.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 init_graphics.c diff --git a/init_graphics.c b/init_graphics.c new file mode 100644 index 0000000..21f3348 --- /dev/null +++ b/init_graphics.c @@ -0,0 +1,105 @@ +#include +#include +#include "linux/tty.h" +#define memstart 0xA0000 +#define memsize 64000 +#define cursor_side 3 +#define width 320 +#define height 200 +#define barrier_width 10 +int volatile jumpp; +struct message *headd; +static int n=0; +int sys_get_message() +{ + if(jumpp>0) --jumpp; + return jumpp; +} +int sys_init_graphics() +{ +int i,j,x,y; + char *p=0xA0000; + if(n==0) +{ + outb(0x05,0x3CE); + outb(0x40,0x3CF);// + outb(0x06,0x3CE); + outb(0x05,0x3CF);// + outb(0x04,0x3C4); + outb(0x08,0x3C5);// + + + outb(0x01,0x3D4); + outb(0x4F,0x3D5);// + outb(0x03,0x3D4); + outb(0x82,0x3D5);// + + outb(0x07,0x3D4); + outb(0x1F,0x3D5);// + outb(0x12,0x3D4); + outb(0x8F,0x3D5);// + outb(0x17,0x3D4); + outb(0xA3,0x3D5);// + + + + outb(0x14,0x3D4); + outb(0x40,0x3D5);// + outb(0x13,0x3D4); + outb(0x28,0x3D5);// + + outb(0x0C,0x3D4);// + outb(0x00,0x3D5);// + outb(0x0D,0x3D4);// + outb(0x00,0x3D5);// + n=1; +} + + + + p=memstart; + for(i=0;i=320 || i<20 ) return 0; + if(i==33 || j==33){ +p=0xA0000; + for(i=0;i