Merge branch 'release/2.1.0'

This commit is contained in:
Nicolas Hordé 2007-04-02 13:44:45 +00:00
commit 79d2d1a7cc
34 changed files with 2636 additions and 378 deletions

View File

@ -1,13 +0,0 @@
all: makall
makall: vga/vga.o
sync
clean:
(cd vga; make clean)
vga/vga.o:
(cd vga; make)

View File

@ -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

View File

@ -1,5 +0,0 @@
[BITS 32]
SECTION .text

View File

@ -1 +0,0 @@
#include <vga.h>

View File

@ -1,14 +1,36 @@
#include "types.h"
#define sti() __asm__ ("sti"::)
#define cli() __asm__ ("cli"::)
#define nop() __asm__ ("nop"::)
#define iret() __asm__ ("iret"::)
/******************************************************************************/
#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));
#define outw(port,value) \
asm volatile ("outb %%ax,%%dx"::"d" (port), "a" (value));
asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value));
#define outd(port,value) \
asm volatile ("outl %%eax,%%dx"::"d" (port), "a" (value));
/******************************************************************************/
#define inb(port) ({ \
u8 _v; \
@ -20,4 +42,26 @@
u16 _v; \
asm volatile ("inw %%dx,%%ax" : "=a" (_v) : "d"(port)); \
_v; \
})
}
#define ind(port) ({ \
u32 _v; \
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)); \
_v; \
}

42
include/ctype.h Normal file
View File

@ -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

31
include/idt.h Normal file
View File

@ -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);

62
include/keyboard.h Normal file
View File

@ -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();

5
include/memory.h Normal file
View File

@ -0,0 +1,5 @@
#include "types.h"
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);

6
include/port.h Normal file
View File

@ -0,0 +1,6 @@
#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);

View File

@ -1,3 +0,0 @@
#include "types.h"
void memset(void *dst, u8 val, u16 count,u32 size);

1
include/timer.h Normal file
View File

@ -0,0 +1 @@
void timer();

View File

@ -1,11 +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

View File

@ -5,6 +5,25 @@
typedef u8 mode_def[64];
void print (u8* string);
void cls (void);
u16 setvmode(u8);
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)(u16 coordx,u16 coordy,u8 thechar,u8 attrib);
void (*fill)(u8 attrib);
void (*scroll)(u8 lines,u8 attrib);

4
include/video.h Normal file
View File

@ -0,0 +1,4 @@
void showhex(u8 src);
void putchar(u8 thechar);
void print(u8* string);

View File

@ -1,6 +1,6 @@
all: makall
makall:
makall: iflop/iflop.com mbrol/mbrol.com
sync
clean:
@ -16,4 +16,3 @@ mbrol/mbrol.com:

259
lib/8x16fnt.c Normal file
View File

@ -0,0 +1,259 @@
/* Police de caract鑽e 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
};

View File

@ -1,130 +1,131 @@
/* Police de caract鑽e 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, 0xD6, 0x10, 0x38,
0x10, 0x38, 0x7C, 0xFE, 0xFE, 0x7C, 0x10, 0x38, 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 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, 0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18,
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, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C,
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, 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,
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,
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
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
};

425
lib/idt.c Normal file
View File

@ -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);
}

293
lib/keyboard.c Normal file
View File

@ -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();
}
/******************************************************************************/

0
lib/keymap.c Normal file
View File

View File

@ -1,16 +1,36 @@
FREEC=gcc -O2 -nostdinc -ffreestanding -fno-builtin -fomit-frame-pointer -Wall -I ../Include -c
PARTIAL=-r
OBJS= string.o vgatxt.o
PARTIAL=ld -r -o
OBJS= memory.o vga.o port.o video.o idt.o timer.o keyboard.o types.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) $^
string.o:string.c
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) $^
port.o:port.c
$(FREEC) $^
memory.o:memory.c
$(FREEC) $^
clean:
rm -f *.o

46
lib/memory.c Normal file
View File

