fix bad command and name

This commit is contained in:
rick 2023-09-13 16:05:29 +02:00
parent 951c4fee39
commit 54593c95f9
Signed by: Rick
GPG key ID: 5CBE8779CD27BCBA
2 changed files with 7 additions and 7 deletions

View file

@ -3,15 +3,15 @@
void fb_write_cell(unsigned int i, char c, unsigned char fg, unsigned char bg) void fb_write_cell(unsigned int i, char c, unsigned char fg, unsigned char bg)
{ {
char *fb = (char*) 0xB8000; // adresse du framebuffer char *fb = (char *) FB_ADDRESS;
*(fb + i) = c; *(fb + i) = c;
*(fb + i + 1) = (fg & 0x0F) | ((bg & 0x0F) << 4); *(fb + i + 1) = ((bg & 0x0F) << 4) | (fg & 0x0F);
} }
void fb_move_cursor(unsigned short pos) void fb_move_cursor(unsigned short pos)
{ {
outb(FB_COMMAND_PORT, FB_HIGH_BYTE_COMMAND); outb(FB_ADDRESS_PORT, FB_HIGH_BYTE_COMMAND);
outb(FB_DATA_PORT, (pos >> 8) & 0x00FF); outb(FB_DATA_PORT, (pos >> 8) & 0x00FF);
outb(FB_COMMAND_PORT, FB_HIGH_BYTE_COMMAND); outb(FB_ADDRESS_PORT, FB_LOW_BYTE_COMMAND);
outb(FB_DATA_PORT, pos & 0x00FF); outb(FB_DATA_PORT, pos & 0x00FF);
} }

View file

@ -21,14 +21,14 @@
* @def FB_ADDRESS * @def FB_ADDRESS
* L'adresse mémoire du mode texte couleur du VGA. * L'adresse mémoire du mode texte couleur du VGA.
*/ */
#define FB_ADDRESS 0xB800 #define FB_ADDRESS 0x000B8000
/** /**
* @def FB_COMMAND_PORT * @def FB_ADDRESS_PORT
* Le port pour pouvoir indiquer le sous-registre que l'on souhaite modifier * Le port pour pouvoir indiquer le sous-registre que l'on souhaite modifier
* dans le framebuffer VGA. Il s'agit du registre d'adresses. * dans le framebuffer VGA. Il s'agit du registre d'adresses.
*/ */
#define FB_COMMAND_PORT 0x3D4 #define FB_ADDRESS_PORT 0x3D4
/** /**
* @def FB_DATA_PORT * @def FB_DATA_PORT