Cursor is better

This commit is contained in:
Adrien Bourmault 2019-04-22 17:19:53 +02:00
parent b27b12e49c
commit f7deeb1e37
3 changed files with 15 additions and 7 deletions

View File

@ -92,6 +92,13 @@ enum {
FEAT_EDX_PBE = 1 << 31 FEAT_EDX_PBE = 1 << 31
}; };
// -------------------------------------------------------------------------- //
typedef struct {
ushort length;
void* base;
} __attribute__((packed)) Idtr_t;
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
#endif #endif

View File

@ -22,17 +22,18 @@
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. // // along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
#include <kernel/base.h> #include <kernel/base.h>
#include <kernel/cpu.h>
extern void lidt(Idtr_t reg);
// //
// Registers the new idt in the idtr register. // Registers the new idt in the idtr register.
// //
static inline void lidt(void* idtAddr, ushort size) static inline void loadIdt(void* idtAddr, ushort size)
{ {
// The IDTR register structure that will be sent // The IDTR register structure that will be sent
struct { Idtr_t IDTR = { size, idtAddr };
ushort length;
void* base;
} __attribute__((packed)) IDTR = { size, idtAddr };
asm volatile( "lidt %0" : : "m"(IDTR) ); lidt(IDTR);
} }

View File

@ -29,7 +29,7 @@
void IoEnableCursor(void) void IoEnableCursor(void)
{ {
IoWriteByteOnPort(0x3D4, 0xA); IoWriteByteOnPort(0x3D4, 0xA);
IoWriteByteOnPort(0x3D5, (IoReadByteFromPort(0x3D5) & 0xC0)); IoWriteByteOnPort(0x3D5, (IoReadByteFromPort(0x3D5) & 0xC0) | 15);
IoWriteByteOnPort(0x3D4, 0xB); IoWriteByteOnPort(0x3D4, 0xB);
IoWriteByteOnPort(0x3D5, (IoReadByteFromPort(0x3D5) & 0xE0) | 15); IoWriteByteOnPort(0x3D5, (IoReadByteFromPort(0x3D5) & 0xE0) | 15);