@ -0,0 +1,46 @@
#include "types.h"
/*******************************************************************************/
/* Copie un octet une ou plusieurs fois en mémoire */
void memset(void *dst, u8 val, u32 count,u32 size)
{
u8 *temp;
for(temp = (u8 *)dst; count != 0; count--)
{
temp+=size;
*temp = val;
}
}
/*******************************************************************************/
/* Copie une portion de mémoire vers une autre */
void memcpy(void *src, void *dst, u32 count, u32 size)
{
char *s, *d;
u32 i;
s = (u8*) src;
d = (u8*) dst;
for(i=0;i<count;i++){
*(d+i*size) = *(s+i);
}
}
/*******************************************************************************/
/* Compare 2 portions de mémoire */
u32 memcmp(void *src, void *dst, u32 count, u32 size)
{
const u8 *mem1 = (const u8 *)src;
const u8 *mem2 = (const u8 *)dst;
for(; count != 0; count--)
{
if(*mem1 != *mem2)
return *mem1 - *mem2;
mem1+=size;
mem2+=size;
}
}
/*******************************************************************************/

View File

@ -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
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 1, 80*25 16 couleurs */
/*80*25 16 couleurs mode 0x01*/
{
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, 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 2, 80*50 16 couleurs */
/*80*50 16 couleurs mode 0x02*/
{
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,
0xCF,0x00,0x0F,0x00,0x00,
80,50
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
},
/*MODE 3, 100*50 16 couleurs */
/*100*50 16 couleurs mode 0x03*/
{
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
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
},
/*MODE 4, 100*60 16 couleurs */
/*100*60 16 couleurs mode 0x04*/
{
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
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
},
/*MODE 82, 320*480 256 couleurs */
/*640*480 16 couleurs mode 0x82*/
{
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
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
},
/*MODE 83, 360*480 256 couleurs */
/*720*480 16 couleurs mode 0x83*/
{
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
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 84, 400*600 256 couleurs */
/*800*600 16 couleurs mode 0x84*/
{
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
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
},
/*320*200 256 couleurs RAPIDE mode 0x85*/
{
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
},
/*320*200 256 couleurs mode 0x86*/
{
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
}
};

68
lib/port.c Normal file
View File

@ -0,0 +1,68 @@
#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;
for(i=0;i<num;i++)
{
outb(port,i);
outb(port+1,*src++);
}
}
/*******************************************************************************/
/* Envoie une série d'octet a destination d'une portion de mémoire
vers le registre video spécifié (accés data et index confondu) */
void outregsame(u16 port,u8 *src,u16 num)
{
int i;
for(i=0;i<num;i++)
{
inb(port);
outb(port,i);
outb(port,*src++);
}
}
/*******************************************************************************/
/* Récupère une série d'octet en provenance d'un registre video spécifié
vers portion de mémoire */
void inreg(u16 port,u8 *src,u16 num)
{
int i;
for(i=0;i<num;i++)
{
outb(port,i);
*src++=inb(port+1);
}
}
/*******************************************************************************/
/* Récupère une série d'octet en provenance d'un registre video spécifié
vers portion de mémoire (accés data et index confondu) */
void inregsame(u16 port,u8 *src,u16 num)
{
int i;
for(i=0;i<num;i++)
{
inb(port);
outb(port,i);
*src++=inb(port);
}
}
/*******************************************************************************/

View File

@ -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;
}
}

22
lib/timer.c Normal file
View File

@ -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;");
}

46
lib/types.c Normal file
View File

@ -0,0 +1,46 @@
#include <types.h>
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
};

527
lib/vga.c Normal file
View File

