Debug stuff

This commit is contained in:
Adrien Bourmault 2019-03-11 15:23:01 +01:00
parent 1beaf2b46d
commit fe12e3bca9
6 changed files with 13 additions and 12 deletions

View File

@ -35,7 +35,7 @@ CINCLUDES=-Ikaleid/include
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large // -std=gnu11
CFLAGS2=_ASMTYPE -mno-red-zone -mno-mmx -mno-sse -mno-sse2
CFLAGS=$(CFLAGS1) $(CFLAGS2)
CFLAGS=$(CFLAGS1) $(CFLAGS2) -DNDEBUG
CC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES)

View File

@ -96,6 +96,9 @@ extern Terminal_t *stdOut;
#define GetStdOut() (stdOut)
#define SetStdOut(x) (stdOut = (x))
// Debug purposes
volatile ushort *vga;
//------------------------------------------//
#ifndef _NO_DEBUG

View File

@ -39,14 +39,12 @@ noreturn void StartKern(void *mbInfo, int mbMagic)
// We're not ready to deal with interrupts
DisableIRQs();
volatile ushort *vga = (volatile ushort *)0xB8000;
// Kernel terminals
//InitTerms();
InitTerms();
*vga++ = ('A' << 8 | 0x0F);
*vga = 'A' | (0x0F << 8);
// We're out
StartPanic("Goodbye World :(");
// StartPanic("Goodbye World :(");
}

View File

@ -27,5 +27,7 @@
int cpuCount = 1;
Processor_t cpuTable[NCPUS] = {0};
Terminal_t *stdOut, *stdDbg;
Terminal_t *stdOut = 0, *stdDbg = 0;
volatile ushort *vga = (volatile ushort *)0xB8000;

View File

@ -32,12 +32,10 @@ extern Terminal_t VGA_Terminal;
//
void InitTerms(void)
{
KalAssert(!GetStdOut() && !GetStdDbg());
//KalAssert(!GetStdOut() && !GetStdDbg());
VGA_Init();
// vgaTerm.initDone = INITOK;
SetStdDbg(&VGA_Terminal);
SetStdOut(&VGA_Terminal);

View File

@ -37,12 +37,12 @@
#define VGA_ComputeEntry(ch, cl) (((ushort)(ch)) | (ushort)(cl) << 8)
//
// Fill terminal with '\0'
// Clear terminal
//
error_t VGA_ClearTermUnlocked(Terminal_t *term)
{
const uchar color = VGA_ComputeColorCode(term->fgColor, term->bgColor);
const ushort filler = VGA_ComputeEntry('\0', color);
const ushort filler = VGA_ComputeEntry(' ', color);
const size_t bufsize = term->width * term->height;
// Fill the buffer