From 9724a2a9235aa4248e6f2edd0da17a4ada805b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:55:34 +0000 Subject: [PATCH 01/62] fix: erreur d'opcode dans la fonction OUTW --- include/asm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm.h b/include/asm.h index cc8ccf7..f22609a 100644 --- a/include/asm.h +++ b/include/asm.h @@ -8,7 +8,7 @@ asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value)); #define outw(port,value) \ - asm volatile ("outb %%ax,%%dx"::"d" (port), "a" (value)); + asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value)); #define inb(port) ({ \ u8 _v; \ From 51fe36088987229603dbcae8b4616920b0478bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:56:10 +0000 Subject: [PATCH 02/62] =?UTF-8?q?feat:=20changement=20du=20nom=20de=20d?= =?UTF-8?q?=C3=A9finition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/types.h b/include/types.h index 451dbd8..0d0af5b 100644 --- a/include/types.h +++ b/include/types.h @@ -1,5 +1,5 @@ -#ifndef I386_TYPE -#define I386_TYPE +#ifndef TYPE +#define TYPE typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; From 3fccae0b03a5cd6a24be04200cbb9e15874734ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:56:57 +0000 Subject: [PATCH 03/62] =?UTF-8?q?feat:=20ajout=20de=20d=C3=A9claration=20n?= =?UTF-8?q?ouvelles=20fonctions=20graphiques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/vga.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/vga.h b/include/vga.h index 38bfae4..46e5e89 100644 --- a/include/vga.h +++ b/include/vga.h @@ -5,6 +5,12 @@ typedef u8 mode_def[64]; -void print (u8* string); -void cls (void); -u16 setvmode(u8); +void print (char* string); +void clearscreen (void); +u16 setvmode(u8); +void showchar (u8 thechar); +void showhex (u8 src); +void fillscreen (u8 color); +u8 getfont(u8 num); +void setfont(u8 num); +void gotoscreen(u16 x,u16 y); \ No newline at end of file From 4d71d4b986463693517e4cd6542c889db0b46c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:57:46 +0000 Subject: [PATCH 04/62] =?UTF-8?q?feat:=20ajout=20de=20fichier=20en=20cas?= =?UTF-8?q?=20de=20d=C3=A9claration=20de=20fonctions=20"external"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/external.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 include/external.h diff --git a/include/external.h b/include/external.h new file mode 100644 index 0000000..e69de29 From 6a28f88e7c22cd2dfdc62fff22250bf13e2e4b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:58:30 +0000 Subject: [PATCH 05/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20de=20la=20m=C3=A9moi?= =?UTF-8?q?re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/memory.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 include/memory.h diff --git a/include/memory.h b/include/memory.h new file mode 100644 index 0000000..26e0905 --- /dev/null +++ b/include/memory.h @@ -0,0 +1,6 @@ +#include "types.h" +#include "asm.h" + +void memset(void *dest, u8 val, u16 count,int size); +void memcpy(void *dest, const void *src, int size); +int memcmp(const void *memptr1, const void *memptr2, int count); \ No newline at end of file From 1917eef0c2a32ed759f024e5bfdde43f7c36ddff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:58:40 +0000 Subject: [PATCH 06/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20des=20I/O?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/port.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 include/port.h diff --git a/include/port.h b/include/port.h new file mode 100644 index 0000000..90e86d2 --- /dev/null +++ b/include/port.h @@ -0,0 +1,8 @@ +#include "types.h" + +void outreg(u16 port,u8 *src,u16 num); +void outregsame(u16 port,u8 *src,u16 num); +void inreg(u16 port,u8 *src,u16 num); +void inregsame(u16 port,u8 *src,u16 num); +void initreg(u16 port,u8 *src,u16 num); +void initregsame(u16 port,u8 *src,u16 num); \ No newline at end of file From b8bd1ddf2c119711c1728b83071ebd2f0da9cc70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 12:59:31 +0000 Subject: [PATCH 07/62] =?UTF-8?q?build:=20ajout=20des=20d=C3=A9pendances?= =?UTF-8?q?=20dans=20la=20construction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/makefile b/install/makefile index b1fb2d2..21dc04f 100644 --- a/install/makefile +++ b/install/makefile @@ -1,6 +1,6 @@ all: makall -makall: +makall: iflop/iflop.com mbrol/mbrol.com sync clean: @@ -14,6 +14,5 @@ mbrol/mbrol.com: (cd mbrol; make) - From e129e59eeb40a133b18b9c7de88da79b4041ad9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:00:16 +0000 Subject: [PATCH 08/62] fix: erratum sur le mode 2 --- lib/modes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modes.c b/lib/modes.c index de3b38f..55101c6 100644 --- a/lib/modes.c +++ b/lib/modes.c @@ -32,7 +32,7 @@ static mode_def textmodes[maxtextmode] = { 0x9C,0x8E,0x8F,0x28,0x1F,0x96,0xB9,0xA3,0xFF, 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x10,0x11,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0xCF,0x00,0x0F,0x00,0x00, + 0x0C,0x00,0x0F,0x00,0x00, 80,50 }, From 7349aa3ebb2b741f7b80d1eaf3912e2904ffc20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:01:09 +0000 Subject: [PATCH 09/62] =?UTF-8?q?feat:=20ajout=20de=20nombreuses=20fonctio?= =?UTF-8?q?nnalit=C3=A9=20pour=20l'affichage=20en=20mode=20texte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vgatxt.c | 184 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 126 insertions(+), 58 deletions(-) diff --git a/lib/vgatxt.c b/lib/vgatxt.c index 046542d..83d8379 100644 --- a/lib/vgatxt.c +++ b/lib/vgatxt.c @@ -1,88 +1,156 @@ #include "vga.h" -#include "string.h" +#include "memory.h" +#include "port.h" #include "asm.h" #include "modes.c" -#include "8x8fnt.c" +#include "fonts.c" -#define sequencer 0x3c4 -#define misc 0x3c2 -#define ccrt 0x3D4 -#define attribs 0x3c0 -#define graphics 0x3ce -#define state 0x3da +#define sequencer 0x3c4 +#define misc 0x3c2 +#define ccrt 0x3D4 +#define attribs 0x3c0 +#define graphics 0x3ce +#define state 0x3da +static u16 resX,resY,cursX,cursY; /* resolution x,y en caractères et position du curseur */ +static u16 pages,pagesize,activepage,showedpage;/* nombre de pages disponibles et taille d'une page ansi que la page active et affiché en cours*/ +static u8 vmode=0xFF; /* mode en cours d'utilisation */ +static u32 basemem; /* debut de la mémoire vidéo */ +static bool scrolling,graphic; /* Activation du défilement, Flag du mode graphique */ +static u8 font; /* n° font actuelle */ -static u16 resX,resY,cursX,cursY; /* resolution x,y en caractères et position du curseur */ -static u16 pages,pagesize,activepage; /* nombre de pages disponibles et taille d'une page */ -static u8 vmode; /* mode en cours d'utilisation */ -static u16 basemem; /* debut de la mémoire vidéo */ -static bool scrolling,graphic; /* Activation du défilement, Flag du mode graphique */ - - -void print (u8* string) +void showchar (u8 thechar) { - u8 *source,*screen; + u8 *screen; + screen = (u8 *)basemem+activepage*pagesize+2*(cursX+cursY*resX); + *screen = thechar; + *(++screen) = 0x07; + if (cursX++>=resX) + { + cursX=0; + cursY++; + } + gotoscreen(cursX,cursY); +} + +void print (char* string) +{ + u8 *source; source = string; - screen = (u8 *)TEXTSCREEN; - while(*source!=0x00) - { - *screen = *source; - screen+=2; - source++; - } + while(*source!=0x00) showchar (*source++); } -void cls (void) + +void showhex (u8 src) { - memset((u8 *)TEXTSCREEN,0x20,(80*25*2),2); + static u8 hexadigit[16] = "0123456789ABCDEF"; + showchar(hexadigit[(src&0xF0)>>4]); + showchar(hexadigit[src&0x0F]); } +void clearscreen (void) +{ + gotoscreen(0,0); + memset((u8 *)(basemem+activepage*pagesize),0,2*(resY*resX),1); +} + +void gotoscreen(u16 x,u16 y) +{ + u16 pos; + pos=(cursX+cursY*resX)/2; + cursX=x; + cursY=y; + outb(ccrt,0x0E); + outb(ccrt+1,(u8)(pos&0x00FF)); + outb(ccrt,0x0D); + outb(ccrt+1,(u8)((pos&0xFF00)>>8)); +} + +void fillscreen (u8 color) +{ + memset((u8 *)(basemem+activepage*pagesize+1),color,resY*resX,2); +} + + +void loadfont(u8 num,u8 *font,u8 size) +{ + u16 seqinit[4] = { 0x0100, 0x0402, 0x0704, 0x0300 }, + graphinit[3] = { 0x0204, 0x0005, 0x0006 }, + seqend [4] = { 0x0100, 0x0302, 0x0304, 0x0300 }, + graphend[3] = { 0x0004, 0x1005, 0x0E06 }; + u8 *dest,*src; + u8 i; + dest=(u8 *)GRPHSCREEN; + src=font; + initreg(sequencer,(u8 *)seqinit ,4); + initreg(graphics ,(u8 *)graphinit,3); + if (num>3) + dest+= (((num-4)<<1)+1)<<13; + else + dest+=num<<14; + for(i=0;i<250;i++) + { + memcpy(dest,src,size); + src+=size; + dest+=size; + memset(dest,0,(32-size),1); + dest+=(32-size); + } + initreg(sequencer,(u8 *)seqend ,4); + initreg(graphics ,(u8 *)graphend,3); +} + +u8 getfont(u8 num) +{ + return font; +} + +void setfont(u8 num) +{ + font=num&0x07; + outb(sequencer,3); + outb(sequencer+1,num&0x03+(num&(0x04)<<2)); +} u16 setvmode(u8 choosedmode) { - u8 *def,i,mode; - - mode=choosedmode&0x7F; + u8 *def,mode; + mode=(choosedmode&0x7F); + if (vmode==0xFF) + { + loadfont(1 ,(u8 *)font8x8, 8); + } if (choosedmode>0x7F) { - if (mode>maxgraphmode) return 1; /* mode inexistant */ + if (mode>=maxgraphmode) return 1; /* mode inexistant */ def=(u8 *)&graphmodes[mode]; graphic=true; } else { - if (mode>maxtextmode) return 1; /* mode inexistant */ + if (mode>=maxtextmode) return 1; /* mode inexistant */ def=(u8 *)&textmodes[mode]; graphic=false; } - outb(misc,*def++); - outb(state,*def++); - for(i=0;i<5;i++) - { - outb(sequencer,i); - outb(sequencer+1,*def++); - } + outb(misc,def[0]); + outb(state,def[1]); + outreg(sequencer,&def[2],5); outb(ccrt,0x11); - outb(ccrt+1,0x0E); - for(i=0;i<25;i++) - { - outb(ccrt,i); - outb(ccrt+1,*def++); - } - for(i=0;i<9;i++) - { - outb(graphics,i); - outb(graphics+1,*def++); - } - inb(state); - for(i=0;i<21;i++) - { - inb(attribs); - outb(attribs,i); - outb(attribs,*def++); - } - inb(state); + outb(ccrt+1,0x0E); + outreg(ccrt,&def[7],25); + outreg(graphics,&def[32],9); + inb(state); + outregsame(attribs,&def[41],21); outb(attribs,0x20); + resX=def[63]; + resY=def[64]; + cursX=0; + cursY=0; + pagesize=2*resX*resY; + activepage=0; + vmode=mode; + pages=32768/pagesize; + basemem=(def[21]<<8)+def[22]+TEXTSCREEN; return 0; -} +} \ No newline at end of file From dbbbc1458e30711b0446a8ef2d6d0ab1cadb0c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:03:10 +0000 Subject: [PATCH 10/62] feat: police pour le mode texte 8x8 --- lib/fonts.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 lib/fonts.c diff --git a/lib/fonts.c b/lib/fonts.c new file mode 100644 index 0000000..e786385 --- /dev/null +++ b/lib/fonts.c @@ -0,0 +1,130 @@ +static u8 font8x8 [2048] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, + 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, + 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0xD6, 0x10, 0x38, + 0x10, 0x38, 0x7C, 0xFE, 0xFE, 0x7C, 0x10, 0x38, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, + 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, + 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, + 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, 0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18, + 0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, + 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, + 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, + 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, + 0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18, 0x00, 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, + 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, + 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, + 0x38, 0x6C, 0xC6, 0xD6, 0xC6, 0x6C, 0x38, 0x00, 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, + 0x7C, 0xC6, 0x06, 0x1C, 0x30, 0x66, 0xFE, 0x00, 0x7C, 0xC6, 0x06, 0x3C, 0x06, 0xC6, 0x7C, 0x00, + 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00, 0xFE, 0xC0, 0xC0, 0xFC, 0x06, 0xC6, 0x7C, 0x00, + 0x38, 0x60, 0xC0, 0xFC, 0xC6, 0xC6, 0x7C, 0x00, 0xFE, 0xC6, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, + 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0x00, 0x7C, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00, + 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, + 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, + 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, + 0x7C, 0xC6, 0xDE, 0xDE, 0xDE, 0xC0, 0x78, 0x00, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, + 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00, + 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, + 0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00, + 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, 0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, + 0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, + 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xCE, 0x7C, 0x0E, + 0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00, 0x3C, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x3C, 0x00, + 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, + 0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x3C, 0x00, + 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, + 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, + 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, + 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC6, 0x7C, 0x00, + 0x1C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, + 0x3C, 0x66, 0x60, 0xF8, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, + 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x06, 0x00, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00, + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0x00, + 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, + 0x00, 0x00, 0xDC, 0x76, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x00, + 0x30, 0x30, 0xFC, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, + 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, + 0x00, 0x00, 0x7E, 0x4C, 0x18, 0x32, 0x7E, 0x00, 0x0E, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0E, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x70, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x70, 0x00, + 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, + 0x7C, 0xC6, 0xC0, 0xC0, 0xC6, 0x7C, 0x0C, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, + 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x7C, 0x82, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, + 0xC6, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x30, 0x18, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, + 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0xC0, 0x7E, 0x0C, 0x38, + 0x7C, 0x82, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0xC6, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, + 0x30, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x7C, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, + 0xC6, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, + 0x18, 0x30, 0xFE, 0xC0, 0xF8, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x7E, 0x12, 0xFE, 0x90, 0xFE, 0x00, + 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00, 0x7C, 0x82, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x30, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0x78, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x60, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, + 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0xC6, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x00, + 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, 0x7C, 0x80, + 0x38, 0x6C, 0x64, 0xF0, 0x60, 0x66, 0xFC, 0x00, 0x3A, 0x6C, 0xCE, 0xD6, 0xE6, 0x6C, 0xB8, 0x00, + 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x0E, 0x1B, 0x18, 0x3C, 0x18, 0xD8, 0x70, 0x00, + 0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x0C, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, + 0x0C, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x18, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, + 0x76, 0xDC, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x00, 0x76, 0xDC, 0x00, 0xE6, 0xF6, 0xDE, 0xCE, 0x00, + 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, + 0x18, 0x00, 0x18, 0x18, 0x30, 0x63, 0x3E, 0x00, 0x7E, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, + 0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x00, 0x00, 0x63, 0xE6, 0x6C, 0x7E, 0x33, 0x66, 0xCC, 0x0F, + 0x63, 0xE6, 0x6C, 0x7A, 0x36, 0x6A, 0xDF, 0x06, 0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x00, + 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, + 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, + 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x30, 0x60, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, + 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, 0x18, 0x0C, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, + 0x7E, 0x81, 0x9D, 0xA1, 0xA1, 0x9D, 0x81, 0x7E, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, + 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18, + 0x66, 0x66, 0x3C, 0x7E, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, + 0x76, 0xDC, 0x7C, 0x06, 0x7E, 0xC6, 0x7E, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, + 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, + 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0x00, + 0x30, 0x7E, 0x0C, 0x7C, 0xCC, 0xCC, 0x78, 0x00, 0xF8, 0x6C, 0x66, 0xF6, 0x66, 0x6C, 0xF8, 0x00, + 0x7C, 0x82, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0xC6, 0x00, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, + 0x30, 0x18, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x0C, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x3C, 0x42, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, + 0x66, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, + 0x30, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x60, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xD8, 0xCC, 0xC6, 0xCC, 0x00, + 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x0C, 0x06, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, + 0x76, 0xDC, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0xC0, 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xF0, + 0xF0, 0x60, 0x7C, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0x7C, 0x82, 0x00, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x60, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, + 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0x0C, 0x18, 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xE1, 0x32, 0xE4, 0x3A, 0xF6, 0x2A, 0x5F, 0x86, + 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, + 0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x38, + 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, + 0x78, 0x0C, 0x38, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x18, 0x30, 0x7C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; From 7b41bd65950df042fd8826708714851cbf6f84a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:03:33 +0000 Subject: [PATCH 11/62] =?UTF-8?q?feat:=20ensemble=20de=20fonctions=20perme?= =?UTF-8?q?ttant=20la=20gestion=20de=20la=20m=C3=A9moire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/memory.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/memory.c diff --git a/lib/memory.c b/lib/memory.c new file mode 100644 index 0000000..9092ec4 --- /dev/null +++ b/lib/memory.c @@ -0,0 +1,38 @@ +#include "types.h" + +void memset(void *dest, u8 val, u16 count, u32 size) +{ + char *temp; + for(temp = (u8 *)dest; count != 0; count--) +{ +*temp = val; +temp+=size; +} +} + +void memcpy(void *dest, const void *src, u32 size) +{ + u8 *s, *d; + u32 i; + s = (u8 *) src; + d = (u8 *) dest; + for(i=0;i Date: Mon, 2 Apr 2007 13:03:47 +0000 Subject: [PATCH 12/62] feat: ensemble de fonctions permettant la gestion des I/O --- lib/port.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 lib/port.c diff --git a/lib/port.c b/lib/port.c new file mode 100644 index 0000000..4780c13 --- /dev/null +++ b/lib/port.c @@ -0,0 +1,66 @@ +#include "types.h" +#include "asm.h" + +void outreg(u16 port,u8 *src,u16 num) +{ +int i; +for(i=0;i Date: Mon, 2 Apr 2007 13:04:21 +0000 Subject: [PATCH 13/62] build: ajout de nouvelles compilations --- lib/makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/makefile b/lib/makefile index 6348347..451ad18 100644 --- a/lib/makefile +++ b/lib/makefile @@ -1,6 +1,6 @@ FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c PARTIAL=-r -OBJS= string.o vgatxt.o +OBJS= memory.o port.o vgatxt.o all: makeall @@ -10,7 +10,10 @@ makeall: $(OBJS) vgatxt.o:vgatxt.c $(FREEC) $^ -string.o:string.c +memory.o:memory.c + $(FREEC) $^ + +port.o:port.c $(FREEC) $^ clean: rm -f *.o From 5bea78de5b9a9d09917f510ffe84f3bd56cb2379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:05:06 +0000 Subject: [PATCH 14/62] feat: changement de nom au sein du dossier --- lib/8x8fnt.c | 130 --------------------------------------------------- lib/string.c | 11 ----- 2 files changed, 141 deletions(-) delete mode 100644 lib/8x8fnt.c delete mode 100644 lib/string.c diff --git a/lib/8x8fnt.c b/lib/8x8fnt.c deleted file mode 100644 index e786385..0000000 --- a/lib/8x8fnt.c +++ /dev/null @@ -1,130 +0,0 @@ -static u8 font8x8 [2048] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, - 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, - 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0xD6, 0x10, 0x38, - 0x10, 0x38, 0x7C, 0xFE, 0xFE, 0x7C, 0x10, 0x38, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, - 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, - 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, - 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, 0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18, - 0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, - 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, - 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, - 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, - 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, - 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, - 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, - 0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18, 0x00, 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, - 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, - 0x38, 0x6C, 0xC6, 0xD6, 0xC6, 0x6C, 0x38, 0x00, 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, - 0x7C, 0xC6, 0x06, 0x1C, 0x30, 0x66, 0xFE, 0x00, 0x7C, 0xC6, 0x06, 0x3C, 0x06, 0xC6, 0x7C, 0x00, - 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00, 0xFE, 0xC0, 0xC0, 0xFC, 0x06, 0xC6, 0x7C, 0x00, - 0x38, 0x60, 0xC0, 0xFC, 0xC6, 0xC6, 0x7C, 0x00, 0xFE, 0xC6, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, - 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0x00, 0x7C, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00, - 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, - 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, - 0x7C, 0xC6, 0xDE, 0xDE, 0xDE, 0xC0, 0x78, 0x00, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, - 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00, - 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, - 0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00, - 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, 0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, - 0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, - 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xCE, 0x7C, 0x0E, - 0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00, 0x3C, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x3C, 0x00, - 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, - 0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x3C, 0x00, - 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, - 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, - 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC6, 0x7C, 0x00, - 0x1C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, - 0x3C, 0x66, 0x60, 0xF8, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, - 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x06, 0x00, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00, - 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0x00, - 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, - 0x00, 0x00, 0xDC, 0x76, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x00, - 0x30, 0x30, 0xFC, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, - 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, - 0x00, 0x00, 0x7E, 0x4C, 0x18, 0x32, 0x7E, 0x00, 0x0E, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0E, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x70, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x70, 0x00, - 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, - 0x7C, 0xC6, 0xC0, 0xC0, 0xC6, 0x7C, 0x0C, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x7C, 0x82, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0xC6, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x30, 0x18, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0xC0, 0x7E, 0x0C, 0x38, - 0x7C, 0x82, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0xC6, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, - 0x30, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x7C, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, - 0xC6, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x18, 0x30, 0xFE, 0xC0, 0xF8, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x7E, 0x12, 0xFE, 0x90, 0xFE, 0x00, - 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00, 0x7C, 0x82, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x30, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x78, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x60, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0xC6, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x00, - 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, 0x7C, 0x80, - 0x38, 0x6C, 0x64, 0xF0, 0x60, 0x66, 0xFC, 0x00, 0x3A, 0x6C, 0xCE, 0xD6, 0xE6, 0x6C, 0xB8, 0x00, - 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x0E, 0x1B, 0x18, 0x3C, 0x18, 0xD8, 0x70, 0x00, - 0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x0C, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, - 0x0C, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x18, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x76, 0xDC, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x00, 0x76, 0xDC, 0x00, 0xE6, 0xF6, 0xDE, 0xCE, 0x00, - 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, - 0x18, 0x00, 0x18, 0x18, 0x30, 0x63, 0x3E, 0x00, 0x7E, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, - 0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x00, 0x00, 0x63, 0xE6, 0x6C, 0x7E, 0x33, 0x66, 0xCC, 0x0F, - 0x63, 0xE6, 0x6C, 0x7A, 0x36, 0x6A, 0xDF, 0x06, 0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x00, - 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, - 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, - 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x30, 0x60, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, 0x18, 0x0C, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x7E, 0x81, 0x9D, 0xA1, 0xA1, 0x9D, 0x81, 0x7E, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, - 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18, - 0x66, 0x66, 0x3C, 0x7E, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, - 0x76, 0xDC, 0x7C, 0x06, 0x7E, 0xC6, 0x7E, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, - 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, - 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0x00, - 0x30, 0x7E, 0x0C, 0x7C, 0xCC, 0xCC, 0x78, 0x00, 0xF8, 0x6C, 0x66, 0xF6, 0x66, 0x6C, 0xF8, 0x00, - 0x7C, 0x82, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0xC6, 0x00, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, - 0x30, 0x18, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x0C, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x3C, 0x42, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x66, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, - 0x30, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x60, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xD8, 0xCC, 0xC6, 0xCC, 0x00, - 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x0C, 0x06, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, - 0x76, 0xDC, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0xC0, 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xF0, - 0xF0, 0x60, 0x7C, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x7C, 0x82, 0x00, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x60, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0x0C, 0x18, 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x00, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xE1, 0x32, 0xE4, 0x3A, 0xF6, 0x2A, 0x5F, 0x86, - 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, - 0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x38, - 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, - 0x78, 0x0C, 0x38, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x18, 0x30, 0x7C, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; diff --git a/lib/string.c b/lib/string.c deleted file mode 100644 index a4ca0df..0000000 --- a/lib/string.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "types.h" - -void memset(void *dst, u8 val, u16 count,u32 size) -{ - u8 *temp; - for(temp = (u8 *)dst; count != 0; count--) -{ -temp+=size; -*temp = val; -} -} From 19dca7321b97d2eca307018350f1089d7302649b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:06:17 +0000 Subject: [PATCH 15/62] =?UTF-8?q?build:=20n'utilise=20plus=20objcopy=20pou?= =?UTF-8?q?r=20la=20g=C3=A9n=C3=A9ration=20du=20binaire=20pur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/makefile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/system/makefile b/system/makefile index ca416e6..7e58e56 100644 --- a/system/makefile +++ b/system/makefile @@ -1,30 +1,20 @@ FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c -o - - -LINK=ld -Ttext 0x100000 -e __main -o +LINK=ld -N -Ttext 0x100000 -e main -o all: system.sys sync -copy: - (cp system.sys /cygdrive/a) - -copy2: - (cp system.sys /cygdrive/b) - system.sys: nasm -f bin -o loader.bin loader.asm nasm -f elf -o system.o system.asm $(FREEC) systemc.o system.c - $(LINK) system.out systemc.o system.o ../lib/libs.o - objcopy -O binary system.out system.bin + $(LINK) system.bin systemc.o system.o ../lib/libs.o --oformat binary cat loader.bin>system.sys cat system.bin>>system.sys clean: rm -f *.o - rm -f *.out rm -f *.bin rm -f *.sys From b8620e8b85b55298b36f4b5bc3432c040b5bc319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:07:30 +0000 Subject: [PATCH 16/62] feat: change la taille du noyau a copier et le moment ou se fait l'affichage du chargement --- system/loader.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/loader.asm b/system/loader.asm index 7b9deef..e241639 100644 --- a/system/loader.asm +++ b/system/loader.asm @@ -6,9 +6,7 @@ push cs pop ds pop es - call EnableA20 - mov si,msgpmode - call showstr + call EnableA20 mov ax,cs mov [RealCS],ax lea ax,[Real] @@ -39,6 +37,8 @@ ;out 0x21,al mov al,0x80 out 0x70,al + mov si,msgpmode + call showstr mov eax,cr0 or al,1 @@ -50,7 +50,7 @@ GoPMode32: [BITS 32] mov ax,SYS_DATA_SEL mov ds,ax - mov ecx,50000/4 + mov ecx,20000/4 cld mov esi,kernel mov edi,0x100000 From 8a0719e2b1ec12e6d954441ed90f795e82d952f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:08:05 +0000 Subject: [PATCH 17/62] =?UTF-8?q?feat:=20utilisation=20des=20nouvelles=20f?= =?UTF-8?q?onctionnalit=C3=A9s=20vid=C3=A9o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/system.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/system/system.c b/system/system.c index 548cb3e..3269251 100644 --- a/system/system.c +++ b/system/system.c @@ -1,8 +1,9 @@ #include "vga.h" -int __main(void) { - setvmode(1); - cls(); - print("Hello cos is here !"); +int main(void) { + setvmode(0x1); + clearscreen(); + setfont(1); + print("Hello cos is here"); while(1); -} +} \ No newline at end of file From 4cddabc4f2b0bdb874bc490eff35fad0fae80c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:11:17 +0000 Subject: [PATCH 18/62] feat: ajout de fonctions I/O sur 4 octets --- include/asm.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/include/asm.h b/include/asm.h index f22609a..3faa994 100644 --- a/include/asm.h +++ b/include/asm.h @@ -3,6 +3,10 @@ #define cli() __asm__ ("cli"::) #define nop() __asm__ ("nop"::) #define iret() __asm__ ("iret"::) +#define pause() __asm__ ("iret"::) + +#define outbp(port,value) \ + asm volatile ("outb %%al,%%dx; jmp 1f; 1:"::"d" (port), "a" (value)); #define outb(port,value) \ asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value)); @@ -10,6 +14,9 @@ #define outw(port,value) \ asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value)); +#define outd(port,value) \ + asm volatile ("outd %%eax,%%dx"::"d" (port), "a" (value)); + #define inb(port) ({ \ u8 _v; \ asm volatile ("inb %%dx,%%al" : "=a" (_v) : "d" (port)); \ @@ -20,4 +27,18 @@ u16 _v; \ asm volatile ("inw %%dx,%%ax" : "=a" (_v) : "d"(port)); \ _v; \ -}) \ No newline at end of file +} + +#define ind(port) ({ \ + u32 _v; \ + asm volatile ("ind %%dx,%%eax" : "=a" (_v) : "d"(port)); \ + _v; \ +} + +#define rolb(input,rotate) ({ \ + u32 _v; \ + asm volatile ("roll %1,%0" : "=g" (_v) : "cI" (rotate), "0" (input)); \ + _v; \ +} + + From 74fed89a88ba8c043cfc47f22a377a63435495ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:11:48 +0000 Subject: [PATCH 19/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20des=20IRQ=20et=20int?= =?UTF-8?q?erruptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/irq.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/irq.h diff --git a/include/irq.h b/include/irq.h new file mode 100644 index 0000000..c11ba7a --- /dev/null +++ b/include/irq.h @@ -0,0 +1,19 @@ +#define INTGATE 0x8E00 /* utilise pour gerer les interruptions */ +#define TRAPGATE 0x8F00 /* utilise pour faire des appels systemes */ +#define TASKGATE 0x8500 /* utilise pour commuter des taches */ +#define CALLGATE 0x8C00 /* utilise pour appeler du code */ +#define LDTDES 0x8200 /* utilise pour pointer une LDT */ + +/* descripteur de segment */ +typedef struct idtdesc { + u16 offset0_15; + u16 select; + u16 type; + u16 offset16_31; +} idtdesc __attribute__ ((packed)); + +/* registre IDTR */ +struct idtr { + u16 limite; + u32 base; +} __attribute__ ((packed)); From 976d9dea61f3adaec115667a1f8ffcc1af7e68b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:12:10 +0000 Subject: [PATCH 20/62] =?UTF-8?q?feat:=20usage=20de=20type=20diff=C3=A9ren?= =?UTF-8?q?ts=20dans=20la=20syntaxe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/memory.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/memory.h b/include/memory.h index 26e0905..7f679f9 100644 --- a/include/memory.h +++ b/include/memory.h @@ -1,6 +1,5 @@ #include "types.h" -#include "asm.h" -void memset(void *dest, u8 val, u16 count,int size); -void memcpy(void *dest, const void *src, int size); -int memcmp(const void *memptr1, const void *memptr2, int count); \ No newline at end of file +void memset(void *dst, u8 val, u32 count,u32 size); +void memcpy(void *src, void *dst, u32 count, u32 size); +u32 memcmp(void *src, void *dst, u32 count, u32 size); From 56609d8e55c72aa6f045e6fa93cf731986c4109e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:12:28 +0000 Subject: [PATCH 21/62] =?UTF-8?q?feat:=20usage=20de=20type=20diff=C3=A9ren?= =?UTF-8?q?ts=20dans=20la=20syntaxe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/port.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/port.h b/include/port.h index 90e86d2..2a2caf0 100644 --- a/include/port.h +++ b/include/port.h @@ -3,6 +3,4 @@ void outreg(u16 port,u8 *src,u16 num); void outregsame(u16 port,u8 *src,u16 num); void inreg(u16 port,u8 *src,u16 num); -void inregsame(u16 port,u8 *src,u16 num); -void initreg(u16 port,u8 *src,u16 num); -void initregsame(u16 port,u8 *src,u16 num); \ No newline at end of file +void inregsame(u16 port,u8 *src,u16 num); \ No newline at end of file From 82079f2f0da8d8f97c743a4732078744e6bde5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:12:53 +0000 Subject: [PATCH 22/62] feat: ajout du pointeur NULL --- include/types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/types.h b/include/types.h index 0d0af5b..630c32d 100644 --- a/include/types.h +++ b/include/types.h @@ -1,5 +1,5 @@ -#ifndef TYPE -#define TYPE +#ifndef I386_TYPE +#define I386_TYPE typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; @@ -7,5 +7,6 @@ typedef unsigned char uchar; typedef int bool; #define true 1; #define false 0; +#define NULL 0x0000; #endif From 1bfa59381eefb0b19b6ae492554ba30c9438e8ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:14:21 +0000 Subject: [PATCH 23/62] =?UTF-8?q?feat:=20ajout=20de=20nouvelles=20d=C3=A9c?= =?UTF-8?q?larations=20de=20fonctions=20vid=C3=A9os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/vga.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/include/vga.h b/include/vga.h index 46e5e89..f70daf0 100644 --- a/include/vga.h +++ b/include/vga.h @@ -2,15 +2,23 @@ #define TEXTSCREEN 0xB8000 /* debut de la memoire video texte*/ #define GRPHSCREEN 0xA0000 /* debut de la memoire video graphique*/ +typedef u8 mode_def[64]; -typedef u8 mode_def[64]; -void print (char* string); -void clearscreen (void); -u16 setvmode(u8); -void showchar (u8 thechar); -void showhex (u8 src); -void fillscreen (u8 color); -u8 getfont(u8 num); -void setfont(u8 num); -void gotoscreen(u16 x,u16 y); \ No newline at end of file +u32 setvmode(u8); +u32 loadfont(u8* def,u8 size,u8 font); +void gotoscr(u16 x,u16 y); +void useplane(u8 plan); +u8 getfont(u8 num); +void setfont(u8 num); +void waitvretrace (void); +void waithretrace (void); +void enablecursor (void); +void disablecursor (void); +void enablescroll (void); +void disablescroll (void); +void (*writepxl)(u16 x, u16 y, u32 c); +void (*showchar)(u8 thechar); +void (*cls)(void); +void (*scroll)(u8 lines); + From 0212a7a9001cc25505e1b7c990dcb62a3614ead7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:15:18 +0000 Subject: [PATCH 24/62] =?UTF-8?q?feat:=20les=20d=C3=A9clarations=20de=20fo?= =?UTF-8?q?nctions=20li=C3=A9s=20=C3=A0=20l'affichage=20mais=20de=20fa?= =?UTF-8?q?=C3=A7on=20ind=C3=A9pendante=20du=20mat=C3=A9riel=20prendront?= =?UTF-8?q?=20place=20ici?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/video.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 include/video.h diff --git a/include/video.h b/include/video.h new file mode 100644 index 0000000..c96e3a1 --- /dev/null +++ b/include/video.h @@ -0,0 +1,2 @@ +void showhex(u8 src); +void print(u8* string); From 7d8efe7b08b823fbf2d365fbed74dd0738f53c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:15:55 +0000 Subject: [PATCH 25/62] build: suppression du dossier drivers faisant double usage avec celui de lib --- drivers/makefile | 13 ------------- drivers/vga/makefile | 17 ----------------- drivers/vga/vgahard.asm | 5 ----- drivers/vga/vgatxt.c | 1 - 4 files changed, 36 deletions(-) delete mode 100644 drivers/makefile delete mode 100644 drivers/vga/makefile delete mode 100644 drivers/vga/vgahard.asm delete mode 100644 drivers/vga/vgatxt.c diff --git a/drivers/makefile b/drivers/makefile deleted file mode 100644 index 8b186b2..0000000 --- a/drivers/makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: makall - -makall: vga/vga.o - sync - -clean: - (cd vga; make clean) - -vga/vga.o: - (cd vga; make) - - - diff --git a/drivers/vga/makefile b/drivers/vga/makefile deleted file mode 100644 index 75edc00..0000000 --- a/drivers/vga/makefile +++ /dev/null @@ -1,17 +0,0 @@ -FREEC=gcc -O4 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../../Include -c -o -PARTIAL=-r -OBJS= vgahard.o \ - vgatxt.o - -all: - nasm -f elf -o vgahard.o vgahard.asm - - $(FREEC) vgatxt.o vgatxt.c - - ld $(PARTIAL) -o vga.o $(OBJS) - -clean: - rm -f *.o - rm -f *.bin - - diff --git a/drivers/vga/vgahard.asm b/drivers/vga/vgahard.asm deleted file mode 100644 index e990554..0000000 --- a/drivers/vga/vgahard.asm +++ /dev/null @@ -1,5 +0,0 @@ -[BITS 32] - - - SECTION .text - \ No newline at end of file diff --git a/drivers/vga/vgatxt.c b/drivers/vga/vgatxt.c deleted file mode 100644 index 959ed06..0000000 --- a/drivers/vga/vgatxt.c +++ /dev/null @@ -1 +0,0 @@ -#include \ No newline at end of file From 7045741c5eac22b00e03afafd1bcb2a2fde3c1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:17:40 +0000 Subject: [PATCH 26/62] feat: changement radical de syntaxe des fonctions --- lib/memory.c | 62 +++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/lib/memory.c b/lib/memory.c index 9092ec4..4fa9bb9 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -1,38 +1,46 @@ #include "types.h" -void memset(void *dest, u8 val, u16 count, u32 size) -{ - char *temp; - for(temp = (u8 *)dest; count != 0; count--) -{ -*temp = val; -temp+=size; -} -} +/*******************************************************************************/ -void memcpy(void *dest, const void *src, u32 size) +/* Copie un octet une ou plusieurs fois en mémoire */ +void memset(void *dst, u8 val, u32 count,u32 size) { - u8 *s, *d; - u32 i; - s = (u8 *) src; - d = (u8 *) dest; - for(i=0;i Date: Mon, 2 Apr 2007 13:18:40 +0000 Subject: [PATCH 27/62] feat: ajout de nombreux modes graphiques et remaniement de leur stockage --- lib/modes.c | 280 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 191 insertions(+), 89 deletions(-) diff --git a/lib/modes.c b/lib/modes.c index 55101c6..b420ef5 100644 --- a/lib/modes.c +++ b/lib/modes.c @@ -1,118 +1,220 @@ -#define maxgraphmode 5 +/* definition des registres de la carte VGA pour differents modes */ + +#define maxgraphmode 11 #define maxtextmode 5 static mode_def textmodes[maxtextmode] = { - /*MODE 0, 40*25 16 couleurs */ + /*40*25 16 couleurs mode 0x00*/ { - 0x67,0x00,0x03,0x08,0x03,0x00,0x02, - 0x2D,0x27,0x28,0x90,0x2B,0x0A,0xBF,0x1F,0x00,0x4F,0x0D,0x0E,0x00,0x00,0x00,0x00, - 0x9C,0x8E,0x8F,0x14,0x1F,0x96,0xB9,0xA3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0x0C,0x00,0x0F,0x08,0x00, - 40,25 - }, - - /*MODE 1, 80*25 16 couleurs */ - { - 0x67,0x00,0x03,0x00,0x03,0x00,0x02, - 0x5F,0x4F,0x50,0x82,0x55,0x81,0xBF,0x1F,0x00,0x4F,0x0D,0x0E,0x00,0x00,0x00,0x00, - 0x9C,0x0E,0x8F,0x28,0x1F,0x96,0xB9,0xA3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0x0C,0x00,0x0F,0x08,0x00, - 80,25 + 0x67, + 0x03, 0x08, 0x03, 0x00, 0x02, + 0x2D, 0x27, 0x28, 0x90, 0x2B, 0xA0, 0xBF, 0x1F, 0x00, + 0x4F, 0x0D, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x8E, 0x8F, 0x14, 0x1F, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x0C, 0x00, 0x0F, 0x08, 0x00, + 45, 25, 4 }, - /*MODE 2, 80*50 16 couleurs */ - { - 0x63,0x00,0x03,0x01,0x03,0x01,0x02, - 0x5F,0x4F,0x50,0x82,0x55,0x81,0xBF,0x1F,0x00,0x47,0x06,0x07,0x00,0x00,0x00,0x00, - 0x9C,0x8E,0x8F,0x28,0x1F,0x96,0xB9,0xA3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x10,0x11,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0x0C,0x00,0x0F,0x00,0x00, - 80,50 - }, - - /*MODE 3, 100*50 16 couleurs */ - { - 0x67,0x00,0x03,0x01,0x03,0x01,0x02, - 0x70,0x63,0x64,0x85,0x68,0x84,0xBF,0x1F,0x00,0x47,0x06,0x07,0x00,0x00,0x00,0x00, - 0x9C,0x8E,0x8F,0x32,0x1F,0x96,0xB9,0xA3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x10,0x11,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0x0C,0x00,0x0F,0x00,0x00, - 100,50 + /*80*25 16 couleurs mode 0x01*/ + { + 0x67, + 0x03, 0x00, 0x03, 0x00, 0x02, + 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, + 0x4F, 0x0D, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x0E, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x0C, 0x00, 0x0F, 0x08, 0x00, + 80, 25, 4 }, - /*MODE 4, 100*60 16 couleurs */ + /*80*50 16 couleurs mode 0x02*/ { - 0xA7,0x00,0x03,0x01,0x03,0x01,0x02, - 0x70,0x63,0x64,0x85,0x68,0x84,0xFF,0x1F,0x00,0x47,0x06,0x07,0x00,0x00,0x00,0x00, - 0xE7,0x8E,0xDF,0x32,0x1F,0xDF,0xE5,0xA3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x10,0x0E,0x00,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,0x10,0x11,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, - 0x0C,0x00,0x0F,0x00,0x00, - 100,60 + 0x63, + 0x03, 0x01, 0x03, 0x01, 0x02, + 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F, 0x00, + 0x47, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x8E, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x0C, 0x00, 0x0F, 0x00, 0x00, + 80, 50, 4 + }, + + /*100*50 16 couleurs mode 0x03*/ + { + 0x67, + 0x03, 0x01, 0x03, 0x01, 0x02, + 0x70, 0x63, 0x64, 0x85, 0x68, 0x84, 0xBF, 0x1F, 0x00, + 0x47, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x8E, 0x8F, 0x32, 0x1F, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x0C, 0x00, 0x0F, 0x00, 0x00, + 100, 50, 4 + }, + + /*100*60 16 couleurs mode 0x04*/ + { + 0xA7, + 0x03, 0x01, 0x03, 0x01, 0x02, + 0x70, 0x63, 0x64, 0x85, 0x68, 0x84, 0xFF, 0x1F, 0x00, + 0x47, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, + 0xE7, 0x8E, 0xDF, 0x32, 0x1F, 0xDF, 0xE5, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x0C, 0x00, 0x0F, 0x00, 0x00, + 100, 60, 4 } - }; + }; static mode_def graphmodes[maxgraphmode] = { - /*MODE 80, 320*200 256 couleurs */ + + /*640*480 n&b mode 0x80*/ { - 0x63,0x00,0x03,0x01,0x0F,0x00,0x06, - 0x5F,0x4F,0x50,0x82,0x54,0x80,0xBF,0x1F,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00, - 0x9C,0x0E,0x8F,0x28,0x00,0x96,0xB9,0xE3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0F,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x41,0x00,0x0F,0x00,0x00, - 40,25 + 0xE3, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xEA, 0x0C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x01, 0x00, 0x0F, 0x00, 0x00, + 80, 60, 1 }, - /*MODE 81, 320*400 256 couleurs */ + /*320*200 4 couleurs mode 0x81*/ { - 0x63,0x00,0x03,0x01,0x0F,0x00,0x06, - 0x5F,0x4F,0x50,0x82,0x54,0x80,0xBF,0x1F,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, - 0x9C,0x8E,0x8F,0x28,0x00,0x96,0xB9,0xE3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0F,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x41,0x00,0x0F,0x00,0x00, - 40,50 + 0x63, + 0x03, 0x09, 0x03, 0x00, 0x02, + 0x2D, 0x27, 0x28, 0x90, 0x2B, 0x80, 0xBF, 0x1F, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x0E, 0x8F, 0x14, 0x00, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x01, 0x00, 0x03, 0x00, 0x00, + 40, 25, 2 + }, + + /*640*480 16 couleurs mode 0x82*/ + { + 0xE3, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x5F, 0x4F, 0x50, 0x82, 0x53, 0x9F, 0x0B, 0x3E, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE9, 0x8B, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x01, 0x00, 0x0F, 0x00, 0x00, + 80, 60, 4 + }, + + /*720*480 16 couleurs mode 0x83*/ + { + 0xE7, + 0x03, 0x01, 0x08, 0x00, 0x06, + 0x6B, 0x59, 0x5A, 0x82, 0x60, 0x8D, 0x0B, 0x3E, 0x00, + 0x40, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, + 0xEA, 0x0C, 0xDF, 0x2D, 0x08, 0xE8, 0x05, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x01, 0x00, 0x0F, 0x00, 0x00, + 90, 60, 4 }, - /*MODE 82, 320*480 256 couleurs */ + /*800*600 16 couleurs mode 0x84*/ { - 0xE3,0x00,0x03,0x01,0x0F,0x00,0x06, - 0x5F,0x4F,0x50,0x82,0x54,0x80,0x0B,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, - 0xEA,0xAC,0xDF,0x28,0x00,0xE7,0x06,0xE3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0F,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x41,0x00,0x0F,0x00,0x00, - 40,60 + 0xE7, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x70, 0x63, 0x64, 0x92, 0x65, 0x82, 0x70, 0xF0, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5B, 0x8C, 0x57, 0x32, 0x00, 0x58, 0x70, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x01, 0x00, 0x0F, 0x00, 0x00, + 100, 75, 4 }, - /*MODE 83, 360*480 256 couleurs */ + /*320*200 256 couleurs RAPIDE mode 0x85*/ { - 0xE7,0x00,0x03,0x01,0x0F,0x00,0x06, - 0x6B,0x59,0x5A,0x8E,0x5E,0x8A,0x0D,0x3E,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, - 0xEA,0xAC,0xDF,0x2D,0x00,0xE7,0x06,0xE3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0F,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x41,0x00,0x0F,0x00,0x00, - 45,60 + 0x63, + 0x03, 0x01, 0x0F, 0x00, 0x0E, + 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x0E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 40, 25, 8 }, - /*MODE 84, 400*600 256 couleurs */ + /*320*200 256 couleurs mode 0x86*/ { - 0xE7,0x00,0x03,0x01,0x0F,0x00,0x06, - 0x74,0x63,0x64,0x97,0x68,0x95,0x86,0xF0,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00, - 0x5B,0x8D,0x57,0x32,0x00,0x60,0x80,0xE3,0xFF, - 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0F,0xFF, - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x41,0x00,0x0F,0x00,0x00, - 50,75 + 0x63, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x0E, 0x8F, 0x28, 0x00, 0x96, 0xB9, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 40, 25, 8 + }, + + /*320*400 256 couleurs mode 0x87*/ + { + 0x63, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9C, 0x8E, 0x8F, 0x28, 0x00, 0x96, 0xB9, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 40, 50, 8 + }, + + /*320*480 256 couleurs mode 0x88*/ + { + 0xE3, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xEA, 0xAC, 0xDF, 0x28, 0x00, 0xE7, 0x06, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 40, 60, 8 + }, + + /*360*480 256 couleurs mode 0x89*/ + { + 0xE7, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x6B, 0x59, 0x5A, 0x8E, 0x5E, 0x8A, 0x0D, 0x3E, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xEA, 0xAC, 0xDF, 0x2D, 0x00, 0xE7, 0x06, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 45, 60, 8 + }, + + /*400*600 256 couleurs mode 0x8A*/ + { + 0xE7, + 0x03, 0x01, 0x0F, 0x00, 0x06, + 0x74, 0x63, 0x64, 0x97, 0x68, 0x95, 0x86, 0xF0, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5B, 0x8D, 0x57, 0x32, 0x00, 0x60, 0x80, 0xE3, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x41, 0x00, 0x0F, 0x00, 0x00, + 50, 75, 8 } + }; From 352644824cc7d808ed8afadeab2072d57b479457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:19:06 +0000 Subject: [PATCH 28/62] feat: changement radical de syntaxe des fonctions Ajouts de commentaires --- lib/port.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/port.c b/lib/port.c index 4780c13..9d47102 100644 --- a/lib/port.c +++ b/lib/port.c @@ -1,6 +1,11 @@ #include "types.h" #include "asm.h" +/*******************************************************************************/ + +/* Envoie une série d'octet a destination d'une portion de mémoire +vers le registre video spécifié */ + void outreg(u16 port,u8 *src,u16 num) { int i; @@ -11,17 +16,27 @@ for(i=0;i Date: Mon, 2 Apr 2007 13:19:50 +0000 Subject: [PATCH 29/62] feat: polices 8x8 pour l'affichage en mode graphique et texte --- lib/8x8fnt.c | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 lib/8x8fnt.c diff --git a/lib/8x8fnt.c b/lib/8x8fnt.c new file mode 100644 index 0000000..da2e3d7 --- /dev/null +++ b/lib/8x8fnt.c @@ -0,0 +1,131 @@ +/* Police de caractère fine 8x8 */ +static u8 font8x8 [2048] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, + 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, + 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x7C, 0x38, 0x7C, + 0x10, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, + 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, + 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, + 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, 0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99, + 0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, + 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0xCC, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, + 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, + 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, + 0x90, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0xF8, 0x50, 0xF8, 0x50, 0x50, 0x00, + 0x20, 0x78, 0xA0, 0x70, 0x28, 0xF0, 0x20, 0x00, 0xC8, 0xC8, 0x10, 0x20, 0x40, 0x98, 0x98, 0x00, + 0x70, 0x88, 0x50, 0x20, 0x54, 0x88, 0x74, 0x00, 0x60, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x80, 0x80, 0x80, 0x40, 0x20, 0x00, 0x20, 0x10, 0x08, 0x08, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x20, 0xA8, 0x70, 0x70, 0xA8, 0x20, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, + 0x70, 0x88, 0x98, 0xA8, 0xC8, 0x88, 0x70, 0x00, 0x40, 0xC0, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x00, + 0x70, 0x88, 0x08, 0x10, 0x20, 0x40, 0xF8, 0x00, 0x70, 0x88, 0x08, 0x10, 0x08, 0x88, 0x70, 0x00, + 0x08, 0x18, 0x28, 0x48, 0xFC, 0x08, 0x08, 0x00, 0xF8, 0x80, 0x80, 0xF0, 0x08, 0x88, 0x70, 0x00, + 0x20, 0x40, 0x80, 0xF0, 0x88, 0x88, 0x70, 0x00, 0xF8, 0x08, 0x10, 0x20, 0x40, 0x40, 0x40, 0x00, + 0x70, 0x88, 0x88, 0x70, 0x88, 0x88, 0x70, 0x00, 0x70, 0x88, 0x88, 0x78, 0x08, 0x08, 0x70, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x20, + 0x10, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, + 0x80, 0x40, 0x20, 0x10, 0x20, 0x40, 0x80, 0x00, 0x78, 0x84, 0x04, 0x08, 0x10, 0x00, 0x10, 0x00, + 0x70, 0x88, 0x88, 0xA8, 0xB8, 0x80, 0x78, 0x00, 0x20, 0x50, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x00, + 0xF0, 0x88, 0x88, 0xF0, 0x88, 0x88, 0xF0, 0x00, 0x70, 0x88, 0x80, 0x80, 0x80, 0x88, 0x70, 0x00, + 0xF0, 0x88, 0x88, 0x88, 0x88, 0x88, 0xF0, 0x00, 0xF8, 0x80, 0x80, 0xE0, 0x80, 0x80, 0xF8, 0x00, + 0xF8, 0x80, 0x80, 0xE0, 0x80, 0x80, 0x80, 0x00, 0x70, 0x88, 0x80, 0x80, 0x98, 0x88, 0x78, 0x00, + 0x88, 0x88, 0x88, 0xF8, 0x88, 0x88, 0x88, 0x00, 0xE0, 0x40, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x00, + 0x38, 0x10, 0x10, 0x10, 0x10, 0x90, 0x60, 0x00, 0x88, 0x90, 0xA0, 0xC0, 0xA0, 0x90, 0x88, 0x00, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 0x00, 0x82, 0xC6, 0xAA, 0x92, 0x82, 0x82, 0x82, 0x00, + 0x84, 0xC4, 0xA4, 0x94, 0x8C, 0x84, 0x84, 0x00, 0x70, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, + 0xF0, 0x88, 0x88, 0xF0, 0x80, 0x80, 0x80, 0x00, 0x70, 0x88, 0x88, 0x88, 0xA8, 0x90, 0x68, 0x00, + 0xF0, 0x88, 0x88, 0xF0, 0xA0, 0x90, 0x88, 0x00, 0x70, 0x88, 0x80, 0x70, 0x08, 0x88, 0x70, 0x00, + 0xF8, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, + 0x88, 0x88, 0x88, 0x50, 0x50, 0x20, 0x20, 0x00, 0x82, 0x82, 0x82, 0x82, 0x92, 0x92, 0x6C, 0x00, + 0x88, 0x88, 0x50, 0x20, 0x50, 0x88, 0x88, 0x00, 0x88, 0x88, 0x88, 0x50, 0x20, 0x20, 0x20, 0x00, + 0xF8, 0x08, 0x10, 0x20, 0x40, 0x80, 0xF8, 0x00, 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x00, + 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0xE0, 0x20, 0x20, 0x20, 0x20, 0x20, 0xE0, 0x00, + 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, + 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x78, 0x88, 0x74, 0x00, + 0x80, 0x80, 0xB0, 0xC8, 0x88, 0xC8, 0xB0, 0x00, 0x00, 0x00, 0x70, 0x88, 0x80, 0x88, 0x70, 0x00, + 0x08, 0x08, 0x68, 0x98, 0x88, 0x98, 0x68, 0x00, 0x00, 0x00, 0x70, 0x88, 0xF8, 0x80, 0x70, 0x00, + 0x30, 0x48, 0x40, 0xE0, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x34, 0x48, 0x48, 0x38, 0x08, 0x30, + 0x80, 0x80, 0xB0, 0xC8, 0x88, 0x88, 0x88, 0x00, 0x20, 0x00, 0x60, 0x20, 0x20, 0x20, 0x70, 0x00, + 0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x90, 0x60, 0x80, 0x80, 0x88, 0x90, 0xA0, 0xD0, 0x88, 0x00, + 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0xE0, 0x00, 0x00, 0x00, 0xEC, 0x92, 0x92, 0x92, 0x92, 0x00, + 0x00, 0x00, 0xB0, 0xC8, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, + 0x00, 0x00, 0xB0, 0xC8, 0xC8, 0xB0, 0x80, 0x80, 0x00, 0x00, 0x68, 0x98, 0x98, 0x68, 0x08, 0x08, + 0x00, 0x00, 0xB0, 0xC8, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x78, 0x80, 0x70, 0x08, 0xF0, 0x00, + 0x40, 0x40, 0xE0, 0x40, 0x40, 0x50, 0x20, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x98, 0x68, 0x00, + 0x00, 0x00, 0x88, 0x88, 0x88, 0x50, 0x20, 0x00, 0x00, 0x00, 0x82, 0x82, 0x92, 0x92, 0x6C, 0x00, + 0x00, 0x00, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x88, 0x88, 0x98, 0x68, 0x08, 0x70, + 0x00, 0x00, 0xF8, 0x10, 0x20, 0x40, 0xF8, 0x00, 0x10, 0x20, 0x20, 0x40, 0x20, 0x20, 0x10, 0x00, + 0x40, 0x40, 0x40, 0x00, 0x40, 0x40, 0x40, 0x00, 0x40, 0x20, 0x20, 0x10, 0x20, 0x20, 0x40, 0x00, + 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, + 0x3E, 0x60, 0xC0, 0x60, 0x3E, 0x08, 0x04, 0x18, 0x00, 0x48, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, + 0x18, 0x20, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x10, 0x28, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, + 0x00, 0x48, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x30, 0x08, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, + 0x48, 0x30, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x10, 0x08, 0x30, + 0x30, 0x48, 0x84, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0x48, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, + 0x30, 0x08, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00, 0x48, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x48, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x10, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x48, 0x00, 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0x30, 0x48, 0x30, 0x48, 0x84, 0xFC, 0x84, 0x84, + 0x18, 0x20, 0x00, 0xF8, 0x80, 0xF0, 0x80, 0xF8, 0x00, 0x00, 0x00, 0x66, 0x19, 0x77, 0x88, 0x77, + 0x00, 0x00, 0x00, 0x0F, 0x14, 0x3E, 0x44, 0x87, 0x30, 0x48, 0x84, 0x78, 0xCC, 0xCC, 0xCC, 0x78, + 0x00, 0x48, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x60, 0x10, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, + 0x30, 0x48, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x60, 0x10, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, + 0x48, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, 0x44, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, + 0x24, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x08, 0x1C, 0x28, 0x28, 0x1C, 0x08, 0x00, + 0x1C, 0x22, 0x20, 0x70, 0x20, 0x22, 0x5C, 0x00, 0x44, 0x28, 0x10, 0x10, 0x38, 0x10, 0x38, 0x10, + 0xF0, 0x88, 0x8A, 0xF7, 0x82, 0x82, 0x83, 0x00, 0x06, 0x08, 0x08, 0x3C, 0x10, 0x10, 0x60, 0x00, + 0x18, 0x20, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x18, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x18, 0x20, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x18, 0x20, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, + 0x80, 0x78, 0x04, 0xF8, 0xCC, 0xCC, 0xCC, 0xCC, 0x80, 0x7E, 0x01, 0xC6, 0xE6, 0xD6, 0xCE, 0xC6, + 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0xFE, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0xFC, + 0x00, 0x00, 0x18, 0x18, 0x30, 0x60, 0x66, 0x3C, 0xFF, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xC4, 0x48, 0x50, 0x26, 0x49, 0x82, 0x07, + 0x40, 0xC4, 0x48, 0x50, 0x26, 0x4A, 0x9F, 0x02, 0x00, 0x30, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x00, 0x12, 0x24, 0x48, 0x90, 0x48, 0x24, 0x12, 0x00, 0x48, 0x24, 0x12, 0x09, 0x12, 0x24, 0x48, + 0x49, 0x00, 0x92, 0x00, 0x49, 0x00, 0x92, 0x00, 0x6D, 0x00, 0xB6, 0x00, 0x6D, 0x00, 0xB6, 0x00, + 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x10, 0x10, + 0x28, 0x28, 0x28, 0x28, 0xE8, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x28, 0x28, 0x28, + 0x00, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0x28, 0x28, 0x28, 0xE8, 0x08, 0xE8, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0xF8, 0x08, 0xE8, 0x28, 0x28, + 0x28, 0x28, 0x28, 0xE8, 0x08, 0xF8, 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0xF8, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, 0x3F, 0x28, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x2F, 0x20, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x20, 0x2F, 0x28, 0x28, + 0x28, 0x28, 0x28, 0xEF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xEF, 0x28, 0x28, + 0x28, 0x28, 0x28, 0x2F, 0x20, 0x2F, 0x28, 0x28, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, + 0x28, 0x28, 0x28, 0xEF, 0x00, 0xEF, 0x28, 0x28, 0x10, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x28, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x3F, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x3F, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xFF, 0x28, 0x28, 0x28, + 0x10, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x34, 0x4C, 0x4C, 0x32, 0x00, 0x5C, 0x22, 0x22, 0x3C, 0x44, 0x44, 0x78, + 0x7E, 0x42, 0x42, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x02, 0x7C, 0xA8, 0x28, 0x28, 0x44, + 0x00, 0x7E, 0x61, 0x30, 0x18, 0x08, 0x10, 0x20, 0x00, 0x00, 0x08, 0x7F, 0x88, 0x88, 0x88, 0x70, + 0x00, 0x00, 0x00, 0x22, 0x44, 0x44, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x7C, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x1C, 0x08, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x00, 0x38, 0x44, 0x44, 0x7C, 0x44, 0x44, + 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0x66, 0x24, 0x66, 0x0C, 0x10, 0x08, 0x1C, 0x22, 0x22, 0x22, 0x1C, + 0x00, 0x00, 0x00, 0x00, 0x6C, 0x92, 0x92, 0x6C, 0x00, 0x01, 0x1A, 0x26, 0x2A, 0x32, 0x2C, 0x40, + 0x00, 0x18, 0x20, 0x20, 0x30, 0x20, 0x20, 0x18, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, + 0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x3E, + 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00, 0x3E, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00, 0x3E, + 0x00, 0x06, 0x09, 0x09, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x48, 0x48, 0x30, + 0x00, 0x00, 0x08, 0x00, 0x3E, 0x00, 0x08, 0x00, 0x00, 0x60, 0x92, 0x0C, 0x60, 0x92, 0x0C, 0x00, + 0x60, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0xC8, 0x28, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x7C, 0x42, 0x42, 0x42, 0x00, 0x18, 0x24, 0x08, 0x10, 0x3C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3E, 0x3E, 0x3E, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; From ff555b167aac38c7464375136e364005b6d394b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:19:57 +0000 Subject: [PATCH 30/62] feat: polices 8x16 pour l'affichage en mode graphique et texte --- lib/8x16fnt.c | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 lib/8x16fnt.c diff --git a/lib/8x16fnt.c b/lib/8x16fnt.c new file mode 100644 index 0000000..dbb91d0 --- /dev/null +++ b/lib/8x16fnt.c @@ -0,0 +1,259 @@ +/* Police de caractère fine 8x16 */ +static u8 font8x16 [4096] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0x81, 0xBD, 0x99, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7E, 0xFF, 0xDB, 0xFF, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x36, 0x7F, 0x7F, 0x7F, 0x7F, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x1C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x3C, 0xE7, 0xE7, 0xE7, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x0F, 0x07, 0x0D, 0x19, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x30, 0x70, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x63, 0x67, 0xE7, 0xE6, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0xDB, 0x3C, 0xE7, 0x3C, 0xDB, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x60, 0x70, 0x7C, 0x7F, 0x7C, 0x70, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x03, 0x07, 0x1F, 0x7F, 0x1F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0xDB, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3E, 0x63, 0x30, 0x1C, 0x36, 0x63, 0x63, 0x36, 0x1C, 0x06, 0x63, 0x3E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0C, 0x06, 0x7F, 0x06, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x7F, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x3E, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x3E, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x42, 0x42, 0xFF, 0x42, 0x42, 0x42, 0xFF, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x7E, 0x90, 0x90, 0x90, 0x7C, 0x12, 0x12, 0x12, 0xFC, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x61, 0x91, 0x92, 0x64, 0x08, 0x10, 0x26, 0x49, 0x89, 0x86, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x88, 0x88, 0x88, 0x50, 0x60, 0x91, 0x8A, 0x84, 0x4A, 0x31, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x18, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x18, 0x20, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x18, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0xFE, 0x38, 0x54, 0x92, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x10, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x83, 0x85, 0x89, 0x91, 0xA1, 0xC1, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x30, 0x50, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x01, 0x02, 0x3C, 0x40, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x01, 0x02, 0x3C, 0x02, 0x01, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x06, 0x0A, 0x12, 0x22, 0x42, 0x82, 0xFF, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0x80, 0x80, 0x80, 0xFC, 0x02, 0x01, 0x01, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x80, 0xBC, 0xC2, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0x81, 0x01, 0x02, 0x04, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x42, 0x3C, 0x42, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x43, 0x3D, 0x01, 0x01, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x10, 0x20, 0x00, 0x00, + 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x44, 0x82, 0x82, 0x04, 0x08, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x99, 0xA5, 0xA5, 0xA5, 0x9E, 0x80, 0x41, 0x3E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x24, 0x42, 0x81, 0x81, 0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x42, 0x41, 0x41, 0x42, 0x7C, 0x42, 0x41, 0x41, 0x42, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x80, 0x80, 0x80, 0x80, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x42, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x80, 0x9F, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x82, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x82, 0x84, 0x88, 0x90, 0xE0, 0x90, 0x88, 0x84, 0x82, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0xC3, 0xA5, 0x99, 0x99, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0xC1, 0xA1, 0x91, 0x89, 0x85, 0x83, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x82, 0x81, 0x81, 0x82, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x89, 0x85, 0x42, 0x3D, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x82, 0x81, 0x81, 0x82, 0xFC, 0x90, 0x88, 0x84, 0x82, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x42, 0x81, 0x80, 0x40, 0x3C, 0x02, 0x01, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFE, 0x92, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x99, 0x99, 0xA5, 0xA5, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x81, 0x81, 0x81, 0x42, 0x24, 0x18, 0x24, 0x42, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x82, 0x82, 0x82, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0x01, 0x01, 0x02, 0x04, 0x18, 0x20, 0x40, 0x80, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7E, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x24, 0x42, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x02, 0x02, 0x7E, 0x82, 0x82, 0x7D, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0xBC, 0xC2, 0x81, 0x81, 0x81, 0xC2, 0xBC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x42, 0x80, 0x80, 0x80, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x01, 0x01, 0x01, 0x3D, 0x43, 0x81, 0x81, 0x81, 0x43, 0x3D, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x42, 0x81, 0xFF, 0x80, 0x40, 0x3E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0E, 0x11, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x43, 0x81, 0x81, 0x43, 0x3D, 0x01, 0x02, 0x7C, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0xBC, 0xC2, 0x81, 0x81, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x08, 0x00, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x00, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x82, 0x44, 0x38, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x80, 0x80, 0x82, 0x84, 0x88, 0x90, 0xA8, 0xC4, 0x82, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xC4, 0x82, 0x82, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xBC, 0xC2, 0x81, 0x81, 0x81, 0xC2, 0xBC, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x43, 0x81, 0x81, 0x81, 0x43, 0x3D, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0xC1, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0x80, 0x7E, 0x01, 0x81, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x43, 0x3D, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x42, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x92, 0x92, 0x92, 0xAA, 0x44, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x42, 0x24, 0x18, 0x24, 0x42, 0x81, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x43, 0x3D, 0x01, 0x02, 0x7C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x02, 0x04, 0x18, 0x20, 0x40, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x08, 0x10, 0x10, 0x10, 0x20, 0x10, 0x10, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x20, 0x10, 0x10, 0x10, 0x08, 0x10, 0x10, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x99, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x36, 0x63, 0x63, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1E, 0x33, 0x61, 0x60, 0x60, 0x61, 0x33, 0x1E, 0x06, 0x03, 0x3E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x0C, 0x18, 0x00, 0x3E, 0x63, 0x7F, 0x60, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x1C, 0x36, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x18, 0x0C, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1C, 0x36, 0x1C, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x66, 0x3C, 0x0C, 0x06, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x1C, 0x36, 0x00, 0x3E, 0x63, 0x7F, 0x60, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x00, 0x3E, 0x63, 0x7F, 0x60, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x18, 0x0C, 0x00, 0x3E, 0x63, 0x7F, 0x60, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x63, 0x63, 0x08, 0x1C, 0x36, 0x63, 0x63, 0x7F, 0x63, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1C, 0x36, 0x1C, 0x00, 0x1C, 0x36, 0x63, 0x63, 0x7F, 0x63, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x18, 0x30, 0x00, 0x7F, 0x33, 0x30, 0x3E, 0x30, 0x33, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6E, 0x3B, 0x1B, 0x7E, 0xD8, 0xDC, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1F, 0x36, 0x66, 0x66, 0x7F, 0x66, 0x66, 0x66, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x1C, 0x36, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x63, 0x63, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x18, 0x0C, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3C, 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x18, 0x0C, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x63, 0x63, 0x00, 0x63, 0x63, 0x63, 0x63, 0x3F, 0x03, 0x06, 0x3C, 0x00, 0x00, 0x00, + 0x00, 0x63, 0x63, 0x1C, 0x36, 0x63, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x63, 0x63, 0x00, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x18, 0x7E, 0xC3, 0xC0, 0xC0, 0xC3, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1C, 0x36, 0x32, 0x30, 0x78, 0x30, 0x30, 0x30, 0x73, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC3, 0x66, 0x3C, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0x66, 0x66, 0x7C, 0x62, 0x66, 0x6F, 0x66, 0x66, 0xF3, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0E, 0x1B, 0x18, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18, 0x18, 0xD8, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x0C, 0x18, 0x30, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0C, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0C, 0x18, 0x30, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0C, 0x18, 0x30, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3B, 0x6E, 0x00, 0x6E, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3B, 0x6E, 0x00, 0x63, 0x73, 0x7B, 0x7F, 0x6F, 0x67, 0x63, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x30, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x60, 0xE0, 0x63, 0x66, 0x6C, 0x18, 0x30, 0x6E, 0xC3, 0x06, 0x0C, 0x1F, 0x00, 0x00, 0x00, + 0x00, 0x60, 0xE0, 0x63, 0x66, 0x6C, 0x18, 0x33, 0x67, 0xCF, 0x1F, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1B, 0x36, 0x6C, 0x36, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6C, 0x36, 0x1B, 0x36, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x00, 0x00, + 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x00, 0x00, + 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x6E, 0x6C, 0x6C, 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3E, 0x63, 0x7E, 0x63, 0x63, 0x7E, 0x60, 0x60, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x63, 0x63, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7F, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x63, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x63, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x6C, 0x6C, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3B, 0x6E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7E, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1C, 0x36, 0x63, 0x63, 0x7F, 0x63, 0x63, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x36, 0x36, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1E, 0x30, 0x18, 0x0C, 0x3E, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x06, 0x7E, 0xDB, 0xDB, 0xF3, 0x7E, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1C, 0x30, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3B, 0x6E, 0x00, 0x3B, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0F, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xD8, 0x6C, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0xD8, 0x30, 0x60, 0xC8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; From 1652e1239cf1ef85a7768cc17ab48b2e054a7b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:20:26 +0000 Subject: [PATCH 31/62] =?UTF-8?q?feat:=20ensemble=20de=20fonctions=20perme?= =?UTF-8?q?ttant=20la=20gestion=20des=20IRQs=20et=20des=20interruptions=20?= =?UTF-8?q?en=20mode=20prot=C3=A9g=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/irq.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/irq.c diff --git a/lib/irq.c b/lib/irq.c new file mode 100644 index 0000000..6c78754 --- /dev/null +++ b/lib/irq.c @@ -0,0 +1,36 @@ +void setpic(void) +{ + /* MASTER */ + /* Initialisation de ICW1 */ + outbp(0x20,0x11); + /* Initialisation de ICW2 - vecteur de depart = 32 */ + outbp(0x21,0x20); + /* Initialisation de ICW3 */ + outbp(0x21,0x04); + /* Initialisation de ICW4 */ + outbp(0x21,0x01); + /* masquage des interruptions */ + outbp(0x21,0xFF); + /* SLAVE */ + /* Initialisation de ICW1 */ + outbp(0xA0,0x11); + /* Initialisation de ICW2 - vecteur de depart = 96 */ + outbp(0xA1,0x70); + /* Initialisation de ICW3 */ + outbp(0xA1,0x02); + /* Initialisation de ICW4 */ + outbp(0xA1,0x01); + /* masquage des interruptions */ + outbp(0xA1,0xFF); + /* Demasquage des irqs */ + outbp(0x21,0xFD); +} + +void makeidtdesc(u32 offset, u16 select, u16 type, idtdesc* desc) +{ + desc->offset0_15 = (offset & 0xffff); + desc->select = select; + desc->type = type; + desc->offset16_31 = (offset & 0xffff0000) >> 16; + return; +} From a772f00d9a200083f86a8d4b14c719bd2d5b594b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:20:55 +0000 Subject: [PATCH 32/62] feat: ensemble de fonctions permettant la gestion de l'affichage en mode VGA --- lib/vga.c | 531 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 531 insertions(+) create mode 100644 lib/vga.c diff --git a/lib/vga.c b/lib/vga.c new file mode 100644 index 0000000..714b59e --- /dev/null +++ b/lib/vga.c @@ -0,0 +1,531 @@ +#include "vga.h" +#include "memory.h" +#include "asm.h" +#include "port.h" + +#include "modes.c" +#include "8x8fnt.c" +#include "8x16fnt.c" + +/* Registres VGAs */ +#define sequencer 0x3c4 +#define misc 0x3c2 +#define ccrt 0x3D4 +#define attribs 0x3c0 +#define graphics 0x3ce +#define state 0x3da +/* Taille d'un plan de bit */ +#define planesize 0x10000 + + +static u16 resX,resY; /* resolution x,y en caractères*/ +static u16 cursX,cursY; /* position du curseur */ +static u8 pages,activepage; /* nombre de pages disponibles N° de la page active*/ +static u32 linesize,pagesize;/* Taille d'une ligne et d'une page */ +static u8 vmode=0xFF,color; /* mode en cours d'utilisation et profondeur */ +static u32 basemem; /* Adresse de la mémoire vidéo */ +static bool scrolling,graphic;/* Activation du défilement, Flag du mode graphique */ +static u8 font; /* n° font active */ + +/*******************************************************************************/ + +/* Attend la retrace verticale */ + +void waitvretrace (void) +{ + while ((inb(state)&8)==0); +} + +/*******************************************************************************/ + +/* Attend la retrace horizontale */ + +void waithretrace (void) +{ + while ((inb(state)&1)==0); +} + +/*******************************************************************************/ + +/* Active l'affichage du curseur de texte */ + +void enablecursor (void) +{ + u8 curs; + /* active le curseur hardware */ + outb(ccrt, 10); + curs = inb(ccrt+1)&~32; + outb(ccrt+1, curs); + /* fixe la position du curseur hardware */ + gotoscr(cursX,cursY); +} + +/*******************************************************************************/ + +/* Desactive l'affichage du curseur de texte */ + +void disablecursor (void) +{ + u8 curs; + /* desactive le curseur hardware */ + outb(ccrt, 10); + curs = inb(ccrt+1)|32; + outb(ccrt+1, curs); +} + +/*******************************************************************************/ + +/* Active le scrolling en cas de débordement d'écran */ + +void enablescroll (void) +{ + scrolling=true; +} + +/*******************************************************************************/ + +/* Desactive le scrolling en cas de débordement d'écran */ + +void disablescroll (void) +{ + scrolling=false; +} + +/*******************************************************************************/ + +/* Utilise le plan de bit spécifié */ + +void useplane(u8 plan) +{ + u8 mask; + plan &= 3; + mask = 1 << plan; + /* choisi le plan de lecture */ + outb(graphics, 4); + outb(graphics+1, plan); + /* choisi le plan d'ecriture */ + outb(sequencer, 2); + outb(sequencer+1, mask); +} + +/*******************************************************************************/ + +/* Renvoie l'adresse du segment video */ + +u32 getbase(void) +{ + u32 base; + outb(graphics, 6); + base = inb(graphics+1); + base >>= 2; + base &= 3; + switch(base) + { + case 0: + case 1: + base = 0xA0000; + break; + case 2: + base = 0xB0000; + break; + case 3: + base = 0xB8000; + break; + } + return base; +} + +/*******************************************************************************/ + +/* efface l'écran */ + +void (*cls)(void); + +void cls_text (void) +{ + gotoscr(0,0); + memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); +} + +void cls_chain (void) +{ + gotoscr(0,0); + memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); +} + +void cls_unchain (void) +{ + gotoscr(0,0); + int i; + for(i=0;i<4;i++) + { + useplane(i); + memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); + } +} + +/*******************************************************************************/ + +/* fixe la position du curseur texte */ + +void gotoscr(u16 x,u16 y) +{ + u16 pos; + pos=(cursX+cursY*resX)/2; + cursX=x; + cursY=y; + outb(ccrt,0x0E); + outb(ccrt+1,(u8)(pos&0x00FF)); + outb(ccrt,0x0D); + outb(ccrt+1,(u8)((pos&0xFF00)>>8)); +} + +/*******************************************************************************/ + +/* Fait defiler l'ecran de n lignes vers le haut */ + +void (*scroll)(u8 lines); + +void scroll_unchain(u8 lines) +{ + u8 i; + for(i=0;i<4;i++) + { + useplane(i); + memcpy((u8*)(basemem+linesize*8*lines),(u8*)basemem,pagesize-linesize*8*lines,1); + memset((u8*)(basemem+pagesize-linesize*8*lines),0,linesize*8*lines,1); + } +} + +void scroll_chain(u8 lines) +{ + memcpy((u8*)basemem+linesize*8*lines,(u8*)basemem,pagesize-linesize*8*lines,1); + memset((u8*)(basemem+pagesize-linesize*8*lines),0,linesize*8*lines,1); +} + +void scroll_text(u8 lines) +{ + memcpy((u8*)basemem+linesize*lines,(u8*)basemem,pagesize-linesize*lines,1); + memset((u8*)(basemem+pagesize-linesize*lines),0,linesize*lines,1); +} + +/*******************************************************************************/ + +/* Affiche le caractère a l'écran */ + +void (*showchar)(u8 thechar); + +void showchar_graphic(u8 thechar) +{ + u8 x,y,pattern,color; + for(y=0;y<8;y++) + { + pattern=font8x8[thechar*8+y]; + for(x=0;x<8;x++) + { + color=((pattern>>(7-x))&0x1); /* mettre un ROL importé depuis asm */ + writepxl(cursX*8+x,cursY*8+y,color*7); + } + } + if (++cursX>=resX) + { + cursX=0; + if (++cursY>=resY) + { + scroll(1); + cursY=resY-1; + } + } +} + +void showchar_text(u8 thechar) +{ + u8 *screen; + screen = (u8 *)basemem+activepage*pagesize+2*(cursX+cursY*resX); + *screen = thechar; + *(++screen) = 0x07; + if (++cursX>=resX) + { + cursX=0; + if (++cursY>=resY) + { + scroll(1); + cursY=resY-1; + } + } + gotoscr(cursX,cursY); +} + +/*******************************************************************************/ + +/* Ecrit un pixel a l'écran */ + +void (*writepxl)(u16 x, u16 y, u32 c); + +void writepxl_1bit(u16 x, u16 y, u32 c) +{ + u8* off; + u8 mask; + c = (c & 1) * 0xFF; + off = (u8*)(basemem+activepage*pagesize+linesize * y + x / 8); + x = (x & 7) * 1; + mask = 0x80 >> x; + *off= ((*off) & ~mask) | (c & mask); +} + +void writepxl_2bits(u16 x, u16 y, u32 c) +{ + u8 *off; + u8 mask; + c = (c & 3) * 0x55; + off = (u8*)(basemem+activepage*pagesize+linesize * y + x / 4); + x = (x & 3) * 2; + mask = 0xC0 >> x; + *off= ((*off) & ~mask) | (c & mask); +} + +void writepxl_4bits(u16 x, u16 y, u32 c) +{ + u8* off; + u8 mask, p, pmask; + off = (u8*)(basemem+activepage*pagesize+linesize * y + x / 8); + x = (x & 7) * 1; + mask = 0x80 >> x; + pmask = 1; + for(p = 0; p < 4; p++) + { + useplane(p); + if(pmask & c) + *off= ((*off) | mask); + else + *off= ((*off) & ~mask); + pmask <<= 1; + } +} + +void writepxl_8bits(u16 x, u16 y, u32 c) +{ + u8* off; + off = (u8*)(basemem+activepage*pagesize+linesize * y + x); + *off=c; +} + +void writepxl_8bitsunchain(u16 x, u16 y, u32 c) +{ + u8* off; + off = (u8*)(basemem+activepage*pagesize+linesize * y + x / 4); + useplane(x & 3); + *off=c; +} + +/*******************************************************************************/ + +/* Change le mode video courant */ + +u32 setvmode(u8 mode) +{ + u8 *def,i,gmode; + /* Récupere la definition des registres VGA en fonction du mode +graphique : >0x80 +text : 0x00 - 0x7F +*/ + if (mode>=0x80) + { + gmode=mode-0x80; + if (gmode>maxgraphmode) return 1; /* mode inexistant */ + def=graphmodes[gmode]; + graphic=true; + } + else + { + if (mode>maxtextmode) return 1; /* mode inexistant */ + def=textmodes[mode]; + graphic=false; + loadfont(font8x8,8,1); + loadfont(font8x16,16,0); + } + /* Initialise les registre "divers" */ + outb(misc,def[0]); + /* Initialise les registre d'etat */ + outb(state,0x00); + /* Initialise le séquenceur */ + outreg(sequencer,&def[1],5); + /* Debloque le verouillage des registres controleur CRT */ + outb(ccrt,0x11); + outb(ccrt+1,0x0E); + /* Initialise le controleur CRT */ + outreg(ccrt,&def[6],25); + /* Initialise le controleur graphique */ + outreg(graphics,&def[31],9); + inb(state); + /* Initialise le controleur d'attributs */ + outregsame(attribs,&def[40],21); + inb(state); + outb(attribs,0x20); + /* Récupere depuis la table de définition des mode la résolution et la +profondeur (en bits) */ + resX=def[61]; + resY=def[62]; + color=def[63]; + /* Remet la position du curseur logiciel a 0,0 */ + cursX=0; + cursY=0; + /* Initialise l'adresse des procedures de gestion graphique et les differentes +variables en fonction de la profondeur et du mode*/ + if (!graphic) + { + /* mode texte */ + linesize=resX*2; + writepxl=NULL; /* pas d'affichage de pixels */ + showchar=showchar_text; + scroll=scroll_text; + cls=cls_text; + pagesize=resY*linesize; + } + else + { + switch(color) + { + case 1: + /* mode N&B */ + linesize=resX; + writepxl=writepxl_1bit; + cls=cls_chain; + scroll=scroll_chain; + break; + case 2: + /* mode 4 couleurs */ + linesize=(resX<<1); + writepxl=writepxl_2bits; + cls=cls_chain; + scroll=scroll_chain; + break; + case 4: + /* mode 16 couleurs */ + linesize=resX; + writepxl=writepxl_4bits; + cls=cls_unchain; + scroll=scroll_unchain; + break; + case 8: + /* mode 256 couleurs */ + if (def[5]==0x0E) + { + /* mode chainé (plus rapide mais limité en mémoire) */ + linesize=(resX<<3); + writepxl=writepxl_8bits; + scroll=scroll_chain; + cls=cls_chain; + } + else + { + /* mode non chainé */ + linesize=(resX<<1); + writepxl=writepxl_8bitsunchain; + scroll=scroll_unchain; + cls=cls_unchain; + } + break; + default: + break; + } + showchar=showchar_graphic; + pagesize=((resY*linesize)<<3); + } + /* calcul des variables d'état video */ + activepage=0; + vmode=mode; + pages=(planesize/pagesize); + basemem=(def[20]<<8)+def[21]+getbase(); + return 0; +} + +/*******************************************************************************/ + +/* Récupère le mode vidéo en cours */ + +u8 getvmode(void) +{ + return vmode; +} + +/*******************************************************************************/ + +/* Charge une nouvelle police de caractère */ + +u32 loadfont(u8* def,u8 size,u8 font) +{ + if (graphics==1) return 1; + u8 oldregs[5]={0,0,0,0,0}; + u8* base; + u16 i; + if (font>7) return 1; + if (font<4) + base = (u8 *)(getbase()+(font<<14)); + else + base = (u8 *)(getbase()+((((font-4)<<1)+1)<<13)); + /* sauve les anciens registres */ + outb(sequencer,2); + oldregs[0]=inb(sequencer+1); + + outb(sequencer,4); + oldregs[1]=inb(sequencer+1); + /* Adressage paire/impair desactivé (lineaire) */ + outb(sequencer+1, oldregs[1]|0x04); + + outb(graphics,4); + oldregs[2]=inb(graphics+1); + + outb(graphics,5); + oldregs[3]=inb(graphics+1); + /* Adressage paire/impair desactivé (lineaire) */ + outb(graphics+1, oldregs[3]&~0x10); + + outb(graphics,6); + oldregs[4]=inb(graphics+1); + /* Adressage paire/impair desactivé (lineaire) */ + outb(graphics+1, oldregs[4] & ~0x02); + /* utilisation du plan N°2 */ + useplane(2); + for(i=0; i < 256; i++) + { + memcpy(def,base+i*32,size,1); + def += size; + } + + outb(sequencer,2); + outb(sequencer+1,oldregs[0]); + outb(sequencer,4); + outb(sequencer+1,oldregs[1]); + outb(graphics,4); + outb(graphics+1,oldregs[2]); + outb(graphics,5); + outb(graphics+1,oldregs[3]); + outb(graphics,6); + outb(graphics+1,oldregs[4]); + return 0; +} + +/*******************************************************************************/ + +/* Récupere le N° de la police de caractère en cours d'utilisation */ + +u8 getfont(u8 num) +{ + return font; +} + +/*******************************************************************************/ + +/* Fixe le N° de la police de caractère a utiliser */ + +void setfont(u8 num) +{ + font=num&0x07; + outb(sequencer,3); + outb(sequencer+1,(num&0x03)+((num&0x04)<<2)); +} + +/*******************************************************************************/ + + From 59757b7b70f52eda2e4b70b3aed9218f1f3b2818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:21:28 +0000 Subject: [PATCH 33/62] =?UTF-8?q?feat:=20ensemble=20de=20fonctions=20perme?= =?UTF-8?q?ttant=20la=20gestion=20de=20l'affichage=20de=20fa=C3=A7on=20ind?= =?UTF-8?q?=C3=A9pendante=20du=20mat=C3=A9riel=20(console/STDOUT)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/video.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/video.c diff --git a/lib/video.c b/lib/video.c new file mode 100644 index 0000000..54fd7e9 --- /dev/null +++ b/lib/video.c @@ -0,0 +1,29 @@ +#include "vga.h" +#include "video.h" + +/*******************************************************************************/ + +/* affiche une chaine de caractère a l'écran */ + +void print(u8* string) +{ + u8 *source; + source = string; + while(*source!=0x00) + { + showchar(*source++); + } +} + +/*******************************************************************************/ + +/* affiche un octet sous forme hexadécimale a l'ecran */ + +void showhex(u8 src) +{ + static u8 hexadigit[16] = "0123456789ABCDEF"; + showchar(hexadigit[(src&0xF0)>>4]); + showchar(hexadigit[src&0x0F]); +} + +/*******************************************************************************/ From 759e88c1180de8f5f09f510218929daf4e79d804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:21:56 +0000 Subject: [PATCH 34/62] build: ajout des nouveaux modules a compiler --- lib/makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/makefile b/lib/makefile index 451ad18..aa6f96b 100644 --- a/lib/makefile +++ b/lib/makefile @@ -1,20 +1,25 @@ FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c -PARTIAL=-r -OBJS= memory.o port.o vgatxt.o +PARTIAL=ld -r -o +OBJS= memory.o vga.o port.o video.o all: makeall -makeall: $(OBJS) - (sync;ld $(PARTIAL) -o libs.o $(OBJS)) +makeall: libs.o -vgatxt.o:vgatxt.c +libs.o:$(OBJS) + $(PARTIAL) libs.o $(OBJS) + +vga.o:vga.c + $(FREEC) $^ + +video.o:video.c + $(FREEC) $^ + +port.o:port.c $(FREEC) $^ memory.o:memory.c $(FREEC) $^ - -port.o:port.c - $(FREEC) $^ clean: rm -f *.o From 755099ca3eb20cd51eb95168774f90c4d2f78cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:23:13 +0000 Subject: [PATCH 35/62] =?UTF-8?q?feat:=20suppression=20de=20"fonts.c"=20et?= =?UTF-8?q?=20"vgatxt.c"=20qui=20seront=20respectivement=20remplac=C3=A9?= =?UTF-8?q?=20par=20"8x8fnt.c","8x16fnt.c"=20et=20"vga.c","video.c"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/fonts.c | 130 ------------------------------------------ lib/vgatxt.c | 156 --------------------------------------------------- 2 files changed, 286 deletions(-) delete mode 100644 lib/fonts.c delete mode 100644 lib/vgatxt.c diff --git a/lib/fonts.c b/lib/fonts.c deleted file mode 100644 index e786385..0000000 --- a/lib/fonts.c +++ /dev/null @@ -1,130 +0,0 @@ -static u8 font8x8 [2048] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, - 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, 0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, - 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, 0x38, 0x7C, 0x38, 0xFE, 0xFE, 0xD6, 0x10, 0x38, - 0x10, 0x38, 0x7C, 0xFE, 0xFE, 0x7C, 0x10, 0x38, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, - 0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, 0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, - 0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, 0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, - 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, 0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, - 0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, 0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18, - 0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, 0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, - 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, - 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, - 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, - 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, - 0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, - 0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, - 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, - 0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18, 0x00, 0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, - 0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, - 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, - 0x38, 0x6C, 0xC6, 0xD6, 0xC6, 0x6C, 0x38, 0x00, 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, - 0x7C, 0xC6, 0x06, 0x1C, 0x30, 0x66, 0xFE, 0x00, 0x7C, 0xC6, 0x06, 0x3C, 0x06, 0xC6, 0x7C, 0x00, - 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00, 0xFE, 0xC0, 0xC0, 0xFC, 0x06, 0xC6, 0x7C, 0x00, - 0x38, 0x60, 0xC0, 0xFC, 0xC6, 0xC6, 0x7C, 0x00, 0xFE, 0xC6, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, - 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0x00, 0x7C, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00, - 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, - 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, - 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x7C, 0xC6, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, - 0x7C, 0xC6, 0xDE, 0xDE, 0xDE, 0xC0, 0x78, 0x00, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, - 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00, - 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, - 0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00, 0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00, - 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, 0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, - 0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, - 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xCE, 0x7C, 0x0E, - 0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00, 0x3C, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x3C, 0x00, - 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, - 0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x3C, 0x00, - 0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, - 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, - 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, - 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x66, 0xDC, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC6, 0x7C, 0x00, - 0x1C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, - 0x3C, 0x66, 0x60, 0xF8, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, - 0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x06, 0x00, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00, - 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0x00, - 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, - 0x00, 0x00, 0xDC, 0x76, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x00, - 0x30, 0x30, 0xFC, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, - 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, - 0x00, 0x00, 0x7E, 0x4C, 0x18, 0x32, 0x7E, 0x00, 0x0E, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0E, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x70, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x70, 0x00, - 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, - 0x7C, 0xC6, 0xC0, 0xC0, 0xC6, 0x7C, 0x0C, 0x78, 0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x7C, 0x82, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0xC6, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x30, 0x18, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, - 0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x7E, 0xC0, 0xC0, 0x7E, 0x0C, 0x38, - 0x7C, 0x82, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0xC6, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, - 0x30, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x7C, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, - 0xC6, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x6C, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, - 0x18, 0x30, 0xFE, 0xC0, 0xF8, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x7E, 0x12, 0xFE, 0x90, 0xFE, 0x00, - 0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00, 0x7C, 0x82, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x30, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x78, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x60, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0xC6, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x00, - 0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, 0x7C, 0x80, - 0x38, 0x6C, 0x64, 0xF0, 0x60, 0x66, 0xFC, 0x00, 0x3A, 0x6C, 0xCE, 0xD6, 0xE6, 0x6C, 0xB8, 0x00, - 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x0E, 0x1B, 0x18, 0x3C, 0x18, 0xD8, 0x70, 0x00, - 0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, 0x0C, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, - 0x0C, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x18, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, - 0x76, 0xDC, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x00, 0x76, 0xDC, 0x00, 0xE6, 0xF6, 0xDE, 0xCE, 0x00, - 0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, - 0x18, 0x00, 0x18, 0x18, 0x30, 0x63, 0x3E, 0x00, 0x7E, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, - 0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x00, 0x00, 0x63, 0xE6, 0x6C, 0x7E, 0x33, 0x66, 0xCC, 0x0F, - 0x63, 0xE6, 0x6C, 0x7A, 0x36, 0x6A, 0xDF, 0x06, 0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x00, - 0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, - 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, - 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, 0x30, 0x60, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, 0x18, 0x0C, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x7E, 0x81, 0x9D, 0xA1, 0xA1, 0x9D, 0x81, 0x7E, 0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, - 0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18, - 0x66, 0x66, 0x3C, 0x7E, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, - 0x76, 0xDC, 0x7C, 0x06, 0x7E, 0xC6, 0x7E, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x00, - 0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, - 0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, - 0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, 0x00, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0x00, - 0x30, 0x7E, 0x0C, 0x7C, 0xCC, 0xCC, 0x78, 0x00, 0xF8, 0x6C, 0x66, 0xF6, 0x66, 0x6C, 0xF8, 0x00, - 0x7C, 0x82, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0xC6, 0x00, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, - 0x30, 0x18, 0xFE, 0xC0, 0xFC, 0xC0, 0xFE, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x0C, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x3C, 0x42, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, - 0x66, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, - 0x30, 0x18, 0x3C, 0x18, 0x18, 0x18, 0x3C, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x60, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x78, 0xCC, 0xCC, 0xD8, 0xCC, 0xC6, 0xCC, 0x00, - 0x7C, 0x82, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, 0x0C, 0x06, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, - 0x76, 0xDC, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x76, 0xDC, 0x38, 0x6C, 0xC6, 0x6C, 0x38, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0xC0, 0xE0, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0xF0, - 0xF0, 0x60, 0x7C, 0x66, 0x7C, 0x60, 0xF0, 0x00, 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x7C, 0x82, 0x00, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x60, 0x30, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, - 0x18, 0x30, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, 0x0C, 0x18, 0x66, 0x66, 0x3C, 0x18, 0x3C, 0x00, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xE1, 0x32, 0xE4, 0x3A, 0xF6, 0x2A, 0x5F, 0x86, - 0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, 0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, - 0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x38, - 0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, - 0x78, 0x0C, 0x38, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x18, 0x30, 0x7C, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; diff --git a/lib/vgatxt.c b/lib/vgatxt.c deleted file mode 100644 index 83d8379..0000000 --- a/lib/vgatxt.c +++ /dev/null @@ -1,156 +0,0 @@ -#include "vga.h" -#include "memory.h" -#include "port.h" -#include "asm.h" - -#include "modes.c" -#include "fonts.c" - -#define sequencer 0x3c4 -#define misc 0x3c2 -#define ccrt 0x3D4 -#define attribs 0x3c0 -#define graphics 0x3ce -#define state 0x3da - -static u16 resX,resY,cursX,cursY; /* resolution x,y en caractères et position du curseur */ -static u16 pages,pagesize,activepage,showedpage;/* nombre de pages disponibles et taille d'une page ansi que la page active et affiché en cours*/ -static u8 vmode=0xFF; /* mode en cours d'utilisation */ -static u32 basemem; /* debut de la mémoire vidéo */ -static bool scrolling,graphic; /* Activation du défilement, Flag du mode graphique */ -static u8 font; /* n° font actuelle */ - -void showchar (u8 thechar) -{ - u8 *screen; - screen = (u8 *)basemem+activepage*pagesize+2*(cursX+cursY*resX); - *screen = thechar; - *(++screen) = 0x07; - if (cursX++>=resX) - { - cursX=0; - cursY++; - } - gotoscreen(cursX,cursY); -} - -void print (char* string) -{ - u8 *source; - source = string; - while(*source!=0x00) showchar (*source++); -} - - -void showhex (u8 src) -{ - static u8 hexadigit[16] = "0123456789ABCDEF"; - showchar(hexadigit[(src&0xF0)>>4]); - showchar(hexadigit[src&0x0F]); -} - -void clearscreen (void) -{ - gotoscreen(0,0); - memset((u8 *)(basemem+activepage*pagesize),0,2*(resY*resX),1); -} - -void gotoscreen(u16 x,u16 y) -{ - u16 pos; - pos=(cursX+cursY*resX)/2; - cursX=x; - cursY=y; - outb(ccrt,0x0E); - outb(ccrt+1,(u8)(pos&0x00FF)); - outb(ccrt,0x0D); - outb(ccrt+1,(u8)((pos&0xFF00)>>8)); -} - -void fillscreen (u8 color) -{ - memset((u8 *)(basemem+activepage*pagesize+1),color,resY*resX,2); -} - - -void loadfont(u8 num,u8 *font,u8 size) -{ - u16 seqinit[4] = { 0x0100, 0x0402, 0x0704, 0x0300 }, - graphinit[3] = { 0x0204, 0x0005, 0x0006 }, - seqend [4] = { 0x0100, 0x0302, 0x0304, 0x0300 }, - graphend[3] = { 0x0004, 0x1005, 0x0E06 }; - u8 *dest,*src; - u8 i; - dest=(u8 *)GRPHSCREEN; - src=font; - initreg(sequencer,(u8 *)seqinit ,4); - initreg(graphics ,(u8 *)graphinit,3); - if (num>3) - dest+= (((num-4)<<1)+1)<<13; - else - dest+=num<<14; - for(i=0;i<250;i++) - { - memcpy(dest,src,size); - src+=size; - dest+=size; - memset(dest,0,(32-size),1); - dest+=(32-size); - } - initreg(sequencer,(u8 *)seqend ,4); - initreg(graphics ,(u8 *)graphend,3); -} - -u8 getfont(u8 num) -{ - return font; -} - -void setfont(u8 num) -{ - font=num&0x07; - outb(sequencer,3); - outb(sequencer+1,num&0x03+(num&(0x04)<<2)); -} - -u16 setvmode(u8 choosedmode) -{ - u8 *def,mode; - mode=(choosedmode&0x7F); - if (vmode==0xFF) - { - loadfont(1 ,(u8 *)font8x8, 8); - } - if (choosedmode>0x7F) - { - if (mode>=maxgraphmode) return 1; /* mode inexistant */ - def=(u8 *)&graphmodes[mode]; - graphic=true; - } - else - { - if (mode>=maxtextmode) return 1; /* mode inexistant */ - def=(u8 *)&textmodes[mode]; - graphic=false; - } - outb(misc,def[0]); - outb(state,def[1]); - outreg(sequencer,&def[2],5); - outb(ccrt,0x11); - outb(ccrt+1,0x0E); - outreg(ccrt,&def[7],25); - outreg(graphics,&def[32],9); - inb(state); - outregsame(attribs,&def[41],21); - outb(attribs,0x20); - resX=def[63]; - resY=def[64]; - cursX=0; - cursY=0; - pagesize=2*resX*resY; - activepage=0; - vmode=mode; - pages=32768/pagesize; - basemem=(def[21]<<8)+def[22]+TEXTSCREEN; - return 0; -} \ No newline at end of file From f1710cf9ce57b4def767be6db8ffa918d2953344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:24:34 +0000 Subject: [PATCH 36/62] build: ajout du repertoire drivers et des clauses testboot et installall --- makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index bf21808..36dc59a 100644 --- a/makefile +++ b/makefile @@ -1,9 +1,10 @@ all: makall -makall: boot/boot12.bin installer/mbrol.com lib/libs.o system/system.sys +makall: drivers/drivers.o boot/boot12.bin installer/mbrol.com lib/libs.o system/system.sys sync clean: + (cd drivers; make clean) (cd system; make clean) (cd boot; make clean) (cd install; make clean) @@ -13,12 +14,21 @@ clean: backup: clean (cd .. ; tar cf - cos | gzip -f - > backup.tar.gz) +install: all + (cp system/system.sys /mnt/fd0) + allbackup: backup - (echo Inserez une disquette; sleep ; cp ../backup.tar.bz2 /dev/fd0) + (echo Inserez une disquette; sleep ; cp ../backup.tar.bz2 /mnt/fd0) + +testboot:boot/boot12.bin + (cd test ; cat ../boot/boot12.bin /dev/zero | dd of=a.img bs=512 count=2880 ; bochs) system/system.sys: (cd system; make) +drivers/drivers.o: + (cd drivers; make) + boot/boot12.bin: (cd boot; make) From 31a3c5a547e5f2a07446adc23a5e8e66d7c8868a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:25:38 +0000 Subject: [PATCH 37/62] feat: changement a nouveau de l'emplacement du message de chargement --- system/loader.asm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/loader.asm b/system/loader.asm index e241639..79af9c8 100644 --- a/system/loader.asm +++ b/system/loader.asm @@ -7,6 +7,10 @@ pop ds pop es call EnableA20 + mov si,msgpmode + call showstr + xor ax,ax + int 16h mov ax,cs mov [RealCS],ax lea ax,[Real] @@ -37,8 +41,6 @@ ;out 0x21,al mov al,0x80 out 0x70,al - mov si,msgpmode - call showstr mov eax,cr0 or al,1 From b0441884e27256e230bee438d2d486c7d1628a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:26:03 +0000 Subject: [PATCH 38/62] =?UTF-8?q?feat:=20test=20des=20nouvelles=20fonction?= =?UTF-8?q?nalit=C3=A9s=20graphiques=20de=20la=20librairie=20VGA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/system.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/system/system.c b/system/system.c index 3269251..60e746b 100644 --- a/system/system.c +++ b/system/system.c @@ -1,9 +1,18 @@ #include "vga.h" +#include "video.h" -int main(void) { - setvmode(0x1); - clearscreen(); - setfont(1); - print("Hello cos is here"); - while(1); -} \ No newline at end of file +int _main(void) { + setvmode(0x84); + cls(); + int x,y; + for(x=0;x<120;x++) + for(y=0;y<120;y++) + { + writepxl(x,y,4); + } + for(x=0;x<20000;x++) + { + print("C'est 2 test 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 c un test!"); + } + while(1); +} From 7705c7c894ee22a386664ade94eba1c774f996d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:26:29 +0000 Subject: [PATCH 39/62] =?UTF-8?q?build:=20usage=20a=20nouveau=20de=20objco?= =?UTF-8?q?py=20pour=20la=20g=C3=A9n=C3=A9ration=20de=20binaire=20pur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system/makefile b/system/makefile index 7e58e56..380b46b 100644 --- a/system/makefile +++ b/system/makefile @@ -1,20 +1,27 @@ FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c -o -LINK=ld -N -Ttext 0x100000 -e main -o + + +LINK=ld -Ttext 0x100000 -e __main -o all: system.sys sync +copy: + (cp system.sys /cygdrive/a) + system.sys: nasm -f bin -o loader.bin loader.asm nasm -f elf -o system.o system.asm $(FREEC) systemc.o system.c - $(LINK) system.bin systemc.o system.o ../lib/libs.o --oformat binary + $(LINK) system.out systemc.o system.o ../lib/libs.o + objcopy -O binary system.out system.bin cat loader.bin>system.sys cat system.bin>>system.sys clean: rm -f *.o + rm -f *.out rm -f *.bin rm -f *.sys From b2254372fb0768dc28cccff9325e97c5143a692f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:27:27 +0000 Subject: [PATCH 40/62] =?UTF-8?q?build:=20revient=20a=20la=20version=20ant?= =?UTF-8?q?=C3=A9rieur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/makefile b/makefile index 36dc59a..58052ac 100644 --- a/makefile +++ b/makefile @@ -4,7 +4,6 @@ makall: drivers/drivers.o boot/boot12.bin installer/mbrol.com lib/libs.o system/ sync clean: - (cd drivers; make clean) (cd system; make clean) (cd boot; make clean) (cd install; make clean) @@ -14,11 +13,8 @@ clean: backup: clean (cd .. ; tar cf - cos | gzip -f - > backup.tar.gz) -install: all - (cp system/system.sys /mnt/fd0) - allbackup: backup - (echo Inserez une disquette; sleep ; cp ../backup.tar.bz2 /mnt/fd0) + (echo Inserez une disquette; sleep ; cp ../backup.tar.bz2 /dev/fd0) testboot:boot/boot12.bin (cd test ; cat ../boot/boot12.bin /dev/zero | dd of=a.img bs=512 count=2880 ; bochs) From c191d4b6b293c4b3238e625063426628f471b93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:30:47 +0000 Subject: [PATCH 41/62] feat: remise en forme du fichier --- include/asm.h | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/include/asm.h b/include/asm.h index 3faa994..674f44f 100644 --- a/include/asm.h +++ b/include/asm.h @@ -1,12 +1,25 @@ #include "types.h" -#define sti() __asm__ ("sti"::) -#define cli() __asm__ ("cli"::) -#define nop() __asm__ ("nop"::) -#define iret() __asm__ ("iret"::) -#define pause() __asm__ ("iret"::) -#define outbp(port,value) \ - asm volatile ("outb %%al,%%dx; jmp 1f; 1:"::"d" (port), "a" (value)); +/******************************************************************************/ + +#define sti() asm("sti"::) + +#define cli() asm("cli"::) + +#define nop() asm("nop"::) + +#define iret() asm("addl $0x0C, %esp; \ + iret;") + +#define irqendmaster() asm("movb $0x20,%al; \ + outb %al,$0x20;") + +#define irqendslave() asm("movb $0x20,%al; \ + outb %al,$0xA0;") + +#define lidt(dtr) asm ("lidtl %0"::"m" (*dtr)) + +/******************************************************************************/ #define outb(port,value) \ asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value)); @@ -15,7 +28,9 @@ asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value)); #define outd(port,value) \ - asm volatile ("outd %%eax,%%dx"::"d" (port), "a" (value)); + asm volatile ("outl %%eax,%%dx"::"d" (port), "a" (value)); + +/******************************************************************************/ #define inb(port) ({ \ u8 _v; \ @@ -29,12 +44,17 @@ _v; \ } + #define ind(port) ({ \ u32 _v; \ - asm volatile ("ind %%dx,%%eax" : "=a" (_v) : "d"(port)); \ + asm volatile ("inl %%dx,%%eax" : "=a" (_v) : "d"(port)); \ _v; \ } +/******************************************************************************/ + +/* pas terminé */ + #define rolb(input,rotate) ({ \ u32 _v; \ asm volatile ("roll %1,%0" : "=g" (_v) : "cI" (rotate), "0" (input)); \ @@ -42,3 +62,6 @@ } + + + From bb4cd8405601edd2bb9d016eafaa499d11853bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:31:43 +0000 Subject: [PATCH 42/62] =?UTF-8?q?feat:=20ajout=20des=20d=C3=A9clarations?= =?UTF-8?q?=20des=20diff=C3=A9rents=20types=20utilis=C3=A9s=20en=20C/C++?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/ctype.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/ctype.h diff --git a/include/ctype.h b/include/ctype.h new file mode 100644 index 0000000..b5d1dc9 --- /dev/null +++ b/include/ctype.h @@ -0,0 +1,42 @@ +#ifndef __TL_CTYPE_H +#define __TL_CTYPE_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern char g_ctype[]; + +#define CT_UP 0x01 /* upper case */ +#define CT_LOW 0x02 /* lower case */ +#define CT_DIG 0x04 /* digit */ +#define CT_CTL 0x08 /* control */ +#define CT_PUN 0x10 /* punctuation */ +#define CT_WHT 0x20 /* white space (space/cr/lf/tab) */ +#define CT_HEX 0x40 /* hex digit */ +#define CT_SP 0x80 /* hard space (0x20) */ + +/* without the cast to unsigned, DJGPP complains (using -Wall) */ +#define isalnum(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW | CT_DIG)) +#define isalpha(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW)) +#define iscntrl(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_CTL)) +#define isdigit(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_DIG)) +#define isgraph(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG)) +#define islower(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_LOW)) +#define isprint(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG | CT_SP)) +#define ispunct(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_PUN)) +#define isspace(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_WHT)) +#define isupper(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_UP)) +#define isxdigit(c) ((g_ctype + 1)[(unsigned)(c)] & (CT_DIG | CT_HEX)) +#define isascii(c) ((unsigned)(c) <= 0x7F) +#define toascii(c) ((unsigned)(c) & 0x7F) + +#define tolower(c) (isupper(c) ? c + 'a' - 'A' : c) +#define toupper(c) (islower(c) ? c + 'A' - 'a' : c) + +#ifdef __cplusplus +} +#endif + +#endif From d089778aef0620e11d6b09438c5bfa77f41ac48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:35:56 +0000 Subject: [PATCH 43/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20des=20IRQ=20et=20int?= =?UTF-8?q?erruptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/idt.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/idt.h diff --git a/include/idt.h b/include/idt.h new file mode 100644 index 0000000..65f4cb9 --- /dev/null +++ b/include/idt.h @@ -0,0 +1,31 @@ +#include "types.h" + + + +#define INTGATE 0x8E00 /* utilise pour gerer les interruptions */ +#define TRAPGATE 0x8F00 /* utilise pour faire des appels systemes */ +#define TASKGATE 0x8500 /* utilise pour commuter des taches */ +#define CALLGATE 0x8C00 /* utilise pour appeler du code */ +#define LDTDES 0x8200 /* utilise pour pointer une LDT */ + +/* descripteur de segment */ +typedef struct idtdes { + u16 offset0_15; + u16 select; + u16 type; + u16 offset16_31; +} idtdes __attribute__ ((packed)); + + + + void initidt(void); + void setidt(u32 offset, u16 select, u16 type,u16 index); + void makeidtdes(u32 offset, u16 select, u16 type, idtdes* desc); + void initpic(void); + void enableirq(u8 irq); + void disableirq(u8 irq); + + + + + From fd6fa89644e1b39d46a06934daf2a5cc25178e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:36:42 +0000 Subject: [PATCH 44/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20du=20clavier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/keyboard.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 include/keyboard.h diff --git a/include/keyboard.h b/include/keyboard.h new file mode 100644 index 0000000..2739aa4 --- /dev/null +++ b/include/keyboard.h @@ -0,0 +1,62 @@ +#define SCAN_CTRL 0x1D +#define SCAN_LEFTSHIFT 0x2A +#define SCAN_RIGHTSHIFT 0x36 +#define SCAN_ALT 0x38 +#define SCAN_F1 0x3B +#define SCAN_F2 0x3C +#define SCAN_F3 0x3D +#define SCAN_F4 0x3E +#define SCAN_F5 0x3F +#define SCAN_F6 0x40 +#define SCAN_F7 0x41 +#define SCAN_F8 0x42 +#define SCAN_F9 0x43 +#define SCAN_F10 0x44 +#define SCAN_F11 0x57 +#define SCAN_F12 0x58 +#define SCAN_CAPSLOCK 0x3A +#define SCAN_NUMLOCK 0x45 +#define SCAN_SCROLLLOCK 0x46 + +/* bit de statut +0x0100 est reservé pour les touches non-ASCII */ +#define STATUS_ALT 0x0200 +#define STATUS_CTRL 0x0400 +#define STATUS_SHIFT 0x0800 +#define STATUS_ANY (STATUS_ALT | STATUS_CTRL | STATUS_SHIFT) +#define STATUS_CAPS 0x1000 +#define STATUS_NUM 0x2000 +#define STATUS_SCRL 0x4000 + +/* "ASCII" values for non-ASCII keys. All of these are user-defined.*/ + +#define KEY_F1 0x80 +#define KEY_F2 (KEY_F1 + 1) +#define KEY_F3 (KEY_F2 + 1) +#define KEY_F4 (KEY_F3 + 1) +#define KEY_F5 (KEY_F4 + 1) +#define KEY_F6 (KEY_F5 + 1) +#define KEY_F7 (KEY_F6 + 1) +#define KEY_F8 (KEY_F7 + 1) +#define KEY_F9 (KEY_F8 + 1) +#define KEY_F10 (KEY_F9 + 1) +#define KEY_F11 (KEY_F10 + 1) +#define KEY_F12 (KEY_F11 + 1) +#define KEY_INS 0x90 +#define KEY_DEL (KEY_INS + 1) +#define KEY_HOME (KEY_DEL + 1) +#define KEY_END (KEY_HOME + 1) +#define KEY_PGUP (KEY_END + 1) +#define KEY_PGDN (KEY_PGUP + 1) +#define KEY_LFT (KEY_PGDN + 1) +#define KEY_UP (KEY_LFT + 1) +#define KEY_DN (KEY_UP + 1) +#define KEY_RT (KEY_DN + 1) +#define KEY_PRNT (KEY_RT + 1) +#define KEY_PAUSE (KEY_PRNT + 1) +#define KEY_LWIN (KEY_PAUSE + 1) +#define KEY_RWIN (KEY_LWIN + 1) +#define KEY_MENU (KEY_RWIN + 1) + + +void keyboard(); From b01c2cb4794e790fccf54bf1f91b82040e4bc420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:37:07 +0000 Subject: [PATCH 45/62] =?UTF-8?q?feat:=20d=C3=A9claration=20de=20fonctions?= =?UTF-8?q?=20ayant=20rapport=20avec=20la=20gestion=20du=20timer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/timer.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 include/timer.h diff --git a/include/timer.h b/include/timer.h new file mode 100644 index 0000000..6ac62ae --- /dev/null +++ b/include/timer.h @@ -0,0 +1 @@ +void timer(); From dfb7b76e3e21082a176a1ce271a04a08f8c06a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:38:18 +0000 Subject: [PATCH 46/62] feat: ajouts de type C --- include/types.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/include/types.h b/include/types.h index 630c32d..c38a738 100644 --- a/include/types.h +++ b/include/types.h @@ -1,12 +1,63 @@ #ifndef I386_TYPE #define I386_TYPE + typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned char uchar; typedef int bool; + +struct dtr { + + u16 limite; + + u32 base; + +} __attribute__ ((packed)); + #define true 1; #define false 0; #define NULL 0x0000; + +#ifdef __cplusplus +extern "C" +{ #endif +extern char ctype[]; + +#define CT_UP 0x01 /* upper case */ +#define CT_LOW 0x02 /* lower case */ +#define CT_DIG 0x04 /* digit */ +#define CT_CTL 0x08 /* control */ +#define CT_PUN 0x10 /* punctuation */ +#define CT_WHT 0x20 /* white space (space/cr/lf/tab) */ +#define CT_HEX 0x40 /* hex digit */ +#define CT_SP 0x80 /* hard space (0x20) */ + +/* without the cast to unsigned, DJGPP complains (using -Wall) */ +#define isalnum(c) ((ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW | CT_DIG)) +#define isalpha(c) ((ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW)) +#define iscntrl(c) ((ctype + 1)[(unsigned)(c)] & (CT_CTL)) +#define isdigit(c) ((ctype + 1)[(unsigned)(c)] & (CT_DIG)) +#define isgraph(c) ((ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG)) +#define islower(c) ((ctype + 1)[(unsigned)(c)] & (CT_LOW)) +#define isprint(c) ((ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG | CT_SP)) +#define ispunct(c) ((ctype + 1)[(unsigned)(c)] & (CT_PUN)) +#define isspace(c) ((ctype + 1)[(unsigned)(c)] & (CT_WHT)) +#define isupper(c) ((ctype + 1)[(unsigned)(c)] & (CT_UP)) +#define isxdigit(c) ((ctype + 1)[(unsigned)(c)] & (CT_DIG | CT_HEX)) +#define isascii(c) ((unsigned)(c) <= 0x7F) +#define toascii(c) ((unsigned)(c) & 0x7F) + +#define tolower(c) (isupper(c) ? c + 'a' - 'A' : c) +#define toupper(c) (islower(c) ? c + 'A' - 'a' : c) + +#ifdef __cplusplus +} +#endif + +#endif + + + From c2f0c96afe52813f9e840092165d4510f025af79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:38:45 +0000 Subject: [PATCH 47/62] feat: modification de la syntaxe de certaines fonctions --- include/vga.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/vga.h b/include/vga.h index f70daf0..6195a27 100644 --- a/include/vga.h +++ b/include/vga.h @@ -2,6 +2,7 @@ #define TEXTSCREEN 0xB8000 /* debut de la memoire video texte*/ #define GRPHSCREEN 0xA0000 /* debut de la memoire video graphique*/ + typedef u8 mode_def[64]; @@ -18,7 +19,11 @@ void disablecursor (void); void enablescroll (void); void disablescroll (void); void (*writepxl)(u16 x, u16 y, u32 c); -void (*showchar)(u8 thechar); -void (*cls)(void); -void (*scroll)(u8 lines); +void (*showchar)(u16 coordx,u16 coordy,u8 thechar,u8 attrib); +void (*fill)(u8 attrib); +void (*scroll)(u8 lines,u8 attrib); + + + + From 60627eaa1789b921a3a5d3ca1dad22ce240f9fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:39:09 +0000 Subject: [PATCH 48/62] =?UTF-8?q?feat:=20ajout=20d'un=20nouvelles=20d?= =?UTF-8?q?=C3=A9claration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/video.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/video.h b/include/video.h index c96e3a1..f6129fe 100644 --- a/include/video.h +++ b/include/video.h @@ -1,2 +1,4 @@ void showhex(u8 src); +void putchar(u8 thechar); void print(u8* string); + From 3ddf9e534aae17896581ac17fd430a127524f8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:39:33 +0000 Subject: [PATCH 49/62] =?UTF-8?q?feat:=20suppression=20de=20fichiers=20obs?= =?UTF-8?q?ol=C3=A8tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/external.h | 0 include/irq.h | 19 ------------------- include/string.h | 3 --- 3 files changed, 22 deletions(-) delete mode 100644 include/external.h delete mode 100644 include/irq.h delete mode 100644 include/string.h diff --git a/include/external.h b/include/external.h deleted file mode 100644 index e69de29..0000000 diff --git a/include/irq.h b/include/irq.h deleted file mode 100644 index c11ba7a..0000000 --- a/include/irq.h +++ /dev/null @@ -1,19 +0,0 @@ -#define INTGATE 0x8E00 /* utilise pour gerer les interruptions */ -#define TRAPGATE 0x8F00 /* utilise pour faire des appels systemes */ -#define TASKGATE 0x8500 /* utilise pour commuter des taches */ -#define CALLGATE 0x8C00 /* utilise pour appeler du code */ -#define LDTDES 0x8200 /* utilise pour pointer une LDT */ - -/* descripteur de segment */ -typedef struct idtdesc { - u16 offset0_15; - u16 select; - u16 type; - u16 offset16_31; -} idtdesc __attribute__ ((packed)); - -/* registre IDTR */ -struct idtr { - u16 limite; - u32 base; -} __attribute__ ((packed)); diff --git a/include/string.h b/include/string.h deleted file mode 100644 index ec199fb..0000000 --- a/include/string.h +++ /dev/null @@ -1,3 +0,0 @@ -#include "types.h" - -void memset(void *dst, u8 val, u16 count,u32 size); From 62753f40b8ba91b4e38edb72c9a551f0be00a2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:41:00 +0000 Subject: [PATCH 50/62] =?UTF-8?q?feat:=20ensemble=20de=20fonctions=20perme?= =?UTF-8?q?ttant=20la=20gestion=20des=20IRQs=20et=20des=20interruptions=20?= =?UTF-8?q?en=20mode=20prot=C3=A9g=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/idt.c | 425 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 425 insertions(+) create mode 100644 lib/idt.c diff --git a/lib/idt.c b/lib/idt.c new file mode 100644 index 0000000..06466da --- /dev/null +++ b/lib/idt.c @@ -0,0 +1,425 @@ +#include "idt.h" +#include "types.h" +#include "asm.h" +#include "memory.h" +#include "video.h" + + /* registre idt */ +static struct dtr idtreg; + +/* table de IDT */ +static idtdes idt[256]; + + +void initpic(void) +{ + /* MASTER */ + /* Initialisation de ICW1 */ + outb(0x20,0x11); + nop(); + /* Initialisation de ICW2 - vecteur de depart = 32 */ + outb(0x21,0x20); + nop(); + /* Initialisation de ICW3 */ + outb(0x21,0x04); + nop(); + /* Initialisation de ICW4 */ + outb(0x21,0x01); + nop(); + /* masquage des interruptions */ + outb(0x21,0xFF); + nop(); + /* SLAVE */ + /* Initialisation de ICW1 */ + outb(0xA0,0x11); + nop(); + /* Initialisation de ICW2 - vecteur de depart = 96 */ + outb(0xA1,0x70); + nop(); + /* Initialisation de ICW3 */ + outb(0xA1,0x02); + nop(); + /* Initialisation de ICW4 */ + outb(0xA1,0x01); + nop(); + /* masquage des interruptions */ + outb(0xA1,0xFF); + nop(); + /* Demasquage des irqs sauf clavier + outb(0x21,0xFD); + nop(); + */ +} + +void enableirq(u8 irq) +{ +u16 port; +cli(); +port = (((irq & 0x08) << 4) + 0x21); +outb(port,inb(port) & ~(1 << (irq & 7))); +sti(); +} + +void disableirq(u8 irq) +{ +u16 port; +cli(); +port = (((irq & 0x08) << 4) + 0x21); +outb(port,inb(port) | (1 << (irq & 7))); +sti(); +} + +void makeidtdes(u32 offset, u16 select, u16 type, idtdes* desc) +{ + desc->offset0_15 = (offset & 0xffff); + desc->select = select; + desc->type = type; + desc->offset16_31 = (offset & 0xffff0000) >> 16; + return; +} + +void setidt(u32 offset, u16 select, u16 type,u16 index) +{ +cli(); +idtdes *desc; +desc=idtreg.base; + desc[index].offset0_15 = (offset & 0xffff); + desc[index].select = select; + desc[index].type = type; + desc[index].offset16_31 = (offset & 0xffff0000) >> 16; +sti(); +} + +void putidt(u32 offset, u16 select, u16 type,u16 index) +{ +idtdes temp; +makeidtdes(offset,select,type,&temp); +idt[index]=temp; +} + +void interruption() +{ + cli(); + print("Appel d'une interruption"); + sti(); + iret(); +} + +void exception0() +{ + print("divide error"); + iret(); + } + +void exception1() +{ + print("debug exception"); + iret(); + } + +void exception2() + { + print("non-maskable hardware interrupt"); + iret(); + } + +void exception3() +{ + print("INT3 instruction"); + iret(); + } + +void exception4() + { + print("INTO instruction detected overflow"); + iret(); + } + +void exception5() + { + print("BOUND instruction detected overrange"); + iret(); + } + +void exception6() +{ + print("invalid instruction opcode"); + iret(); + } + +void exception7() + { + print("no coprocessor"); + iret(); + } + +void exception8() +{ + print("double fault"); + iret(); + } + +void exception9() + { + print("coprocessor segment overrun"); + iret(); + } + +void exception10() +{ + print("invalid task state segment (TSS)"); + iret(); + } + +void exception11() + { + print("segment not present"); + iret(); + } + +void exception12() +{ + print("stack fault"); + iret(); + } + +void exception13() + { + print("general protection fault (GPF)"); + iret(); + } + +void exception14() + { + print("page fault"); + iret(); + } + +void exception15() +{ + print("(reserved)"); + iret(); + } + +void exception16() + { + print("coprocessor error"); + iret(); + } + +void exception17() +{ + print("alignment check"); + iret(); + } + +void exception18() + { + print("machine check"); + iret(); + } + +void irq0() + { + cli(); + print("irq 0"); + irqendmaster(); + sti(); + iret(); + } + + void irq1() + { + cli(); + print("irq 1"); + irqendmaster(); + sti(); + iret(); + } + + void irq2() + { + cli(); + print("irq 2"); + irqendmaster(); + sti(); + iret(); + } + + void irq3() + { + cli(); + print("irq 3"); + irqendmaster(); + sti(); + iret(); + } + + void irq4() + { + cli(); + print("irq 4"); + irqendmaster(); + sti(); + iret(); + } + + void irq5() + { + cli(); + print("irq 5"); + irqendmaster(); + sti(); + iret(); + } + + void irq6() + { + cli(); + print("irq 6"); + irqendmaster(); + sti(); + iret(); + } + +void irq7() + { + cli(); + print("irq 7"); + irqendmaster(); + sti(); + iret(); + } + +void irq8() + { + cli(); + print("irq 8"); + irqendslave(); + sti(); + iret(); + } + +void irq9() + { + cli(); + print("irq 9"); + irqendslave(); + sti(); + iret(); + } + +void irq10() + { + cli(); + print("irq 10"); + irqendslave(); + sti(); + iret(); + } + +void irq11() + { + cli(); + print("irq 11"); + irqendslave(); + sti(); + iret(); + } + +void irq12() + { + cli(); + print("irq 12"); + irqendslave(); + sti(); + iret(); + } + + void irq13() + { + cli(); + print("irq 13"); + irqendslave(); + sti(); + iret(); + } + +void irq14() + { + cli(); + print("irq 14"); + irqendslave(); + sti(); + iret(); + } + +void irq15() + { + cli(); + print("irq 15"); + irqendslave(); + sti(); + iret(); + } + + void initidt(void) +{ +u16 i; + putidt((u32)exception0, 0x30, INTGATE, 0); + putidt((u32)exception1, 0x30, INTGATE, 1); + putidt((u32)exception2, 0x30, INTGATE, 2); + putidt((u32)exception3, 0x30, INTGATE, 3); + putidt((u32)exception4, 0x30, INTGATE, 4); + putidt((u32)exception5, 0x30, INTGATE, 5); + putidt((u32)exception6, 0x30, INTGATE, 6); + putidt((u32)exception7, 0x30, INTGATE, 7); + putidt((u32)exception8, 0x30, INTGATE, 8); + putidt((u32)exception9, 0x30, INTGATE, 9); + putidt((u32)exception10, 0x30, INTGATE, 10); + putidt((u32)exception11, 0x30, INTGATE, 11); + putidt((u32)exception12, 0x30, INTGATE, 12); + putidt((u32)exception13, 0x30, INTGATE, 13); + putidt((u32)exception14, 0x30, INTGATE, 14); + putidt((u32)exception15, 0x30, INTGATE, 15); + putidt((u32)exception16, 0x30, INTGATE, 16); + putidt((u32)exception17, 0x30, INTGATE, 17); + putidt((u32)exception18, 0x30, INTGATE, 18); + for(i=19;i<32;i++) + { + putidt((u32)interruption, 0x30, INTGATE, i); + } + putidt((u32)irq0, 0x30, INTGATE, 32); + putidt((u32)irq1, 0x30, INTGATE, 33); + putidt((u32)irq2, 0x30, INTGATE, 34); + putidt((u32)irq3, 0x30, INTGATE, 35); + putidt((u32)irq4, 0x30, INTGATE, 36); + putidt((u32)irq5, 0x30, INTGATE, 37); + putidt((u32)irq6, 0x30, INTGATE, 38); + putidt((u32)irq7, 0x30, INTGATE, 39); + for(i=40;i<112;i++) + { + putidt((u32)interruption, 0x30, INTGATE, i); + } + putidt((u32)irq8, 0x30, INTGATE, 112); + putidt((u32)irq9, 0x30, INTGATE, 113); + putidt((u32)irq10, 0x30, INTGATE, 114); + putidt((u32)irq11, 0x30, INTGATE, 115); + putidt((u32)irq12, 0x30, INTGATE, 116); + putidt((u32)irq13, 0x30, INTGATE, 117); + putidt((u32)irq14, 0x30, INTGATE, 118); + putidt((u32)irq15, 0x30, INTGATE, 119); + for(i=120;i<255;i++) + { + putidt((u32)interruption, 0x30, INTGATE, i); + } + /* initialise le registre idt */ + idtreg.limite = 256*8; + idtreg.base = 0x0000000; + /* recopie de la IDT a son adresse */ + memcpy(&idt, (u8*)idtreg.base, idtreg.limite,1); + /* chargement du registre IDTR */ + lidt(&idtreg); + +} + From 6e9f38535e84b8188efb198bb4ebfd13e566e2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:41:24 +0000 Subject: [PATCH 51/62] feat: ensemble de fonctions permettant la gestion du clavier --- lib/keyboard.c | 293 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 293 insertions(+) create mode 100644 lib/keyboard.c diff --git a/lib/keyboard.c b/lib/keyboard.c new file mode 100644 index 0000000..7696e54 --- /dev/null +++ b/lib/keyboard.c @@ -0,0 +1,293 @@ +#include "idt.h" +#include "types.h" +#include "asm.h" +#include "memory.h" +#include "keyboard.h" + +#include "video.h" + +static u8 bufferscan[256]; +static u8 bufferascii[256]={0}; +static u8 ptrscan=0; +static u8 ptrascii=0; +static u16 kbdstatus,breakcode ; + +static const u8 set1_normal[] = +{ +0, 0x1B, '&', 'é', '\"', '\'', '(', '-', + 'è', '_', 'ç', 'à', ')', '=', '\b', '\t', + 'a', 'z', 'e', 'r', 't', 'y', 'u', 'i', + 'o', 'p', '^', '$', '\r', 0, 'q', 's', +'d', 'f', 'g', 'h', 'j', 'k', 'l', 'm', +'ù', '²', 0, '*', 'w', 'x', 'c', 'v', +'b', 'n', ',', ';', ':', '!', 0, '*', +0, ' ', 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, '7', +'8', '9','-', '4','5','6', '+', '1', +'2', '3','0','.',0, 0, '<', 0, +0 +}; + +static const u8 set1_shift[] = +{ +0, 0x1B, '1', '2', '3', '4', '5', '6', + '7', '8', '9', '0', '°', '+', '\b', '\t', + 'A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', + 'O', 'P', '¨', '£', '\r', 0, 'Q', 'S', +'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', +'%', 0, 0, 'µ', 'W', 'X', 'C', 'V', +'B', 'N', '?', '.', '/', '§', 0, '*', +0, ' ', 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0,0, 0, '7', +'8', '9','-', '4','5','6', '+', '1', +'2', '3','0','.',0, 0, '>', 0, +0 +}; + +static const u8 set1_alt[] = +{ +0, 0x1B, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, '\r', 0, 0, 0, +0, 0, 0,0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, '*', +0, ' ', 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0,0, 0, '7', +'8', '9','-', '4','5','6', '+', '1', +'2', '3','0','.',0, 0, 0, 0, +0 +}; + + +static const u8 set1_altgr[] = +{ +0, 0x1B, 0, '~', '#', '{', '[', '|', + '`', '\\', '^', '@', ']', '}', '\b', '\t', + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, '¤', '\r', 0, 0, 0, +0, 0, 0,0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0, 0, 0, '*', +0, ' ', 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0,0, 0, '7', +'8', '9','-', '4','5','6', '+', '1', +'2', '3','0','.',0, 0, 0, 0, +0 +}; + +static const u8 set1_ctrl[] = +{ +0, 0x1B, 0, 0,0, 0, 0x1B, 0, + 0, 0x1C, 0, 0, 0x1D, 0, 0, 0x1F, + 0x01, 0x1A, 0x05, 0x012, 0x14, 0x19, 0x15, 0x09, + 0x0F, 0x10, 0x1E, 0, 0, 0, 0x11, 0x13, +0x04, 0x06, 0x07,0x08, 0x0A, 0x0B, 0x0C, 0x0D, +0, 0, 0, 0, 0x17, 0x18, 0x03, 0x16, +0x02, 0x0E, 0, 0, 0, 0, 0, '*', +0, ' ', 0, 0, 0, 0, 0, 0, +0, 0, 0, 0, 0,0, 0, '7', +'8', '9','-', '4','5','6', '+', '1', +'2', '3','0','.',0, 0, 0, 0, +0 +}; + + +/******************************************************************************/ + +void outkbd(u8 port, u8 data) +{ + u32 timeout; + u8 state; + +/* timeout */ + for(timeout = 500000L; timeout != 0; timeout--) + { + state = inb(0x64); +/* vide le buffer du 8042 */ + if((state & 0x02) == 0) break; + } + if(timeout != 0) + outb(port, data); +} + +/******************************************************************************/ +static void reboot(void) +{ + u8 temp; + cli(); +/* vide le 8042 */ + do + { + temp = inb(0x64); + if((temp & 0x01) != 0) + { + (void)inb(0x60); + continue; + } + } while((temp & 0x02) != 0); +/* active le reset CPU */ + outb(0x64, 0xFE); + while(1) + /* boucle infinie */; +} + +/******************************************************************************/ +unsigned convert(u32 keypressed) +{ + + u8 temp,key,lastscan; +/* garde le dernier pointeur du buffer scan */ + lastscan=ptrscan; +/* incrémente le pointeur est assigne au buffer le dernier scancode */ + ptrscan++; + if (ptrscan==255) ptrscan==0; + bufferscan[ptrscan]=keypressed; +/* break key (touche relaché) ? */ + if(keypressed >= 0x80) breakcode = 1; + key = (keypressed&0x7F); +/* Mise a jour des flags lors du relachement de touches de controle */ + if(breakcode) + { + if(key == SCAN_ALT) + { + kbdstatus &= ~STATUS_ALT; + /* si ALT GR (E01D) alors activer aussi control */ + if (bufferscan[lastscan]==0xE0) kbdstatus &= ~STATUS_CTRL; + } + else if(key == SCAN_CTRL) + kbdstatus &= ~STATUS_CTRL; + else if(key == SCAN_LEFTSHIFT || key == SCAN_RIGHTSHIFT) + kbdstatus &= ~STATUS_SHIFT; + breakcode = 0; + return 0; + } +/* Mise a jour des flags lors de l'appuie de touches de controle */ + if(key == SCAN_ALT) + { + kbdstatus |= STATUS_ALT; + /* si ALT GR (E01D) alors desactiver aussi control */ + if (bufferscan[lastscan]==0xE0) kbdstatus |= STATUS_CTRL; + return 0; + } + if(key == SCAN_CTRL) + { + kbdstatus |= STATUS_CTRL; + return 0; + } + if(key == SCAN_LEFTSHIFT || key == SCAN_RIGHTSHIFT) + { + kbdstatus |= STATUS_SHIFT; + return 0; + } + +/* Scroll Lock, Num Lock, and Caps Lock mise a jour des leds */ + if(key == SCAN_SCROLLLOCK) + { + kbdstatus ^= STATUS_SCRL; + goto LEDS; + } + if(key == SCAN_NUMLOCK) + { + kbdstatus ^= STATUS_NUM; + goto LEDS; + } + if(key == SCAN_CAPSLOCK) + { + kbdstatus ^= STATUS_CAPS; +LEDS: + outkbd(0x60, 0xED); /* "mise a jour des LEDS */ + temp = 0; + if(kbdstatus & STATUS_SCRL) + temp |= 1; + if(kbdstatus & STATUS_NUM) + temp |= 2; + if(kbdstatus & STATUS_CAPS) + temp |= 4; + outkbd(0x60, temp); /* 3 bits de poids faible pour les LEDs */ + return 0; + } +/* est ce un code etendu */ +if ((bufferscan[lastscan]==0xE0)||((kbdstatus & STATUS_NUM)&&(key>=0x47)&&(key<=0x53)&&(key!=0x4A)&&(key!=0x4e))) + /* exceptions */ + { + /* '/' (E035) */ + if (key==0x35) return '/'; + /* '\r' (E01C) 2ème enter numérique*/ + if (key==0x1C) return '\r'; + /* 0x11 (E048) device control 1)*/ + if (key==0x48) return 0x11; + /* 0x12 (E050) device control 2)*/ + if (key==0x50) return 0x12; + /* 0x13 (E04b) device control 3)*/ + if (key==0x4b) return 0x13; + /* 0x14 (E04d) device control 4)*/ + if (key==0x4d) return 0x14; + /* 0x02 (E049) start of text)*/ + if (key==0x49) return 0x2; + /* 0x03 (E051) end of text)*/ + if (key==0x51) return 0x3; + /* 0x10 (E047) Line feed)*/ + if (key==0x47) return '\n'; + /* 0x1A (E052) Substitution)*/ + if (key==0x52) return 0x1A; + /* 0x18 (E053) Cancel)*/ + if (key==0x53) return 0x18; + /* 0x19 (E04f) End of medium)*/ + if (key==0x4f) return 0x19; + return 0x00; + } + else + { +/* detecte les SCANCODES invalides */ + if(key >= sizeof(set1_normal) / sizeof(set1_normal[0])) return 0; +/* converti le scancode en code ASCII en fonction du statut*/ + if (kbdstatus & STATUS_SHIFT||kbdstatus & STATUS_CAPS) + temp = set1_shift[key]; + else if ((kbdstatus & STATUS_ALT)&&(kbdstatus & STATUS_CTRL)) + temp = set1_altgr[key]; + else if (kbdstatus & STATUS_CTRL) + temp = set1_ctrl[key]; + else if (kbdstatus & STATUS_ALT) + temp = set1_alt[key]; + else + temp = set1_normal[key]; + } + +/* si scancode non reconnu fin de fonction */ + if(temp == 0) return temp; +/* Appuie de CRTL + ALT + SUPR ? */ + if((kbdstatus & STATUS_CTRL) && (kbdstatus & STATUS_ALT) && + (temp == KEY_DEL)) + { + print("redemarrage du systeme"); + reboot(); + } +/* Renvoie le Code ascii */ + return temp; +} + + +/******************************************************************************/ + +void keyboard() +{ +u8 scancode,ascii; +cli(); +while ((inb(0x64)&1)==0); +scancode=inb(0x60); +ascii = convert(scancode); +if(ascii != 0) +{ +putchar(ascii); +ptrascii++; +if (ptrascii==255) ptrascii==0; +bufferascii[ptrascii]=ascii; +} +irqendmaster(); +sti(); +iret(); +} + +/******************************************************************************/ From 1e579f83be343b217244deeaad73bd101c2a3d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:41:56 +0000 Subject: [PATCH 52/62] feat: ensemble de fonctions permettant la gestion du timer --- lib/timer.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/timer.c diff --git a/lib/timer.c b/lib/timer.c new file mode 100644 index 0000000..0a284a3 --- /dev/null +++ b/lib/timer.c @@ -0,0 +1,22 @@ +#include "idt.h" +#include "types.h" +#include "asm.h" +#include "memory.h" +#include "timer.h" +#include "vga.h" + + +static u8 curs[4]={"-\\|/"}; + +static u8 curspos=0; + + +void timer() + { + cli(); + showchar(0,0,curs[curspos],7); + curspos=(curspos+1)&0x3; + irqendmaster(); + sti(); + asm("addl $0x1C,%esp;iret;"); + } From 5b1cade36b582f523e6ab550d0ecc22b1d1a0b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:42:06 +0000 Subject: [PATCH 53/62] =?UTF-8?q?feat:=20d=C3=A9finition=20de=20type=20C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/types.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lib/types.c diff --git a/lib/types.c b/lib/types.c new file mode 100644 index 0000000..f8b7ee2 --- /dev/null +++ b/lib/types.c @@ -0,0 +1,46 @@ +#include + +char ctype[] = +{ + 0x00, +/* 0 */ CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* 8 */ CT_CTL, CT_CTL | CT_WHT, CT_CTL | CT_WHT, CT_CTL | CT_WHT, + CT_CTL | CT_WHT, CT_CTL | CT_WHT, CT_CTL, CT_CTL, +/* 16 */CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* 24 */CT_CTL, CT_CTL, CT_CTL, CT_CTL, + CT_CTL, CT_CTL, CT_CTL, CT_CTL, +/* ' ' */CT_WHT | CT_SP, CT_PUN, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '(' */CT_PUN, CT_PUN, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '0' */CT_DIG, CT_DIG, CT_DIG, CT_DIG, + CT_DIG, CT_DIG, CT_DIG, CT_DIG, +/* '8' */CT_DIG, CT_DIG, CT_PUN, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '@' */CT_PUN, CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP | CT_HEX, + CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP | CT_HEX, CT_UP, +/* 'H' */CT_UP, CT_UP, CT_UP, CT_UP, + CT_UP, CT_UP, CT_UP, CT_UP, +/* 'P' */CT_UP, CT_UP, CT_UP, CT_UP, + CT_UP, CT_UP, CT_UP, CT_UP, +/* 'X' */CT_UP, CT_UP, CT_UP, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_PUN, +/* '`' */CT_PUN, CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW | CT_HEX, + CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW | CT_HEX, CT_LOW, +/* h' */CT_LOW, CT_LOW, CT_LOW, CT_LOW, + CT_LOW, CT_LOW, CT_LOW, CT_LOW, +/* 'p' */CT_LOW, CT_LOW, CT_LOW, CT_LOW, + CT_LOW, CT_LOW, CT_LOW, CT_LOW, +/* 'x' */CT_LOW, CT_LOW, CT_LOW, CT_PUN, + CT_PUN, CT_PUN, CT_PUN, CT_CTL, +/* 128 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 144 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 160 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 176 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 192 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 208 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 224 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* 240 */0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; From c435ab7d9707c979ec36886a07d727117cb3e75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:42:34 +0000 Subject: [PATCH 54/62] feat: table de touches pour les fonctions claviers --- lib/keymap.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/keymap.c diff --git a/lib/keymap.c b/lib/keymap.c new file mode 100644 index 0000000..e69de29 From aceda50903b0641196fe68cdc8902eb7dee78e6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:43:32 +0000 Subject: [PATCH 55/62] =?UTF-8?q?feat:=20optimisations=20de=20fonctions=20?= =?UTF-8?q?vid=C3=A9os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/vga.c | 130 ++++++++++++++++++++++++++---------------------------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/lib/vga.c b/lib/vga.c index 714b59e..da946e6 100644 --- a/lib/vga.c +++ b/lib/vga.c @@ -2,29 +2,31 @@ #include "memory.h" #include "asm.h" #include "port.h" - +#include "types.h" #include "modes.c" #include "8x8fnt.c" #include "8x16fnt.c" /* Registres VGAs */ + #define sequencer 0x3c4 #define misc 0x3c2 #define ccrt 0x3D4 #define attribs 0x3c0 #define graphics 0x3ce #define state 0x3da + /* Taille d'un plan de bit */ + #define planesize 0x10000 +u16 resX,resY; /* resolution x,y en caractères*/ -static u16 resX,resY; /* resolution x,y en caractères*/ -static u16 cursX,cursY; /* position du curseur */ static u8 pages,activepage; /* nombre de pages disponibles N° de la page active*/ static u32 linesize,pagesize;/* Taille d'une ligne et d'une page */ static u8 vmode=0xFF,color; /* mode en cours d'utilisation et profondeur */ static u32 basemem; /* Adresse de la mémoire vidéo */ -static bool scrolling,graphic;/* Activation du défilement, Flag du mode graphique */ +static bool scrolling=0x1,graphic;/* Activation du défilement, Flag du mode graphique */ static u8 font; /* n° font active */ /*******************************************************************************/ @@ -56,8 +58,6 @@ void enablecursor (void) outb(ccrt, 10); curs = inb(ccrt+1)&~32; outb(ccrt+1, curs); - /* fixe la position du curseur hardware */ - gotoscr(cursX,cursY); } /*******************************************************************************/ @@ -67,7 +67,7 @@ void enablecursor (void) void disablecursor (void) { u8 curs; - /* desactive le curseur hardware */ + /* Desactive le curseur hardware */ outb(ccrt, 10); curs = inb(ccrt+1)|32; outb(ccrt+1, curs); @@ -78,6 +78,7 @@ void disablecursor (void) /* Active le scrolling en cas de débordement d'écran */ void enablescroll (void) + { scrolling=true; } @@ -139,28 +140,30 @@ u32 getbase(void) /* efface l'écran */ -void (*cls)(void); +void (*fill)(u8 attrib); -void cls_text (void) + +void fill_text (u8 attrib) { gotoscr(0,0); - memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); + memset((u8 *)(basemem+activepage*pagesize),' ',pagesize/2,2); + memset((u8 *)(basemem+activepage*pagesize+1),attrib,pagesize/2,2); } -void cls_chain (void) +void fill_chain (u8 attrib) { gotoscr(0,0); - memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); + memset((u8 *)(basemem+activepage*pagesize),attrib&0x0F,pagesize,1); } -void cls_unchain (void) +void fill_unchain (u8 attrib) { gotoscr(0,0); int i; for(i=0;i<4;i++) { useplane(i); - memset((u8 *)(basemem+activepage*pagesize),0,pagesize,1); + memset((u8 *)(basemem+activepage*pagesize),attrib&0x0F,pagesize,1); } } @@ -171,12 +174,10 @@ void cls_unchain (void) void gotoscr(u16 x,u16 y) { u16 pos; - pos=(cursX+cursY*resX)/2; - cursX=x; - cursY=y; - outb(ccrt,0x0E); + pos=(x+y*resX); + outb(ccrt,0x0F); outb(ccrt+1,(u8)(pos&0x00FF)); - outb(ccrt,0x0D); + outb(ccrt,0x0E); outb(ccrt+1,(u8)((pos&0xFF00)>>8)); } @@ -184,78 +185,77 @@ void gotoscr(u16 x,u16 y) /* Fait defiler l'ecran de n lignes vers le haut */ -void (*scroll)(u8 lines); +void (*scroll)(u8 lines,u8 attrib); -void scroll_unchain(u8 lines) +void scroll_unchain(u8 lines,u8 attrib) +{ +if (scrolling) { u8 i; for(i=0;i<4;i++) { useplane(i); memcpy((u8*)(basemem+linesize*8*lines),(u8*)basemem,pagesize-linesize*8*lines,1); - memset((u8*)(basemem+pagesize-linesize*8*lines),0,linesize*8*lines,1); + memset((u8*)(basemem+pagesize-linesize*8*lines),attrib&0x0F,linesize*8*lines,1); + } } } -void scroll_chain(u8 lines) +void scroll_chain(u8 lines,u8 attrib) +{ +if (scrolling) { memcpy((u8*)basemem+linesize*8*lines,(u8*)basemem,pagesize-linesize*8*lines,1); - memset((u8*)(basemem+pagesize-linesize*8*lines),0,linesize*8*lines,1); + memset((u8*)(basemem+pagesize-linesize*8*lines),attrib&0x0F,linesize*8*lines,1); +} } -void scroll_text(u8 lines) +void scroll_text(u8 lines,u8 attrib) +{ +if (scrolling) { memcpy((u8*)basemem+linesize*lines,(u8*)basemem,pagesize-linesize*lines,1); - memset((u8*)(basemem+pagesize-linesize*lines),0,linesize*lines,1); + memset((u8*)(basemem+pagesize-linesize*lines-2),' ',(linesize*lines)/2,2); + memset((u8*)(basemem+pagesize-linesize*lines-1),attrib,(linesize*lines)/2,2); +} } /*******************************************************************************/ /* Affiche le caractère a l'écran */ -void (*showchar)(u8 thechar); +void (*showchar)(u16 coordx,u16 coordy,u8 thechar,u8 attrib); -void showchar_graphic(u8 thechar) +void showchar_graphic(u16 coordx,u16 coordy,u8 thechar,u8 attrib) { - u8 x,y,pattern,color; + u8 x,y,pattern,set; for(y=0;y<8;y++) { pattern=font8x8[thechar*8+y]; for(x=0;x<8;x++) { - color=((pattern>>(7-x))&0x1); /* mettre un ROL importé depuis asm */ - writepxl(cursX*8+x,cursY*8+y,color*7); - } - } - if (++cursX>=resX) - { - cursX=0; - if (++cursY>=resY) - { - scroll(1); - cursY=resY-1; + set=((pattern>>(7-x))&0x1); /* mettre un ROL importé depuis asm */ + if (set==0) + writepxl(coordx*8+x,coordy*8+y,((attrib&0xF0)>>8)*set); + else + writepxl(coordx*8+x,coordy*8+y,(attrib&0x0F)*set); } } } -void showchar_text(u8 thechar) + + +void showchar_text(u16 coordx,u16 coordy,u8 thechar,u8 attrib) + { u8 *screen; - screen = (u8 *)basemem+activepage*pagesize+2*(cursX+cursY*resX); + screen = (u8 *)basemem+activepage*pagesize+2*(coordx+coordy*resX); *screen = thechar; - *(++screen) = 0x07; - if (++cursX>=resX) - { - cursX=0; - if (++cursY>=resY) - { - scroll(1); - cursY=resY-1; - } - } - gotoscr(cursX,cursY); + *(++screen) =attrib; } + + /*******************************************************************************/ /* Ecrit un pixel a l'écran */ @@ -367,9 +367,6 @@ profondeur (en bits) */ resX=def[61]; resY=def[62]; color=def[63]; - /* Remet la position du curseur logiciel a 0,0 */ - cursX=0; - cursY=0; /* Initialise l'adresse des procedures de gestion graphique et les differentes variables en fonction de la profondeur et du mode*/ if (!graphic) @@ -379,7 +376,7 @@ variables en fonction de la profondeur et du mode*/ writepxl=NULL; /* pas d'affichage de pixels */ showchar=showchar_text; scroll=scroll_text; - cls=cls_text; + fill=fill_text; pagesize=resY*linesize; } else @@ -390,21 +387,21 @@ variables en fonction de la profondeur et du mode*/ /* mode N&B */ linesize=resX; writepxl=writepxl_1bit; - cls=cls_chain; + fill=fill_chain; scroll=scroll_chain; break; case 2: /* mode 4 couleurs */ linesize=(resX<<1); writepxl=writepxl_2bits; - cls=cls_chain; + fill=fill_chain; scroll=scroll_chain; break; case 4: /* mode 16 couleurs */ linesize=resX; writepxl=writepxl_4bits; - cls=cls_unchain; + fill=fill_unchain; scroll=scroll_unchain; break; case 8: @@ -415,7 +412,7 @@ variables en fonction de la profondeur et du mode*/ linesize=(resX<<3); writepxl=writepxl_8bits; scroll=scroll_chain; - cls=cls_chain; + fill=fill_chain; } else { @@ -423,7 +420,7 @@ variables en fonction de la profondeur et du mode*/ linesize=(resX<<1); writepxl=writepxl_8bitsunchain; scroll=scroll_unchain; - cls=cls_unchain; + fill=fill_unchain; } break; default: @@ -454,6 +451,7 @@ u8 getvmode(void) /* Charge une nouvelle police de caractère */ u32 loadfont(u8* def,u8 size,u8 font) + { if (graphics==1) return 1; u8 oldregs[5]={0,0,0,0,0}; @@ -467,20 +465,16 @@ u32 loadfont(u8* def,u8 size,u8 font) /* sauve les anciens registres */ outb(sequencer,2); oldregs[0]=inb(sequencer+1); - outb(sequencer,4); oldregs[1]=inb(sequencer+1); /* Adressage paire/impair desactivé (lineaire) */ outb(sequencer+1, oldregs[1]|0x04); - outb(graphics,4); oldregs[2]=inb(graphics+1); - outb(graphics,5); oldregs[3]=inb(graphics+1); /* Adressage paire/impair desactivé (lineaire) */ outb(graphics+1, oldregs[3]&~0x10); - outb(graphics,6); oldregs[4]=inb(graphics+1); /* Adressage paire/impair desactivé (lineaire) */ @@ -492,7 +486,6 @@ u32 loadfont(u8* def,u8 size,u8 font) memcpy(def,base+i*32,size,1); def += size; } - outb(sequencer,2); outb(sequencer+1,oldregs[0]); outb(sequencer,4); @@ -529,3 +522,6 @@ void setfont(u8 num) /*******************************************************************************/ + + + From 550d622a4a6334ef565d2782ad92047258cec062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:44:12 +0000 Subject: [PATCH 56/62] =?UTF-8?q?feat:=20mise=20en=20place=20de=20gestion?= =?UTF-8?q?=20de=20l'ANSI=20et=20des=20caract=C3=A8re=20d'=C3=A9chappement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/video.c | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 266 insertions(+), 3 deletions(-) diff --git a/lib/video.c b/lib/video.c index 54fd7e9..4fa6130 100644 --- a/lib/video.c +++ b/lib/video.c @@ -1,6 +1,268 @@ #include "vga.h" #include "video.h" +u8 attrib=0x07; +u16 cursX,cursY; /* position du curseur */ +extern u16 resX,resY; /* resolution x,y en caractères*/ +u8 ansi,param1,param2,param3; + + +/*******************************************************************************/ + +/* Fixe l'attribut courant */ + +void setattrib(u8 att) +{ + static const u8 ansitovga[] = + { + 0, 4, 2, 6, 1, 5, 3, 7 + }; + u8 tempattr; + + tempattr = attrib; + if(att == 0) + tempattr &= ~0x08; /* Faible intensité */ + else if(att == 1) + tempattr |= 0x08; /* Forte intensité */ + else if(att >= 30 && att <= 37) + { + att = ansitovga[att - 30]; + tempattr = (tempattr & ~0x07) | att;/* couleur de premier plan */ + } + else if(att >= 40 && att <= 47) + { + att = ansitovga[att - 40] << 4; + tempattr = (tempattr & ~0x70) | att;/* couleur de fond */ + } + attrib = tempattr; +} + +/*******************************************************************************/ + +/* gere l'ansi */ + +bool makeansi(u8 c) +{ +/* state machine to handle the escape sequences */ + switch(ansi) + { + case 0: +/* ESC -- next state */ + if(c == 0x1B) + { + ansi++; + return 1; /* "I handled it" */ + } + break; +/* ESC */ + case 1: + if(c == '[') + { + ansi++; + param1 = 0; + return 1; + } + break; +/* ESC[ */ + case 2: + if(isdigit(c)) + { + param1 = param1 * 10 + c - '0'; + return 1; + } + else if(c == ';') + { + ansi++; + param2 = 0; + return 1; + } +/* ESC[2J -- efface l'ecran */ + else if(c == 'J') + { + if(param1 == 2) + { + fill(attrib); + ansi = 0; + return 1; + } + } +/* ESC[num1m -- met l'attribut num1 */ + else if(c == 'm') + { + setattrib(param1); + ansi = 0; + return 1; + } +/* ESC[num1A -- bouge le curseur de num1 vers le haut */ + else if(c == 'A') + { + cursY-=param1; + ansi = 0; + gotoscr(cursX,cursY); + return 1; + } +/* ESC[num1B -- bouge le curseur de num1 vers le bas */ + else if(c == 'B') + { + cursY+=param1; + ansi = 0; + gotoscr(cursX,cursY); + return 1; + } +/* ESC[num1C -- bouge le curseur de num1 vers la gauche */ + else if(c == 'C') + { + cursX-=param1; + ansi = 0; + gotoscr(cursX,cursY); + return 1; + } +/* ESC[num1D -- bouge le curseur de num1 vers la droite */ + else if(c == 'D') + { + cursX+=param1; + ansi = 0; + gotoscr(cursX,cursY); + return 1; + } + break; +/* ESC[num1; */ + case 3: + if(isdigit(c)) + { + param2 = param2 * 10 + c - '0'; + return 1; + } + else if(c == ';') + { + ansi++; + param3 = 0; + return 1; + } +/* ESC[num1;num2H ou ESC[num1;num2f-- bouge le curseur en num1,num2 */ + else if((c == 'H')||(c == 'f')) + { + /* Remet la position du curseur matériel a num1,num2 */ + gotoscr(param2,param1); + /* Remet la position du curseur logiciel a num1,num2 */ + cursX=param2; + cursY=param1; + ansi = 0; + return 1; + } +/* ESC[num1;num2m -- met les attributs num1,num2 */ + else if(c == 'm') + { + setattrib(param1); + setattrib(param2); + ansi = 0; + return 1; + } + break; +/* ESC[num1;num2;num3 */ + case 4: + if(isdigit(c)) + { + param3 = param3 * 10 + c - '0'; + return 1; + } +/* ESC[num1;num2;num3m -- met les attributs num1,num2,num3 */ + else if(c == 'm') + { + setattrib(param1); + setattrib(param2); + setattrib(param3); + ansi = 0; + return 1; + } + break; +/* Mauvais etat >> reset */ + default: + ansi = 0; + break; + } + ansi = 0; + return 0; /* Ansi fini ;)*/ +} + +/*******************************************************************************/ + +/* affiche un caractère a l'écran */ + +void putchar(u8 thechar) +{ +if(makeansi(thechar)) return; +switch (thechar) +{ +case 0x11: +if (cursY>0) cursY--; +break; +case 0x12: +if (cursY0) cursX--; +break; +case 0x14: +if (cursX0) +{ +cursX=resX-1; +cursY--; +} +} +else +{ +cursX--; +} +showchar(cursX,cursY,' ',attrib); +break; +case '\t': +cursX=(cursX + 8) & ~(8 - 1); +break; +case '\n': +cursX=0; +break; +case '\r': +cursX=0; +cursY++; +break; +default: +if (thechar>=' ') +{ +showchar(cursX,cursY,thechar,attrib); +cursX++; +} +break; +} +if (cursX>=resX) + { + cursX=0; + cursY++; + } +if (cursY>=resY) + { + scroll(1,attrib); + cursY=resY-1; + } + gotoscr(cursX,cursY); +} + /*******************************************************************************/ /* affiche une chaine de caractère a l'écran */ @@ -11,7 +273,7 @@ void print(u8* string) source = string; while(*source!=0x00) { - showchar(*source++); + putchar(*source++); } } @@ -22,8 +284,9 @@ void print(u8* string) void showhex(u8 src) { static u8 hexadigit[16] = "0123456789ABCDEF"; - showchar(hexadigit[(src&0xF0)>>4]); - showchar(hexadigit[src&0x0F]); + putchar(hexadigit[(src&0xF0)>>4]); + putchar(hexadigit[src&0x0F]); } /*******************************************************************************/ + From c1e4dbd597f35d0fcc3efa9bc4c31111681d9fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:44:25 +0000 Subject: [PATCH 57/62] build: mise a jour des modules a compiler --- lib/makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/makefile b/lib/makefile index aa6f96b..393d055 100644 --- a/lib/makefile +++ b/lib/makefile @@ -1,6 +1,6 @@ FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c PARTIAL=ld -r -o -OBJS= memory.o vga.o port.o video.o +OBJS= memory.o vga.o port.o video.o idt.o timer.o keyboard.o types.o all: makeall @@ -11,6 +11,18 @@ libs.o:$(OBJS) vga.o:vga.c $(FREEC) $^ + +types.o:types.c + $(FREEC) $^ + +idt.o:idt.c + $(FREEC) $^ + +keyboard.o:keyboard.c + $(FREEC) $^ + +timer.o:timer.c + $(FREEC) $^ video.o:video.c $(FREEC) $^ From 35fb7f85352ea8c3ef28eb08123d6d2976545ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:44:45 +0000 Subject: [PATCH 58/62] =?UTF-8?q?refactor:=20suppression=20des=20fichiers?= =?UTF-8?q?=20obsol=C3=A8tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/irq.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 lib/irq.c diff --git a/lib/irq.c b/lib/irq.c deleted file mode 100644 index 6c78754..0000000 --- a/lib/irq.c +++ /dev/null @@ -1,36 +0,0 @@ -void setpic(void) -{ - /* MASTER */ - /* Initialisation de ICW1 */ - outbp(0x20,0x11); - /* Initialisation de ICW2 - vecteur de depart = 32 */ - outbp(0x21,0x20); - /* Initialisation de ICW3 */ - outbp(0x21,0x04); - /* Initialisation de ICW4 */ - outbp(0x21,0x01); - /* masquage des interruptions */ - outbp(0x21,0xFF); - /* SLAVE */ - /* Initialisation de ICW1 */ - outbp(0xA0,0x11); - /* Initialisation de ICW2 - vecteur de depart = 96 */ - outbp(0xA1,0x70); - /* Initialisation de ICW3 */ - outbp(0xA1,0x02); - /* Initialisation de ICW4 */ - outbp(0xA1,0x01); - /* masquage des interruptions */ - outbp(0xA1,0xFF); - /* Demasquage des irqs */ - outbp(0x21,0xFD); -} - -void makeidtdesc(u32 offset, u16 select, u16 type, idtdesc* desc) -{ - desc->offset0_15 = (offset & 0xffff); - desc->select = select; - desc->type = type; - desc->offset16_31 = (offset & 0xffff0000) >> 16; - return; -} From c1e18097a6471271363dd240fa599d4197273c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:45:39 +0000 Subject: [PATCH 59/62] =?UTF-8?q?feat:=20suppression=20de=20l'attente=20de?= =?UTF-8?q?=20l'appuie=20sur=20une=20touche=20avant=20de=20pass=C3=A9=20en?= =?UTF-8?q?=20PMODE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/loader.asm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/system/loader.asm b/system/loader.asm index 79af9c8..7b9deef 100644 --- a/system/loader.asm +++ b/system/loader.asm @@ -6,11 +6,9 @@ push cs pop ds pop es - call EnableA20 - mov si,msgpmode + call EnableA20 + mov si,msgpmode call showstr - xor ax,ax - int 16h mov ax,cs mov [RealCS],ax lea ax,[Real] @@ -52,7 +50,7 @@ GoPMode32: [BITS 32] mov ax,SYS_DATA_SEL mov ds,ax - mov ecx,20000/4 + mov ecx,50000/4 cld mov esi,kernel mov edi,0x100000 From 571ba62e2c26b59704c5a15861d2621008044952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:46:07 +0000 Subject: [PATCH 60/62] build: suppression de clause copy --- system/makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/system/makefile b/system/makefile index 380b46b..74d3e0f 100644 --- a/system/makefile +++ b/system/makefile @@ -6,9 +6,6 @@ LINK=ld -Ttext 0x100000 -e __main -o all: system.sys sync -copy: - (cp system.sys /cygdrive/a) - system.sys: nasm -f bin -o loader.bin loader.asm nasm -f elf -o system.o system.asm From c446ca3608b88e02db4094f689d17ad76546480f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:47:30 +0000 Subject: [PATCH 61/62] feat: initialisation de l'idt Initialisation du controleur 8259a Installation du handler "timer" Installation du handler "clavier" --- system/system.c | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/system/system.c b/system/system.c index 60e746b..e656776 100644 --- a/system/system.c +++ b/system/system.c @@ -1,18 +1,40 @@ #include "vga.h" #include "video.h" +#include "idt.h" +#include "timer.h" +#include "keyboard.h" +#include "asm.h" + +u8 printok[]=" \033[37m\033[1m[ \033[32mOK\033[37m ]\033[0m\r\n"; int _main(void) { - setvmode(0x84); - cls(); - int x,y; - for(x=0;x<120;x++) - for(y=0;y<120;y++) - { - writepxl(x,y,4); - } - for(x=0;x<20000;x++) - { - print("C'est 2 test 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 c un test!"); - } + cli(); + setvmode(0x02); + /* Efface l'ecran */ + print("\033[2J"); + print("Noyau charge en memoire"); + print(printok); + print("Initilisation de la table d'interruption"); + initidt(); + print(printok); + print("Initialisation du controleur d'interruption"); + initpic(); + print(printok); + print("Activation logicielle des interruptions"); + sti(); + print(printok); + print("Installation du handler timer"); + setidt((u32)timer, 0x30, INTGATE, 32); + print(printok); + print("Activation de l'IRQ 0"); + enableirq(0); + print(printok); + print("Installation du handler clavier"); + setidt((u32)keyboard, 0x30, INTGATE, 33); + print(printok); + print("Activation de l'IRQ 1"); + enableirq(1); + print(printok); while(1); } + From f4a08297e922c48564aca8e82534dd106e642ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:48:46 +0000 Subject: [PATCH 62/62] build: remise en forme totale de la compilation --- makefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/makefile b/makefile index 58052ac..34a9474 100644 --- a/makefile +++ b/makefile @@ -1,35 +1,33 @@ all: makall -makall: drivers/drivers.o boot/boot12.bin installer/mbrol.com lib/libs.o system/system.sys +makall: boot/boot12.bin lib/libs.o system/system.sys sync clean: (cd system; make clean) (cd boot; make clean) - (cd install; make clean) (cd lib;make clean) sync backup: clean - (cd .. ; tar cf - cos | gzip -f - > backup.tar.gz) + (cd .. ; tar cf - cosc | gzip -f - > backup.tar.gz ; cd cosc) allbackup: backup (echo Inserez une disquette; sleep ; cp ../backup.tar.bz2 /dev/fd0) -testboot:boot/boot12.bin - (cd test ; cat ../boot/boot12.bin /dev/zero | dd of=a.img bs=512 count=2880 ; bochs) +copy: + (cp system/system.sys /cygdrive/a) + +copy2: + (cp system/system.sys /cygdrive/b) + +test: clean all copy2 system/system.sys: (cd system; make) -drivers/drivers.o: - (cd drivers; make) - boot/boot12.bin: (cd boot; make) -installer/mbrol.com: - (cd install; make) - lib/libs.o: - (cd lib; make) \ No newline at end of file + (cd lib; make)