@ -0,0 +1,527 @@
#include "vga.h"
#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 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=0x1,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);
}
/*******************************************************************************/
/* 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 (*fill)(u8 attrib);
void fill_text (u8 attrib)
{
gotoscr(0,0);
memset((u8 *)(basemem+activepage*pagesize),' ',pagesize/2,2);
memset((u8 *)(basemem+activepage*pagesize+1),attrib,pagesize/2,2);
}
void fill_chain (u8 attrib)
{
gotoscr(0,0);
memset((u8 *)(basemem+activepage*pagesize),attrib&0x0F,pagesize,1);
}
void fill_unchain (u8 attrib)
{
gotoscr(0,0);
int i;
for(i=0;i<4;i++)
{
useplane(i);
memset((u8 *)(basemem+activepage*pagesize),attrib&0x0F,pagesize,1);
}
}
/*******************************************************************************/
/* fixe la position du curseur texte */
void gotoscr(u16 x,u16 y)
{
u16 pos;
pos=(x+y*resX);
outb(ccrt,0x0F);
outb(ccrt+1,(u8)(pos&0x00FF));
outb(ccrt,0x0E);
outb(ccrt+1,(u8)((pos&0xFF00)>>8));
}
/*******************************************************************************/
/* Fait defiler l'ecran de n lignes vers le haut */
void (*scroll)(u8 lines,u8 attrib);
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),attrib&0x0F,linesize*8*lines,1);
}
}
}
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),attrib&0x0F,linesize*8*lines,1);
}
}
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-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)(u16 coordx,u16 coordy,u8 thechar,u8 attrib);
void showchar_graphic(u16 coordx,u16 coordy,u8 thechar,u8 attrib)
{
u8 x,y,pattern,set;
for(y=0;y<8;y++)
{
pattern=font8x8[thechar*8+y];
for(x=0;x<8;x++)
{
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(u16 coordx,u16 coordy,u8 thechar,u8 attrib)
{
u8 *screen;
screen = (u8 *)basemem+activepage*pagesize+2*(coordx+coordy*resX);
*screen = thechar;
*(++screen) =attrib;
}
/*******************************************************************************/
/* 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];
/* 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;
fill=fill_text;
pagesize=resY*linesize;
}
else
{
switch(color)
{
case 1:
/* mode N&B */
linesize=resX;
writepxl=writepxl_1bit;
fill=fill_chain;
scroll=scroll_chain;
break;
case 2:
/* mode 4 couleurs */
linesize=(resX<<1);
writepxl=writepxl_2bits;
fill=fill_chain;
scroll=scroll_chain;
break;
case 4:
/* mode 16 couleurs */
linesize=resX;
writepxl=writepxl_4bits;
fill=fill_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;
fill=fill_chain;
}
else
{
/* mode non chainé */
linesize=(resX<<1);
writepxl=writepxl_8bitsunchain;
scroll=scroll_unchain;
fill=fill_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));
}
/*******************************************************************************/

View File

@ -1,88 +0,0 @@
#include "vga.h"
#include "string.h"
#include "asm.h"
#include "modes.c"
#include "8x8fnt.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; /* 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)
{
u8 *source,*screen;
source = string;
screen = (u8 *)TEXTSCREEN;
while(*source!=0x00)
{
*screen = *source;
screen+=2;
source++;
}
}
void cls (void)
{
memset((u8 *)TEXTSCREEN,0x20,(80*25*2),2);
}
u16 setvmode(u8 choosedmode)
{
u8 *def,i,mode;
mode=choosedmode&0x7F;
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++);
outb(state,*def++);
for(i=0;i<5;i++)
{
outb(sequencer,i);
outb(sequencer+1,*def++);
}
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(attribs,0x20);
return 0;
}

292
lib/video.c Normal file
View File

@ -0,0 +1,292 @@
#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 (cursY<resY-1) cursY++;
break;
case 0x13:
if (cursX>0) cursX--;
break;
case 0x14:
if (cursX<resX-1) cursX++;
break;
case 0x2:
cursX=0;
cursY=0;
break;
case 0x3:
cursX=0;
cursY=resY-1;
break;
case 0x19:
cursX=resX-1;
break;
case '\b':
if (cursX==0)
{
if (cursY>0)
{
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 */
void print(u8* string)
{
u8 *source;
source = string;
while(*source!=0x00)
{
putchar(*source++);
}
}
/*******************************************************************************/
/* affiche un octet sous forme hexadécimale a l'ecran */
void showhex(u8 src)
{
static u8 hexadigit[16] = "0123456789ABCDEF";
putchar(hexadigit[(src&0xF0)>>4]);
putchar(hexadigit[src&0x0F]);
}
/*******************************************************************************/

View File

@ -1,29 +1,33 @@
all: makall
makall: 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)
copy:
(cp system/system.sys /cygdrive/a)
copy2:
(cp system/system.sys /cygdrive/b)
test: clean all copy2
system/system.sys:
(cd system; make)
boot/boot12.bin:
(cd boot; make)
installer/mbrol.com:
(cd install; make)
lib/libs.o:
(cd lib; make)

View File

@ -6,12 +6,6 @@ LINK=ld -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

View File

@ -1,8 +1,40 @@
#include "vga.h"
#include "video.h"
#include "idt.h"
#include "timer.h"
#include "keyboard.h"
#include "asm.h"
int __main(void) {
setvmode(1);
cls();
print("Hello cos is here !");
while(1);
u8 printok[]=" \033[37m\033[1m[ \033[32mOK\033[37m ]\033[0m\r\n";
int _main(void) {
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);
}