feat: preparation du pilote VESA
This commit is contained in:
parent
aac62edd51
commit
26faaf8713
|
@ -0,0 +1,47 @@
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
||||||
|
/* */
|
||||||
|
#include "types.h"
|
||||||
|
#include "video.h"
|
||||||
|
|
||||||
|
#define STATE 0x3da
|
||||||
|
|
||||||
|
/* fonction obligatoires */
|
||||||
|
u8 *VESA_detect_hardware (void);
|
||||||
|
u8 VESA_setvideo_mode (u8 mode);
|
||||||
|
u8 *VESA_getvideo_drivername (void);
|
||||||
|
u8 *VESA_getvideo_capabilities (void);
|
||||||
|
videoinfos *VESA_getvideo_info (void);
|
||||||
|
u32 VESA_mem_to_video (void *src,u32 dst, u32 size, bool increment_src);
|
||||||
|
u32 VESA_video_to_mem (u32 src,void *dst, u32 size);
|
||||||
|
u32 VESA_video_to_video (u32 src,u32 dst, u32 size);
|
||||||
|
void VESA_wait_vretrace (void);
|
||||||
|
void VESA_wait_hretrace (void);
|
||||||
|
void VESA_page_set (u8 page);
|
||||||
|
void VESA_page_show (u8 page);
|
||||||
|
void VESA_dummy ();
|
||||||
|
|
||||||
|
static videofonction vesafonctions =
|
||||||
|
{
|
||||||
|
&VESA_detect_hardware,
|
||||||
|
&VESA_setvideo_mode,
|
||||||
|
&VESA_getvideo_drivername,
|
||||||
|
&VESA_getvideo_capabilities,
|
||||||
|
&VESA_getvideo_info,
|
||||||
|
&VESA_mem_to_video,
|
||||||
|
&VESA_video_to_mem,
|
||||||
|
&VESA_video_to_video,
|
||||||
|
&VESA_wait_vretrace,
|
||||||
|
&VESA_wait_hretrace,
|
||||||
|
&VESA_page_set,
|
||||||
|
&VESA_page_show,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy,
|
||||||
|
&VESA_dummy
|
||||||
|
};
|
|
@ -115,7 +115,7 @@ void VGA_font2_set (u8 num);
|
||||||
void VGA_blink_enable (void);
|
void VGA_blink_enable (void);
|
||||||
void VGA_blink_disable (void);
|
void VGA_blink_disable (void);
|
||||||
|
|
||||||
static videofonction fonctions =
|
static videofonction vgafonctions =
|
||||||
{
|
{
|
||||||
&VGA_detect_hardware,
|
&VGA_detect_hardware,
|
||||||
&VGA_setvideo_mode,
|
&VGA_setvideo_mode,
|
||||||
|
|
|
@ -365,7 +365,7 @@ int mode(u8* commandline)
|
||||||
}
|
}
|
||||||
strgetitem(commandline, &arg, ' ', 1);
|
strgetitem(commandline, &arg, ' ', 1);
|
||||||
argint=strtoint(&arg);
|
argint=strtoint(&arg);
|
||||||
setvideo_mode(argint);
|
changemode(argint);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
||||||
|
/* */
|
||||||
|
#include "vesa.h"
|
||||||
|
#include "video.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "asm.h"
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
static videoinfos infos;
|
||||||
|
|
||||||
|
static capabilities vesacapabilities[] = {
|
||||||
|
{0xFF,000,000,false, 0, 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Detecte si le hardware est disponible, return NULL ou pointeur sur le type de pilote */
|
||||||
|
u8 *VESA_detect_hardware(void) {
|
||||||
|
return "LEGACY";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Change le mode video courant */
|
||||||
|
/* ERR 0 aucune
|
||||||
|
/* ERR 1 mode non existant */
|
||||||
|
|
||||||
|
static u8 realsize;
|
||||||
|
|
||||||
|
u8 VESA_setvideo_mode(u8 mode)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Renvoie le nom du driver */
|
||||||
|
u8 *VESA_getvideo_drivername (void) {
|
||||||
|
return "VESA";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Renvoie un pointeur sur la structure des capacités graphiques */
|
||||||
|
|
||||||
|
u8 *VESA_getvideo_capabilities (void) {
|
||||||
|
return vesacapabilities;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Renvoie un pointeur sur l'état courant de la carte */
|
||||||
|
videoinfos *VESA_getvideo_info (void) {
|
||||||
|
return &infos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Effecture un mouvement de la mémoire centrale vers la mémoire video (linéarisée) */
|
||||||
|
u32 VESA_mem_to_video (void *src,u32 dst, u32 size, bool increment_src) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Effecture un mouvement de la mémoire video (linéarisée) vers la mémoire centrale*/
|
||||||
|
u32 VESA_video_to_mem (u32 src,void *dst, u32 size)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Effecture un mouvement de la mémoire video (linéarisé) vers la mémoire vidéo (linéarisée) */
|
||||||
|
u32 VESA_video_to_video (u32 src,u32 dst, u32 size)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Fixe la page ecran de travail */
|
||||||
|
|
||||||
|
void VESA_page_set(u8 page)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Affiche la page ecran specifié */
|
||||||
|
|
||||||
|
void VESA_page_show(u8 page)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Fonction inutile */
|
||||||
|
|
||||||
|
void VESA_dummy(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Attend la retrace verticale */
|
||||||
|
|
||||||
|
void VESA_wait_vretrace(void)
|
||||||
|
{
|
||||||
|
while ((inb(STATE) & 8) == 0) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Attend la retrace horizontale */
|
||||||
|
|
||||||
|
void VESA_wait_hretrace(void)
|
||||||
|
{
|
||||||
|
while ((inb(STATE) & 1) == 0) ;
|
||||||
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
/* COS2000 - Compatible Operating System - LGPL v3 - Hordé Nicolas */
|
||||||
/* */
|
/* */
|
||||||
#include "vga.h"
|
#include "vga.h"
|
||||||
|
#include "vesa.h"
|
||||||
#include "asm.h"
|
#include "asm.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "stdarg.h"
|
#include "stdarg.h"
|
||||||
|
@ -213,6 +214,7 @@ void changemode(u8 mode)
|
||||||
width=(vinfo->currentwidth>>3);
|
width=(vinfo->currentwidth>>3);
|
||||||
height=(vinfo->currentheight>>3);
|
height=(vinfo->currentheight>>3);
|
||||||
}
|
}
|
||||||
|
clearscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************/
|
/*******************************************************************************/
|
||||||
|
@ -974,9 +976,10 @@ void apply_nextvideomode(void) {
|
||||||
void initvideo(void)
|
void initvideo(void)
|
||||||
{
|
{
|
||||||
initdriver();
|
initdriver();
|
||||||
registerdriver(&fonctions);
|
registerdriver(&vgafonctions);
|
||||||
|
registerdriver(&vesafonctions);
|
||||||
apply_driver("VGA");
|
apply_driver("VGA");
|
||||||
changemode(0x83);
|
changemode(0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue